Click here to Skip to main content
15,913,159 members
Home / Discussions / COM
   

COM

 
Generalactivex control problem Pin
emmatty30-Jan-04 19:08
emmatty30-Jan-04 19:08 
GeneralRe: activex control problem Pin
AssemblySoft31-Jan-04 12:31
AssemblySoft31-Jan-04 12:31 
GeneralRe: activex control problem Pin
Jörgen Sigvardsson31-Jan-04 12:41
Jörgen Sigvardsson31-Jan-04 12:41 
QuestionPassing complex type through COM interface ? Pin
Alwin7530-Jan-04 12:50
Alwin7530-Jan-04 12:50 
AnswerRe: Passing complex type through COM interface ? Pin
Jörgen Sigvardsson30-Jan-04 13:00
Jörgen Sigvardsson30-Jan-04 13:00 
GeneralCOM+ Catalog Infomation Pin
kimsangwoo30-Jan-04 12:28
kimsangwoo30-Jan-04 12:28 
GeneralProblem with MIDL and Flash IDL Pin
gialli29-Jan-04 22:16
gialli29-Jan-04 22:16 
GeneralPassing variants in Fire_xxx methods Pin
Aby Philip28-Jan-04 4:38
Aby Philip28-Jan-04 4:38 
Hi,

I am working on this ATL dll, which has one object that implements
connection points. I added some methods in the event interface that take
VARIANT as parameters, so that I may receive the variants in events when I
use the same from VB.

In IDL file it is like

////////////////////////////////////////////////////

[id(3), helpstring("method SampleRecordPkt")] HRESULT SampleRecordPkt([in]
VARIANT vBytes);

////////////////////////////////////////////////////

Now, I am trying to fire this from my code as follows - (All the hard coded
stuff I did for debug only.)

////////////////////////////////////////////////////

BYTE bytes[] = {5, 123, 9, 0, 5, 0, 0, 191, 157};

COleSafeArray saBytes1;

saBytes1.CreateOneDim(VT_UI1,sizeof(bytes));

for(long i = 0; i < sizeof(bytes);i++)

{

BYTE val = bytes[i];

saBytes1.PutElement(&i,&val);

}


file://fire off the appropriate event

VARIANT var = saBytes1.Detach();

Fire_SampleRecordPkt(var);

/////////////////////////////////////////////////////

However, inside "Fire_SampleRecordPkt(var)", the application crashes. The
crash occurs at the line given below (wizard generated code, when "implement
connection point" is chosen.)

////////////////////////////////////////////////////

DISPPARAMS disp = { pvars, NULL, 1, 0 };

pDispatch->Invoke(0x3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD,
&disp, &varResult, NULL, NULL);

////////////////////////////////////////////////////

Can some body help me identify where I am wrong? Any help is appreciated.

Thank you

aby
GeneralRe: Passing variants in Fire_xxx methods Pin
Lim Bio Liong29-Jan-04 4:24
Lim Bio Liong29-Jan-04 4:24 
GeneralCOM and _bstr_t Pin
Tzoockee27-Jan-04 1:05
Tzoockee27-Jan-04 1:05 
GeneralRe: COM and _bstr_t Pin
Steve S27-Jan-04 1:53
Steve S27-Jan-04 1:53 
GeneralDCOM: running COM-server on another PC Pin
Bash27-Jan-04 0:15
Bash27-Jan-04 0:15 
GeneralRe: DCOM: running COM-server on another PC Pin
Anonymous27-Jan-04 3:23
Anonymous27-Jan-04 3:23 
GeneralProblem with compiling samples of Iniside OLE Pin
Omar Alvi26-Jan-04 22:13
Omar Alvi26-Jan-04 22:13 
GeneralCOM: precompiled header in *_i.c files Pin
Bash26-Jan-04 7:55
Bash26-Jan-04 7:55 
GeneralRe: COM: precompiled header in *_i.c files Pin
Steve S26-Jan-04 22:27
Steve S26-Jan-04 22:27 
GeneralExtracting the Contents of IStorage Pin
Steve Thresher26-Jan-04 3:58
Steve Thresher26-Jan-04 3:58 
GeneralRe: Extracting the Contents of IStorage Pin
Anonymous30-Jan-04 10:34
Anonymous30-Jan-04 10:34 
GeneralCOM question Pin
Tzoockee26-Jan-04 2:29
Tzoockee26-Jan-04 2:29 
GeneralRe: COM question Pin
Steve S26-Jan-04 2:49
Steve S26-Jan-04 2:49 
GeneralRe: COM question Pin
Tzoockee26-Jan-04 3:11
Tzoockee26-Jan-04 3:11 
GeneralRe: COM question Pin
Steve S26-Jan-04 5:26
Steve S26-Jan-04 5:26 
QuestionHow to USE C++ code in VB ?? Pin
ponka12825-Jan-04 9:27
ponka12825-Jan-04 9:27 
AnswerRe: How to USE C++ code in VB ?? Pin
Jörgen Sigvardsson25-Jan-04 10:09
Jörgen Sigvardsson25-Jan-04 10:09 
GeneralRe: How to USE C++ code in VB ?? Pin
Lim Bio Liong25-Jan-04 14:57
Lim Bio Liong25-Jan-04 14:57 

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.