Click here to Skip to main content
15,886,137 members
Home / Discussions / COM
   

COM

 
Questioncreating a web interface for windows media services, in server 2003 Pin
ramitha7772-Oct-09 17:20
ramitha7772-Oct-09 17:20 
QuestionCOM Tutorials Pin
msr_codeproject2-Oct-09 16:33
msr_codeproject2-Oct-09 16:33 
AnswerRe: COM Tutorials Pin
Richard MacCutchan2-Oct-09 22:43
mveRichard MacCutchan2-Oct-09 22:43 
AnswerRe: COM Tutorials Pin
cariolihome18-Oct-09 10:54
cariolihome18-Oct-09 10:54 
QuestionGet Events from an COM Server Pin
Juergen_802-Oct-09 4:16
Juergen_802-Oct-09 4:16 
AnswerRe: Get Events from an COM Server Pin
Stuart Dootson2-Oct-09 5:46
professionalStuart Dootson2-Oct-09 5:46 
GeneralRe: Get Events from an COM Server Pin
Juergen_804-Oct-09 22:55
Juergen_804-Oct-09 22:55 
GeneralRe: Get Events from an COM Server Pin
Stuart Dootson5-Oct-09 0:00
professionalStuart Dootson5-Oct-09 0:00 
OK - the Invoke method is called when an event is raised by the server. It will tell you which method it's calling using the dispidMember parameter. The parameters to the call will be in the structure pointed at by pdispparams. You can pass back a result in pvarResult.

So, you could implement your Invoke using a switch statement and parameter transformation like this:

STDMETHODIMP CSink::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
                           WORD wFlags, DISPPARAMS* pDispParams,
                           VARIANT* pVarResult, EXCEPINFO* pExcepInfo,
                           UINT* puArgErr)
{

   if ((riid != IID_NULL))
      return E_INVALIDARG;
   
   HRESULT hr = S_OK;  // Initialize
   
   switch (dispIdMember)
   {
      case 1: // OnConfigurationApply
         // Here we need to verify that the parameters passed are what we expect (a VARIANT_BOOL*)
         // then call the OnConfigurationApply with these passed parameters
         if (pDispParams->cArgs != 1) return E_INVALIDARG;
         if (V_VT(&pDispParams->rgvarg[0]) != VT_BOOL|VT_BYREF) return E_INVALIDARG;
         OnConfigurationApply(V_BOOLREF(&pDispParams->rgvarg[0]));
         break;
      case 2: // OnShowMessageDlg
         // Do as for OnConfigurationApply
         break;
   }
   
   return hr;
}


HTH!

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: Get Events from an COM Server Pin
Juergen_805-Oct-09 0:07
Juergen_805-Oct-09 0:07 
GeneralRe: Get Events from an COM Server Pin
Stuart Dootson5-Oct-09 0:15
professionalStuart Dootson5-Oct-09 0:15 
GeneralRe: Get Events from an COM Server Pin
Juergen_805-Oct-09 4:05
Juergen_805-Oct-09 4:05 
GeneralRe: Get Events from an COM Server Pin
Stuart Dootson5-Oct-09 4:19
professionalStuart Dootson5-Oct-09 4:19 
GeneralRe: Get Events from an COM Server Pin
Juergen_808-Oct-09 2:36
Juergen_808-Oct-09 2:36 
GeneralRe: Get Events from an COM Server Pin
Stuart Dootson8-Oct-09 7:44
professionalStuart Dootson8-Oct-09 7:44 
AnswerRe: Get Events from an COM Server Pin
Juergen_802-Nov-09 2:49
Juergen_802-Nov-09 2:49 
QuestionHow to update DOM in IE by using IHTMLDocument , and IHTMLElement Pin
am 20091-Oct-09 7:17
am 20091-Oct-09 7:17 
QuestionGetting Excel sheet names Pin
gtag1-Oct-09 1:01
gtag1-Oct-09 1:01 
AnswerRe: Getting Excel sheet names Pin
Stuart Dootson1-Oct-09 22:16
professionalStuart Dootson1-Oct-09 22:16 
GeneralRe: Getting Excel sheet names [modified] Pin
gtag2-Oct-09 6:17
gtag2-Oct-09 6:17 
GeneralRe: Getting Excel sheet names Pin
Stuart Dootson2-Oct-09 8:59
professionalStuart Dootson2-Oct-09 8:59 
GeneralRe: Getting Excel sheet names Pin
gtag2-Oct-09 23:53
gtag2-Oct-09 23:53 
GeneralRe: Getting Excel sheet names Pin
Stuart Dootson3-Oct-09 0:11
professionalStuart Dootson3-Oct-09 0:11 
GeneralRe: Getting Excel sheet names Pin
Richard MacCutchan3-Oct-09 0:39
mveRichard MacCutchan3-Oct-09 0:39 
GeneralRe: Getting Excel sheet names Pin
gtag3-Oct-09 0:43
gtag3-Oct-09 0:43 
GeneralRe: Getting Excel sheet names Pin
gtag12-Nov-09 18:31
gtag12-Nov-09 18:31 

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.