Link to home
Start Free TrialLog in
Avatar of wdhough
wdhough

asked on

IMPLEMENT_OLECREATE & Automation

Hi,

I am trying to enable OLE automation in one of my applications.  I want to use the IMPLEMENT_OLECREATE macro, however i am having difficulty.

this is the macro as mentioned on the msdn website.

IMPLEMENT_OLECREATE(class_name, external_name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8 )

I have several questions.

1.  class_name - What class  my CWinApp Derived class?
2. i understand the " l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8 " part is the clsid of the application.  How do i find out what my clsid for my app is?

thanks, also if you can point me in the direction of a good how to do on this that would appreciated
ASKER CERTIFIED SOLUTION
Avatar of mahesh1402
mahesh1402
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wdhough
wdhough

ASKER

Mahesh,

Thanks for your response.  I have managed to do that. but when compiling now it says

c:\test\apps\MyApp.cpp(54): error C2039: 'factory' : is not a member of 'MyApp'
c:\test\apps\MyApp.cpp(54): error C2039: 'guid' : is not a member of 'MyApp'
c:\test\apps\MyApp.h(7) : see declaration of 'MyApp'
c:\test\apps\MyApp.cpp(54): error C2065: 'guid' : undeclared identifier
c:\test\apps\MyApp.cpp(54): error C2039: 'guid' : is not a member of 'MyApp'
c:\test\apps\MyApp.h(7) : see declaration of 'MyApp'
c:\test\apps\MyApp.cpp(54): error C2373: 'guid' : redefinition; different type modifiers
Avatar of wdhough

ASKER

Aplogies,

I left out the DECLARE_OLECREATE(name) in the .h file.

Avatar of wdhough

ASKER

Mahesh,  I know have most of the application up and running (so to speak).  My application is an Exe that has interfaces in it that external applications can access and use for automation.  I have added a new interface for my new class.  I have written a quick app (in c#), litterally a form with a button on it, that when clicked should instantiate my application object.

The problem i am receiving is

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in WindowsApplication1.exe
 Additional information: COM object with CLSID {157A834E-77AD-4012-8437-3BB3C9007E2E} is either not valid or not registered.

I have checked through the object browser and it can see the object i am trying to instantiate, i have taken this project over from someone else who set up the other interfaces and i dont know how they "registered" them.  Any ideas

Many thanks

Will