Russ Lundberg
May 5th, 1999, 07:42 PM
I have created a project that uses raw COM to get IDispatch and then Interface pointers.
Now I want to create C++ Class Wrappers and make life much easier.
I have done the following to accomplish my goal:
In MSVC++ 6 select View|ClassWizard .... then select "Add Class" button then "From Type Library..". Enter path for COM DLL, and select all classes and then press OK. The CPP and H files are created with my class wrappers.
Then I use CoCreateInstance() as in like:
HRESULT hr = CoCreateInstance(CLSID_mySystem,NULL,CLSCTX_INPROC_SERVER |
CLSCTX_LOCAL_SERVER,IID_IADSystem,(void**)&pIMyObj);
Then I try to use a method like:
pIMyObj->Connect( vObject );
I receive an access denied whatever method I try to call. I have traced the problem through to the Invoke function where the exception is received.
If anyone has done this before I would greatly appreaciate some advice of where to proceed from here.
Thanks in advance!
Russ
Now I want to create C++ Class Wrappers and make life much easier.
I have done the following to accomplish my goal:
In MSVC++ 6 select View|ClassWizard .... then select "Add Class" button then "From Type Library..". Enter path for COM DLL, and select all classes and then press OK. The CPP and H files are created with my class wrappers.
Then I use CoCreateInstance() as in like:
HRESULT hr = CoCreateInstance(CLSID_mySystem,NULL,CLSCTX_INPROC_SERVER |
CLSCTX_LOCAL_SERVER,IID_IADSystem,(void**)&pIMyObj);
Then I try to use a method like:
pIMyObj->Connect( vObject );
I receive an access denied whatever method I try to call. I have traced the problem through to the Invoke function where the exception is received.
If anyone has done this before I would greatly appreaciate some advice of where to proceed from here.
Thanks in advance!
Russ