Click here to Skip to main content
16,004,860 members
Home / Discussions / COM
   

COM

 
GeneralAdding ActiveX control in ActiveX control Project Pin
Muhammad Azam9-Sep-04 4:14
Muhammad Azam9-Sep-04 4:14 
GeneralRe: Adding ActiveX control in ActiveX control Project Pin
herbert_chow10-Sep-04 7:46
herbert_chow10-Sep-04 7:46 
GeneralRe: Adding ActiveX control in ActiveX control Project Pin
Muhammad Azam12-Sep-04 18:51
Muhammad Azam12-Sep-04 18:51 
GeneralThread Safety Problem Pin
.Suchit9-Sep-04 3:17
.Suchit9-Sep-04 3:17 
GeneralRe: Thread Safety Problem Pin
Jörgen Sigvardsson12-Sep-04 9:21
Jörgen Sigvardsson12-Sep-04 9:21 
GeneralRe: Thread Safety Problem Pin
.Suchit14-Sep-04 4:06
.Suchit14-Sep-04 4:06 
QuestionHow to create a autofill toolbar like of google Pin
akszn8-Sep-04 23:09
akszn8-Sep-04 23:09 
GeneralCapture event Pin
andy_cn8-Sep-04 22:15
andy_cn8-Sep-04 22:15 
I have a standard componenet developed in VC.Net which will fire an event. The .Net component will send two parameters of type object with that event.
I used VC++6.0 to develop my vc++ client,
In the corresponding .idl file the declaration of the event handler is like:
methods:
[id(0x00000001), helpstring("method Moved")]
void Moved(
[in] long XPosition,
[in] long YPosition);

I have done the following in my VC++ application.

1. I have created a class derived from IDispEventImpl,as follows:

class CSinkObj : public IDispEventImpl<idc_srcobj, csinkobj="">
{
public:
HWND m_hWndList;
CSinkObj(HWND hWnd = NULL) : m_hWndList(hWnd)
{
}
BEGIN_SINK_MAP(CSinkObj)
SINK_ENTRY(IDC_SRCOBJ, 1, Moved)
END_SINK_MAP()
void __stdcall Moved(long XPosition, long YPosition)
{
AfxMessageBox("Event notification handled in MFC client");
}
};


2. In the CPP file,
I get the address using cocreateinstance and I used the AtlGetObjectSourceInterface and DispEventAdvise for my object ,as follows:

m_pSinkObj = new CSinkObj(hWndCtrl);
HRESULT hr = m_pStageSrcObj.CoCreateInstance(CLSID_Stage,NULL,
CLSCTX_INPROC_SERVER);
_ASSERTE(SUCCEEDED(hr));
hr = AtlGetObjectSourceInterface(m_pStageSrcObj, &m_pSinkObj->m_libid,
&m_pSinkObj->m_iid, &m_pSinkObj->m_wMajorVerNum, &m_pSinkObj->m_wMinorVerNum);
_ASSERTE(SUCCEEDED(hr));

all above can be compiled and linked successfully,and i set a breakpoint at AtlGetObjectSourceInterface and step over,the problem appeared like : m_pSinkObj->m_libid is not NULL,but m_pSinkObj->m_iid is NULL,so the HRESULT value returned failed! so I am not able to capture the event from the component.
Can any one of you please tell me the solution for my problem... or is there any other way to capture the event from a VC.Net component in VC++6.0

thanks !

andy_cn
Generalobject of MFC class in ATL Dll Pin
zahid_ash8-Sep-04 20:59
zahid_ash8-Sep-04 20:59 
Generala problem with connecting evevts to sink Pin
andy_cn8-Sep-04 17:05
andy_cn8-Sep-04 17:05 
GeneralIAddresBook problem Pin
Irek Zielinski7-Sep-04 7:50
Irek Zielinski7-Sep-04 7:50 
GeneralReterive OCX properties from handle Pin
mohandasgandhiG6-Sep-04 23:24
mohandasgandhiG6-Sep-04 23:24 
GeneralWrapping an existing COM object Pin
lemur26-Sep-04 4:43
lemur26-Sep-04 4:43 
GeneralRe: Wrapping an existing COM object Pin
Jörgen Sigvardsson6-Sep-04 8:56
Jörgen Sigvardsson6-Sep-04 8:56 
GeneralRe: Wrapping an existing COM object Pin
lemur26-Sep-04 20:28
lemur26-Sep-04 20:28 
GeneralRe: Wrapping an existing COM object Pin
lemur26-Sep-04 21:15
lemur26-Sep-04 21:15 
GeneralATL dialog with ActiveX control inside Windows service Pin
6-Sep-04 2:42
suss6-Sep-04 2:42 
GeneralDiffernce between ATL DLL, ATL Service and ATL EXE Pin
zahid_ash5-Sep-04 20:20
zahid_ash5-Sep-04 20:20 
GeneralRe: Differnce between ATL DLL, ATL Service and ATL EXE Pin
Jörgen Sigvardsson6-Sep-04 9:02
Jörgen Sigvardsson6-Sep-04 9:02 
Generalregistering windows service Pin
prasadbs5-Sep-04 17:42
prasadbs5-Sep-04 17:42 
GeneralDo I need to destory a SAFEARRAY that is passed in as an argument Pin
timtanbin3-Sep-04 19:57
timtanbin3-Sep-04 19:57 
GeneralRe: Do I need to destory a SAFEARRAY that is passed in as an argument Pin
Anonymous4-Sep-04 8:23
Anonymous4-Sep-04 8:23 
GeneralRe: Do I need to destory a SAFEARRAY that is passed in as an argument Pin
timtanbin4-Sep-04 13:32
timtanbin4-Sep-04 13:32 
GeneralRe: Do I need to destory a SAFEARRAY that is passed in as an argument Pin
peterchen4-Sep-04 15:00
peterchen4-Sep-04 15:00 
QuestionHow to extract data from VARIANT? Pin
Nirav Doshi3-Sep-04 7:41
Nirav Doshi3-Sep-04 7:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.