March 6th, 2004, 02:50 PM
It usually does not work to try to get around MFC and the ClassWizard and such if you are guessing at what needs to be done. I doubt that inserting a TYPELIB statement in that manner will work. We seldom need to modify the rc file directly ourselves. It is not likely to work; probably the TYPELIB statement will be deleted again as soon as you modify the resources using the resource editor.
Last edited by Sam Hobbs; March 6th, 2004 at 08:33 PM.
March 6th, 2004, 03:31 PM
You're right it does take it out again
Is it a setup in the Project to tell it to link to the .tlb file?
March 6th, 2004, 03:43 PM
Have you used the AutoClik tutorial? It is in the MFC tutorials; look in your copy of the VC documentatio for the Visual C++ Tutorials (Visual C++ Tutorials) page; you will see the Autoclik: Automation tutorial listed there. I think that if you use that tutorial, you won't flounder as much.
When you create the (CMessageCenter) class for your Automation object, what do you derive from? It has been a while since I did any Automation server development myself so I forget the details. I should go through the Autoclik tutorial too.
March 6th, 2004, 03:55 PM
Thanks I will look at that.
I derived my automation class from CWnd. I did this because I wanted to add a tray icon.
March 6th, 2004, 04:07 PM
CWnd is not likely to work. CWnd is difficult to use unless it is a child of another window. If you make your object derived from a window object, then you probably need to create a class derived from CFrameWnd and then use the derived class for your Automation object. However I think that would be a mistake too.
Probably the Automation object should be drived from a non-window class. You can still create a window in the Automation server, and methods and properties can be provided to control the winow, but my guess is that the object itself should not be derived from CWnd or any class derived from CWnd.
However if there is anything anywhere saying that using CWnd for your Automation object will work, then I am probably wrong.
March 6th, 2004, 04:53 PM
In the AutoClik tutorial is ODL File for Creating a Type Library. It says that the odl gets compiled to a tlb; it does not say anything about the type library being put into the resources. I think that putting the type library into the resources is an additional step but I don't know what that is.
Also, the AutoClik Automation object is a CDocument-derived class, correct? Of course, a DLL Automation server does not have a document (initially) but I make that point just to show that it is probably not normal to use a dialog or other window for the object.
Last edited by Sam Hobbs; March 6th, 2004 at 04:57 PM.
March 6th, 2004, 07:29 PM
Thanks for your help Sam.
I just finished the tutorial and I'm about to start some different approaches for my automation control.
I'll let you know what happens
(I live of Sycamore and Royal, I got confused with the Knolls, I thought it was the Knolls appartment complex in TO of Av. De Los Arboles. I used to live right accross the street from that.)
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!