Click here to Skip to main content
15,923,789 members
Home / Discussions / COM
   

COM

 
AnswerRe: valeur HRESULT Pin
User 716709-Aug-07 4:49
User 716709-Aug-07 4:49 
QuestionDocumentcompleted load event handler problem with AJAX Pin
_tasleem28-Jul-07 6:11
_tasleem28-Jul-07 6:11 
QuestionCasting error when using com-objects as parameters Pin
Erling Hagen27-Jul-07 6:12
Erling Hagen27-Jul-07 6:12 
Questionerror C2065 for CoInitializeEx Pin
koumodaki27-Jul-07 4:14
koumodaki27-Jul-07 4:14 
AnswerRe: error C2065 for CoInitializeEx Pin
CPallini27-Jul-07 4:41
mveCPallini27-Jul-07 4:41 
GeneralRe: error C2065 for CoInitializeEx Pin
koumodaki27-Jul-07 4:53
koumodaki27-Jul-07 4:53 
AnswerRe: error C2065 for CoInitializeEx Pin
Michael Dunn27-Jul-07 10:29
sitebuilderMichael Dunn27-Jul-07 10:29 
QuestionDCOM Connection Points Pin
Nath999927-Jul-07 2:19
Nath999927-Jul-07 2:19 
Hi
I'm working on a program which connects to a machine and then has to do provisionning. For the moment the connection works. I work with an API which operates with requests and confirmations. Each composant of the API implements 3 interfaces : an interface for the request Ixxx, an interface for the events IxxxEvents and the IUnknown interface (COM/DCOM).

I can do all the requests I want. But my problem is, I have never a confirmation. The confirmations are fontions which have to be implemented but, if i do right understand, that I don't have to call.

I saw in COM/DCOM documentation that I had to create connection points in order to receive automatically the confirmations corresponding to the requests. I think my error is in the Advise() function. I don't know what I have to pass for the first parameter in this function.

I saw on internet that the first parameter is a pointer on the IUnknow interface of the sink object. But I don't really understand what is the sink object here. Do I have to create a class ? A class that inherits from something ?


I don’t understand also how I have to implement the QueryInterface method() in the case of the IID is the IUnknown identifier.


Here is a portion of my code for the connection points, the 2 interfaces are ITCSUser and ITCSUserEvents.


HRESULT hres;
IConnectionPoint* m_pITCSUserCP;
DWORD m_UserEventsCookie;
IUnknown * pIUnknown = NULL;
hres = pITCSUser->QueryInterface(IID_IUnknown, (void**)&pIUnknown);
hres = GetConnectionPoint(__uuidof(ITCSUserEvents), pITCSUser,&m_pITCSUserCP);

if (SUCCEEDED(hres))
{
m_UserEventsCookie = 0;
hres = m_pITCSUserCP->Advise(pIUnknown, &m_UserEventsCookie );
}


// Finds a connection point (riid) from an interface.
HRESULT GetConnectionPoint(REFIID riid, IUnknown* pObj,
IConnectionPoint** pCP)
{
IConnectionPointContainer* pCPC = NULL;
HRESULT hRes = pObj->QueryInterface(IID_IConnectionPointContainer,
(void**)&pCPC);
if (SUCCEEDED(hRes))
{
hRes = pCPC->FindConnectionPoint(riid, pCP);
}
pCPC->Release();
return hRes;
}


STDMETHOD(QueryInterface)(REFIID iid, LPVOID* ppv)
{
if ( iid == __uuidof(ITCSUserEvents) )
{
*ppv = static_cast<itcsuserevents*>(this);
}
else if ( iid == __uuidof(ITCSDataEvents) )
{
*ppv = static_cast<itcsdataevents*>(this);
}
else if ( iid == __uuidof(ITCSRadioSubscriberManagerEvents) )
{
*ppv = static_cast<itcsradiosubscribermanagerevents*>(this);
}
else if ( iid == __uuidof(ITCSGroupManagerEvents) )
{
*ppv = static_cast<itcsgroupmanagerevents*>(this);
}
else if ( iid == __uuidof(ITCSSystemManagerEvents) )
{
*ppv = static_cast<itcssystemmanagerevents*>(this);
}
else if ( iid == __uuidof(IUnknown) )
{
*ppv = static_cast<itcsuserevents*>(this);
}
else
{
*ppv = 0;
return E_NOINTERFACE;
}
return S_OK;
}


Thanx in advance !!
AnswerRe: DCOM Connection Points Pin
QuickDeveloper30-Jul-07 18:43
QuickDeveloper30-Jul-07 18:43 
QuestionRuntime error when calling COM object Pin
MAW3025-Jul-07 14:49
MAW3025-Jul-07 14:49 
AnswerRe: Runtime error when calling COM object Pin
User 21559725-Jul-07 20:44
User 21559725-Jul-07 20:44 
GeneralRe: Runtime error when calling COM object Pin
MAW3026-Jul-07 9:58
MAW3026-Jul-07 9:58 
GeneralRe: Runtime error when calling COM object Pin
sunil20046-Aug-07 21:04
sunil20046-Aug-07 21:04 
QuestionAbout COM Pin
Nandu_77b24-Jul-07 23:25
Nandu_77b24-Jul-07 23:25 
AnswerRe: About COM Pin
User 21559725-Jul-07 0:29
User 21559725-Jul-07 0:29 
AnswerRe: About COM Pin
Jonathan [Darka]25-Jul-07 22:56
professionalJonathan [Darka]25-Jul-07 22:56 
JokeRe: About COM Pin
Heimmen6-Aug-07 3:06
Heimmen6-Aug-07 3:06 
Questionms office automation from NT service in 64 bit OS Pin
indra2024-Jul-07 21:22
indra2024-Jul-07 21:22 
AnswerRe: ms office automation from NT service in 64 bit OS Pin
Mike Dimmick25-Jul-07 1:01
Mike Dimmick25-Jul-07 1:01 
GeneralRe: ms office automation from NT service in 64 bit OS Pin
indra2025-Jul-07 1:34
indra2025-Jul-07 1:34 
QuestionPassing array with objects terminates VB6 application Pin
scheewie23-Jul-07 22:53
scheewie23-Jul-07 22:53 
QuestionError reading COM object Pin
MAW3023-Jul-07 17:50
MAW3023-Jul-07 17:50 
AnswerRe: Error reading COM object Pin
User 21559723-Jul-07 18:21
User 21559723-Jul-07 18:21 
GeneralRe: Error reading COM object [modified] Pin
MAW3023-Jul-07 20:07
MAW3023-Jul-07 20:07 
GeneralRe: Error reading COM object Pin
User 21559723-Jul-07 20:59
User 21559723-Jul-07 20:59 

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.