Pass window handle to COM from C#

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I want to pass window Handle to my COM from c#.
in IDL [id(17), helpstring("method SetWindowHandle")] HRESULT SetWindowHandle([in]LONG_PTR** hwnd);

in .cppSTDMETHODIMP CActiveIXFSSIU::SetWindowHandle(LONG_PTR** hwnd)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());

this->m_hWnd = (HWND)&hwnd;

return S_OK;
}

in C#;private void button2_Click(object sender, EventArgs e)
{
AXT.SetWindowHandle(this.Handle);
}



but my program is not working.... :(

View the full article
 
Back
Top