Click here to Skip to main content
16,009,255 members
Home / Discussions / COM
   

COM

 
AnswerRe: COM/ACTIVE X/OLE Pin
CPallini10-Jan-07 20:20
mveCPallini10-Jan-07 20:20 
AnswerRe: COM/ACTIVE X/OLE Pin
User 21559711-Jan-07 0:08
User 21559711-Jan-07 0:08 
QuestionVARIANT_BOOL return value in Automation class Pin
User 2155979-Jan-07 5:07
User 2155979-Jan-07 5:07 
AnswerRe: VARIANT_BOOL return value in Automation class Pin
Roger Stoltz9-Jan-07 5:45
Roger Stoltz9-Jan-07 5:45 
QuestionRe: VARIANT_BOOL return value in Automation class [modified] Pin
User 2155979-Jan-07 5:52
User 2155979-Jan-07 5:52 
AnswerRe: VARIANT_BOOL return value in Automation class Pin
Roger Stoltz9-Jan-07 21:18
Roger Stoltz9-Jan-07 21:18 
QuestionRe: VARIANT_BOOL return value in Automation class Pin
User 21559710-Jan-07 0:26
User 21559710-Jan-07 0:26 
AnswerRe: VARIANT_BOOL return value in Automation class Pin
Roger Stoltz10-Jan-07 2:42
Roger Stoltz10-Jan-07 2:42 
Regarding your declarations, I cannot find anything wrong: it looks as expected.
N.B. I'm not quite convinced yet. I think the problem described in the forum discussion you found could be a consequence of this mixup. The reason why I'm not sure is because it's an .odl file and you want to be compatible with MKTypLib and I'm not 100% on top of what happens then.

So, the server is an out-of-process server.
This means that every call has to be marshalled.


Sohail Kadiwala wrote:
The coclass has no threads. The Exe server is multithreaded but the coclass Start method simply delegates the call there.


I don't exactly know what you mean by these statements, but I guess you mean that you do not initialize more than one apartment in the server and that is in the application thread of the server. I hope this also means that you do not call any interface functions from anywhere else than from that thread, even if you're talking about an event sink.
Tell me if this is not the case.


Sohail Kadiwala wrote:
Regarding marshalling, I believe standard marshalling should take care of this because i am using the OleAutomation compatible type.


Well, if you haven't built and registered anything else explicitly, the universal marshaller will be used for automation interfaces. This is also known as type library marshalling. Standard marshalling requires you to build a second DLL with the proxy/stub.
I assume you're using typelib marshalling, which is exactly why I was talking about a mixup between boolean types since the generated typelib will be used for marshalling. I think you can figure out the rest if I present the problem as "you may declare a return type as 16-bit wide in your code but 32-bit wide in the typelib".


Sohail Kadiwala wrote:
Everything works fine for Start method and I succesfully get the "BSTR" from my clients hence I see no issue about marshalling.


This is not proof of anything other than the call to Start seems to work. The call to IsWorking may still be erroneous even though it looks OK as mentioned above.

I would like to follow up on the forum discussion you found. I think there might be something there to try out.
If you change the type back to VARIANT_BOOL and put a breakpoint after the call is made in oledisp2.cpp, line #373. Try forcing the server to return VARIANT_FALSE and VARIANT_TRUE every second time you call it. Take a look at the lower 16 bits of the return value. It should change between 0x0000 and 0xffff. The upper 16 bits could contain garbage which would make the return value evaluate to true even if VARIANT_FALSE is returned.
What happens? What type is returned (VT_BOOL) and what is the value of it?
Let's first find out what is returned and how it's wrong and then we can try and find the correct solution for it.

--
Rog


"It's supposed to be hard, otherwise anybody could do it!" - selfquote

"No one remembers a coward!" - Jan Elfström 1998
"...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

GeneralRe: VARIANT_BOOL return value in Automation class Pin
User 21559711-Jan-07 0:03
User 21559711-Jan-07 0:03 
GeneralRe: VARIANT_BOOL return value in Automation class Pin
Roger Stoltz11-Jan-07 0:46
Roger Stoltz11-Jan-07 0:46 
GeneralRe: VARIANT_BOOL return value in Automation class [modified] Pin
User 21559711-Jan-07 5:03
User 21559711-Jan-07 5:03 
AnswerRe: [SOLVED] VARIANT_BOOL return value in Automation class Pin
User 21559711-Jan-07 6:07
User 21559711-Jan-07 6:07 
GeneralRe: [SOLVED] VARIANT_BOOL return value in Automation class Pin
Roger Stoltz11-Jan-07 22:45
Roger Stoltz11-Jan-07 22:45 
GeneralRe: [SOLVED] VARIANT_BOOL return value in Automation class Pin
User 21559712-Jan-07 0:50
User 21559712-Jan-07 0:50 
GeneralRe: [SOLVED] VARIANT_BOOL return value in Automation class Pin
Roger Stoltz12-Jan-07 1:50
Roger Stoltz12-Jan-07 1:50 
GeneralRe: [SOLVED] VARIANT_BOOL return value in Automation class Pin
User 21559712-Jan-07 4:11
User 21559712-Jan-07 4:11 
GeneralRe: [SOLVED] VARIANT_BOOL return value in Automation class Pin
Roger Stoltz12-Jan-07 4:40
Roger Stoltz12-Jan-07 4:40 
GeneralRe: [SOLVED] VARIANT_BOOL return value in Automation class Pin
User 21559712-Jan-07 5:24
User 21559712-Jan-07 5:24 
GeneralRe: [SOLVED] VARIANT_BOOL return value in Automation class Pin
Roger Stoltz12-Jan-07 5:37
Roger Stoltz12-Jan-07 5:37 
GeneralRe: [SOLVED] VARIANT_BOOL return value in Automation class Pin
User 21559714-Jan-07 7:50
User 21559714-Jan-07 7:50 
QuestionCOM and windows service application ... Pin
Sakthiu9-Jan-07 0:31
Sakthiu9-Jan-07 0:31 
QuestionHow can get information from web page ? Pin
ankprasanna9-Jan-07 0:22
ankprasanna9-Jan-07 0:22 
QuestionCOM dll internals. Pin
HakunaMatada8-Jan-07 19:21
HakunaMatada8-Jan-07 19:21 
AnswerRe: COM dll internals. Pin
Phil Harding15-Jan-07 3:45
Phil Harding15-Jan-07 3:45 
QuestionSystem monitor using WMI Pin
abhiramsss8-Jan-07 12:26
abhiramsss8-Jan-07 12:26 

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.