Topic: How to organize registration Callback of ActiveX (ATL) a component
- I have DLL-ku which is written on Si ( to driver Bluetooth) and which has event handling from the driver by means of setting Callback.
- I have ActiveX a component-cover to this DLL-ke, created in VS2008 by means of technology ATL.
All is remarkable - methods in DLL work, properties change.
There is a pair of events, which DLL.
To them it is possible to cling by means of standard Si-shnyh of callback-functions (in this case - even without arguments, it is pure notification messages).
Wrote static - without arguments which gave in DLL-ku as Callback-a in the designer of a component.
Faced a problem: event in most Ah-component is generated by a call of its function-internal of public method FireMyNotyfyEvent ().
all ATL-code also did not find a variable through which it is possible to reach a class method from the outside.
Tried to create a static variable-index on a copy a class and to initialize it in designer AX of a component. And then to pull through it of medical odes of generation of event in a component.
The regional ohm - a method is caused, but on access obtaining to the local data.
If the same method FireMyNotyfyEvent () to cause from other method of a class of a component, all transits normally - event .
Means - a problem in the correct method call of a class of component FireMyNotyfyEvent () from exterior static callback-function.
Both static function and its prototype in DLL have identical Si-shnyj a format of the agreement on a call of functions. Here the dirty trick with a stack is not present.
But on a class I probably receive the pointer incorrect, or inadmissible for access to a class method.
How it is correct to pull a class method AH from exterior static function?