How do you instance a new COM object and pass it as a parameter in an event. For example...
Error messageCode:// Event declare in IDL [id(1), helpstring("method GotServer")] HRESULT GotServer(IServerInfo** pServer); // ------------- My code to attempt to instance a ServerInfo object and fire and event passing it ------------ CComPtr< IServerInfo > pNewServer; HRESULT hr = pNewServer.CoCreateInstance(__uuidof(ServerInfo)); if(SUCCEEDED(hr)) { // Populate COM object properties here..... // Now Fire Event. Fire_GotServer(pNewServer); <- This doesn't work. }
error C2664: 'Fire_GotServer' : cannot convert parameter 1 from 'class ATL::CComPtr<struct IServerInfo>' to 'struct IServerInfo ** '




Reply With Quote