Click here to Skip to main content
15,916,180 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Database connection using OLE DB Pin
FreeEagle14-Nov-07 9:15
FreeEagle14-Nov-07 9:15 
GeneralRe: Database connection using OLE DB Pin
led mike14-Nov-07 10:54
led mike14-Nov-07 10:54 
QuestionA problem Pin
minihotto7-Nov-07 2:22
minihotto7-Nov-07 2:22 
AnswerRe: A problem Pin
led mike7-Nov-07 4:40
led mike7-Nov-07 4:40 
AnswerRe: A problem [modified] Pin
George L. Jackson7-Nov-07 13:40
George L. Jackson7-Nov-07 13:40 
QuestionCOM event sink Pin
eero_p5-Nov-07 23:44
eero_p5-Nov-07 23:44 
AnswerRe: COM event sink Pin
led mike6-Nov-07 4:15
led mike6-Nov-07 4:15 
GeneralRe: COM event sink Pin
eero_p7-Nov-07 3:56
eero_p7-Nov-07 3:56 
No errors, just don't know how can I make the sink object 'see' the main form or its controls.

Here's the sink that is created in:


public __gc class Form1 : public System::Windows::Forms::Form -style form.

Connecting to COM and reveiving an event is no problem, but how do I pass the parameter received in 'OnEvent' into a control on the form?


#ifndef __SINKBASE
#define __SINKBASE

#include <atlbase.h>
#include <atlhost.h>

#import "xxx.dll" named_guids raw_interfaces_only
#include "xxx.h"

template <UINT nID, class T, const IID* pdiid>
class SinkBase : public IDispEventSimpleImpl<nID, T, pdiid>
{
public:
SinkBase()
{
}

// fill in the _ATL_FUNC_INFO structured depending on DISPID
virtual HRESULT GetFuncInfoFromId(const IID& iid, DISPID dispidMember, LCID lcid, _ATL_FUNC_INFO& info)=0;
};

class MySink : public SinkBase<0, MySink, &DIID__IxxxEvents>
{
public:
MySink()
{

}

BEGIN_SINK_MAP(MySink)
SINK_ENTRY_EX(0, DIID__IxxxEvents, 1, OnEvent)
END_SINK_MAP()

HRESULT GetFuncInfoFromId(const IID& iid, DISPID dispidMember, LCID lcid, _ATL_FUNC_INFO& info)
{
if (InlineIsEqualGUID(iid, DIID__IxxxEvents))
{
info.cc = CC_STDCALL;

switch(dispidMember)
{
case 1:
info.vtReturn = VT_I4;
info.nParams = 1;
info.pVarTypes[0] = VT_BSTR;
return S_OK;

default:
return E_FAIL;

}
}
return E_FAIL;
}

HRESULT __stdcall OnEvent(BSTR eventString)
{
return S_OK;
}
};

GeneralRe: COM event sink Pin
led mike7-Nov-07 4:34
led mike7-Nov-07 4:34 
GeneralRe: COM event sink Pin
eero_p7-Nov-07 20:55
eero_p7-Nov-07 20:55 
QuestionMixed types problem Pin
minihotto5-Nov-07 22:49
minihotto5-Nov-07 22:49 
AnswerRe: Mixed types problem Pin
led mike6-Nov-07 4:13
led mike6-Nov-07 4:13 
GeneralRe: Mixed types problem Pin
minihotto7-Nov-07 2:41
minihotto7-Nov-07 2:41 
QuestionConversion From Int to Hwnd Pin
narayanagvs5-Nov-07 18:44
narayanagvs5-Nov-07 18:44 
AnswerRe: Conversion From Int to Hwnd Pin
led mike6-Nov-07 4:18
led mike6-Nov-07 4:18 
QuestionWarning C4945 Pin
Xpnctoc5-Nov-07 5:09
Xpnctoc5-Nov-07 5:09 
AnswerRe: Warning C4945 Pin
Mark Salsbery5-Nov-07 6:13
Mark Salsbery5-Nov-07 6:13 
GeneralRe: Warning C4945 Pin
Xpnctoc5-Nov-07 7:32
Xpnctoc5-Nov-07 7:32 
GeneralRe: Warning C4945 Pin
Mark Salsbery5-Nov-07 8:44
Mark Salsbery5-Nov-07 8:44 
GeneralRe: Warning C4945 Pin
savibosch4-Feb-10 22:31
savibosch4-Feb-10 22:31 
QuestionHow to track Mouse Movement in a Property Page Dialog Pin
Larry Mills Sr4-Nov-07 9:29
Larry Mills Sr4-Nov-07 9:29 
Answereditbox --&gt; MFC --&gt; wrong forum Pin
Luc Pattyn4-Nov-07 9:44
sitebuilderLuc Pattyn4-Nov-07 9:44 
QuestionFunction return string pointer Pin
karthickbabu_india2-Nov-07 18:06
karthickbabu_india2-Nov-07 18:06 
AnswerRe: Function return string pointer Pin
Mark Salsbery2-Nov-07 18:18
Mark Salsbery2-Nov-07 18:18 
AnswerRe: Function return string pointer Pin
Christian Graus2-Nov-07 19:19
protectorChristian Graus2-Nov-07 19:19 

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.