I have an ActiveX control in MSVC++10 which compiles into a .ocx. I have added another "ATL Simple Object" to this control, from which I want to export some functions.
If this library is called OcxTest
, I have to perform the following steps to export a function:
Declare the function as protected member of the class
COcxTestCtrl
(as generated by the Project Wizard) in the file OcxTestCtrl.h.Define the function in OcxTestCtrl.cpp.
Add it to the Dispatch Map in OcxTestCtrl.cpp:
BEGIN_DISPATCH_MAP(COcxTestCtrl, COleControl) DISP_FUNCTION_ID(COcxTestCtrl, "Test", 1, Test, VT_I4, VTS_I4 VTS_I4) END_DISPATCH_MAP()
Add it to the IDL in OcxTest.idl at the following point:
[ uuid(...), version(1.0), control ] library OcxTestLib { importlib(STDOLE_TLB); [ uuid(...) ] dispinterface _DOcxTest { properties: methods: [id(1)] int Test(int x, int y); };
Now, I'm a bit lost as to where I define the exports for the other "ATL Simple Object" that I added to the project. I guess the first two steps are analogous to what I wrote. What about the other two steps?
Is the definition of the Dispatch Map completely analogous to that of the main object?
Where in the IDL do I have to put the exported function?