Click here to Skip to main content
15,925,661 members
Home / Discussions / COM
   

COM

 
AnswerRe: Difference between COM and ATLCOM Pin
Roger Stoltz4-May-06 12:08
Roger Stoltz4-May-06 12:08 
GeneralRe: Difference between COM and ATLCOM Pin
Laxman Auti5-May-06 3:53
Laxman Auti5-May-06 3:53 
QuestionGetting a link time error Pin
leanmean4-May-06 0:49
leanmean4-May-06 0:49 
AnswerRe: Getting a link time error Pin
guestcat4-May-06 1:22
guestcat4-May-06 1:22 
AnswerRe: Getting a link time error Pin
Roger Stoltz4-May-06 11:38
Roger Stoltz4-May-06 11:38 
QuestionError : 0x8007000e - Not enough storage is available to complete this operation. Pin
guestcat3-May-06 23:51
guestcat3-May-06 23:51 
AnswerRe: Error : 0x8007000e - Not enough storage is available to complete this operation. Pin
guestcat6-May-06 1:41
guestcat6-May-06 1:41 
QuestionAttach Method with SmartPointers causes problems marshaling UDTs? Pin
morenz3-May-06 23:26
morenz3-May-06 23:26 
Hi everybody, last (I hope) problem.

After I released a beta of my preoject, 4 months ago, the customer asked me to change my COM-calling style.

I used Smart Pointers with CreateInstance, and server registration on both sides. The customer does not want the server to be registered on client machine, so I was suggested to still use Smart Pointers, but now with CoCreateInstanceEx and Attach.

Briefly, it was:

<br />
ISwitchBoardPtr pISB;<br />
...<br />
pISB.CreateInstance(__uuidof(SwitchBoard));<br />
<br />
...<br />
...my code...<br />
...<br />
pISB.Release


now, it seems it has to be:

ISwitchBoardPtr pISB;<br />
COSERVERINFO csi = {0, L"10.0.1.9", NULL, 0};<br />
MULTI_QI qi = {&__uuidof(ISwitchBoard), NULL, S_OK};<br />
HRESULT hr = CoCreateInstanceEx(__uuidof(SwitchBoard), NULL, CLSCTX_REMOTE_SERVER, &csi, 1, &qi);<br />
//error checking omitted<br />
ISwitchBoard *_pISB = static_cast<ISwitchBoard *>(qi.pItf);<br />
pSB.Attach(_pISB);


In this object I expose several UDTs, even big and complex (imagine a structure that has as one of its fields a SafeArray containing another structure), and when I used the first method, everything worked fine and the customer was happy, but when I started to use the second method, NONE of my UDTs is marshaled anymore. I get crashes in client (while the server keeps running fine, logically) when I try to get as [out] or [out, retval] parameters one of my UDTs.

I'm stuck. The only thing I thought about is that qi.pItf is a IUnknown * type, while my objects expose IDispatch interfaces, but IDispatch is derived from IUnknown, as every interface in COM, so it should work, shouldn't it?

Thanks for your kind help again...Smile | :)
AnswerRe: Attach Method with SmartPointers causes problems marshaling UDTs? Pin
Milton Karimbekallil4-May-06 5:33
Milton Karimbekallil4-May-06 5:33 
AnswerRe: Attach Method with SmartPointers causes problems marshaling UDTs? Pin
Roger Stoltz4-May-06 11:30
Roger Stoltz4-May-06 11:30 
GeneralRe: Attach Method with SmartPointers causes problems marshaling UDTs? Pin
Milton Karimbekallil4-May-06 18:33
Milton Karimbekallil4-May-06 18:33 
GeneralRe: Attach Method with SmartPointers causes problems marshaling UDTs? Pin
morenz4-May-06 21:43
morenz4-May-06 21:43 
AnswerRe: Attach Method with SmartPointers causes problems marshaling UDTs? Pin
Roger Stoltz4-May-06 22:42
Roger Stoltz4-May-06 22:42 
GeneralRe: Attach Method with SmartPointers causes problems marshaling UDTs? Pin
morenz4-May-06 23:39
morenz4-May-06 23:39 
AnswerRe: Attach Method with SmartPointers causes problems marshaling UDTs? Pin
Roger Stoltz5-May-06 1:26
Roger Stoltz5-May-06 1:26 
GeneralRe: Attach Method with SmartPointers causes problems marshaling UDTs? Pin
morenz5-May-06 3:34
morenz5-May-06 3:34 
GeneralRe: Attach Method with SmartPointers causes problems marshaling UDTs? Pin
Roger Stoltz5-May-06 4:24
Roger Stoltz5-May-06 4:24 
GeneralRe: Attach Method with SmartPointers causes problems marshaling UDTs? Pin
morenz5-May-06 4:30
morenz5-May-06 4:30 
QuestionLookup installed com components Pin
Hampus@foi3-May-06 21:57
Hampus@foi3-May-06 21:57 
AnswerRe: Lookup installed com components Pin
Stephen Hewitt3-May-06 22:06
Stephen Hewitt3-May-06 22:06 
AnswerRe: Lookup installed com components Pin
Laxman Auti4-May-06 3:40
Laxman Auti4-May-06 3:40 
QuestionActiveX control and COM dll Pin
csylesh3-May-06 2:23
csylesh3-May-06 2:23 
AnswerRe: ActiveX control and COM dll Pin
Milton Karimbekallil4-May-06 5:33
Milton Karimbekallil4-May-06 5:33 
QuestionTypes of DLL Pin
Smith#2-May-06 23:40
Smith#2-May-06 23:40 
AnswerRe: Types of DLL Pin
_AnsHUMAN_ 3-May-06 3:34
_AnsHUMAN_ 3-May-06 3:34 

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.