Failed to get ATL mount points

I am trying to create a COM component using ATL and I would like to raise events for my VB client. I found many tutorials, all of which seem to vary in detail, and none of them create a working solution. That's what I'm doing:

(using Visual Studio 2008):

  • Create a new ATL DLL project. I called him ATLEventTest.
  • Class view: right-click on ATLEventTest, a new ATL Simple Object class is added. I named this MyObjectone that generated CMyObject, IMyObjectetc.
  • This object was created using: a) Apartment carving b) Aggregation c) Dual interface d) ISupportErrorInfo e) Connection points

  • Right click on CProxy_IMyObjectEvents<T>, click "Add Feature"

  • The function has a return type void with a name someEventand accepts int testParam.
  • Rebuild.
    (At this stage, I should see somewhere “We realize the connection point”, I don’t ...)
  • Right click on CMyObject. 'Add connection point'
  • Moved ' _IMyObjectEvents' to list.
  • Did the code search go through in my solution. Unable to find someEventanywhere!
  • Added function someEvent. Now it is found in ATLEventTest_i.h
  • Must be able to call fire_someEvent(...)in my code, but cannot.

. - , , , , ..

" " ++ idl, , : (

+3
6

, :

(ATL) @MSDN

, , MyObject.idl dispinterface _IMyObjectEvents. CProxy_IMyObjectEvents <T> _IMyObjectEvents , IDL, , . _IMyObjectEvents_CP.h Fire_someEvent() . , , someEvent().

, .

  • ATL DLL. ATLEventTest1.
  • .
  • : ATLEventTest1, ATL Simple Object. MyObject.
  • a) Thread Threading b) c) , .
  • .
  • : ATLEventTest1Lib, _MyObjectEvents " ".
  • void someEvent int testParam [in].
  • "[in] int testParam" .
  • " IDL" . "".
  • : CMyObject, "...", " ".
  • _IMyObjectEvents " > ", . "".
  • .
  • , CMyObject, Fire_someEvent(). ATLEventTest1.idl _IMyObjectEvents; _IMyObjectEvents_CP.h Fire_someEvent().
+5

IProvideClassInfo/IProvideClassInfo2? , VB , .

:

public IProvideClassInfo2Impl<&CLSID_MyClass NULL, &LIBID_ATLEventTest, 1, 0>,

COM_INTERFACE_ENTRY(IProvideClassInfo)
COM_INTERFACE_ENTRY(IProvideClassInfo2)
+1

, . VB? , (, ). COM- (MTA).

0

Ok. Visual Studio 2005, Visual Studio 2008. 2005 . , 2008 . , VS2005 ATL...

, .

0

. MSDN . , .

, , IDL. , theres "Fire _".

, .

0

, _I *** Events .h. .

0

Source: https://habr.com/ru/post/1710439/


All Articles