RocketDivision.Com Forum IndexRocketDivision.Com
RDS - software that rocks!
 
 FAQFAQ             
        

Receiving callback's for StartBurn OCX-version

 
      RocketDivision.Com Forum Index -> StarBurn SDK
View previous topic :: View next topic  
AuthorMessage
gbostrom



Joined: 07 Aug 2006
Posts: 2

PostPosted: Tue Aug 08, 2006 1:12 pm    Post subject: Receiving callback's for StartBurn OCX-version

Hi everybody,

could someone please explain me how to receive the notifications from the various processing in the StarBurn OCX SDK.
The skeleton below miss the proper implementation of the overidden callback class. I get errors relating to the the IDispatch and IUnknown implementation....

class MyStarBurnCallBack : public IStarBurnCallBack
{
public:
HRESULT __stdcall raw_ProgressCallBack (
/*[in]*/ long Percent,
/*[in]*/ long TimeRemaining )
{ // do something... }
};

TheBurnerThread
{
IDevicesPtr aDevicesPtr;
aDevicesPtr.CreateInstance("StarBurn.Devices");

IDevicePtr aDevicePtr = aDevicesPtr->GetDevice(XXX);
//!!
MyStarBurnCallBack myCallback;
aDevicePtr->PutCallback(&myCallback);
//!!
...
aDevicePtr->TrackAtOnceFromFileSystemHandle(aJolietImage->GetFileSystemHandle(),aTestWrite,VARIANT_FALSE);
...
aDevicePtr->CloseSession();
}

From compiler:
can't instantiate due to missing implementation of the IDispatch and the IUnknown-interface's
I know there exists default implementaitons such as IDispatchImpl and CComObject, but I don't see how to find all the
IID's and GUID's.

Thanks,
Gunnar
Back to top
alexander (staff)



Joined: 02 Jul 2004
Posts: 73

PostPosted: Tue Aug 08, 2006 9:01 pm    Post subject:

Hi!

So you are using Visual C++ and #import directive to generate smart pointers definitions? Then to generate IIDs and LIBID just add named_guids option to #import directive.

Regards,
Alexander Orlovsky
Back to top
gbostrom



Joined: 07 Aug 2006
Posts: 2

PostPosted: Wed Aug 09, 2006 10:09 am    Post subject:

Thanks,

this made it. After some messing with ATL classes I made the callback start to arrive correctly.

For those interested, the stuff below might help someone:

#import "//StarBurn.ocx" named_guids no_namespace
class MyStarBurnCallBack :
public IDispatchImpl,
public CComObjectRoot,
public CComCoClass
{
...
}

/Gunnar
Back to top
alexander (staff)



Joined: 02 Jul 2004
Posts: 73

PostPosted: Wed Aug 09, 2006 10:47 am    Post subject:

Are there many people using OCX from Visual C++? Maybe it's time to make an ATL/MFC sample for OCX?

Regards,
Alexander Orlovsky
Back to top
      RocketDivision.Com Forum Index -> StarBurn SDK
Page 1 of 1