#1 Burning Software

It is currently Thu Dec 19, 2024 5:01 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Receiving callback's for StartBurn OCX-version
PostPosted: Tue Aug 08, 2006 1:12 pm 
Offline

Joined: Mon Aug 07, 2006 8:23 am
Posts: 3
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 08, 2006 9:01 pm 
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


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

Joined: Mon Aug 07, 2006 8:23 am
Posts: 3
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 "<pathto>//StarBurn.ocx" named_guids no_namespace
class MyStarBurnCallBack :
public IDispatchImpl< IStarBurnCallBack, &IID_IStarBurnCallBack, &LIBID_StarBurn>,
public CComObjectRoot,
public CComCoClass< MyStarBurnCallBack, &CLSID_CSimpleCallBack >
{
...
}

/Gunnar


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 09, 2006 10:47 am 
Are there many people using OCX from Visual C++? Maybe it's time to make an ATL/MFC sample for OCX?

Regards,
Alexander Orlovsky


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 55 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group