Click here to Skip to main content
15,922,315 members
Home / Discussions / COM
   

COM

 
AnswerRe: VARIANT_BOOL return value in Automation class Pin
Roger Stoltz10-Jan-07 2:42
Roger Stoltz10-Jan-07 2:42 
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 
Sohail Kadiwala wrote:
Roger Stoltz wrote:

Is it, really?



Sorry, I should say - "problem area detected"


Ok, but in my opinion you've only found where it goes wrong, not why. The root cause could still be somewhere else.


Sohail Kadiwala wrote:
the value of dwResult in memory changes from 00 00 00 00 to 00 00 14 00


Laugh | :laugh: Laugh | :laugh:
This is rather funny how we can misinterpret each other, because now I have to ask if this is big-endian or little-endian. If you've copied this directly from the memory debug window it would be little-endian and in that case the value would be 0x00140000 which is 1310720 in decimal. I assume this is the case since it would make more sense to me. My point is that the lower 16 bits that may represent the VARIANT_BOOL type is still equal to VARIANT_FALSE.

Never mind, try this instead:
I've created a simple ActiveX control and a client with two methods returning VARIANT_TRUE and VARIANT_FALSE respectively as I've described it in the interface file (.idl).
It worked like expected until I explicitly changed the return types in my server from BOOL to VARIANT_BOOL. Then I got exactly the behaviour as you have. I don't even have to get marshalling involved: everything is still in the same apartment.
Try and change your return type back to BOOL in your .cpp and .h files, not in the .idl file. Rebuild and see what happens.
I haven't dug into exactly why I get this behaviour, but I suspect there's a mixup (or mismatch rather) between pointers to 16-bit types and 32-bit types as I've mentioned earlier.

Let me know what the results are.

--
Rog


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

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 
QuestionCOM on Linux? Pin
Josh Smith8-Jan-07 10:27
Josh Smith8-Jan-07 10:27 
AnswerRe: COM on Linux? Pin
Christian Graus8-Jan-07 11:22
protectorChristian Graus8-Jan-07 11:22 
GeneralRe: COM on Linux? Pin
Josh Smith8-Jan-07 11:59
Josh Smith8-Jan-07 11:59 
GeneralRe: COM on Linux? Pin
Jörgen Sigvardsson8-Jan-07 13:18
Jörgen Sigvardsson8-Jan-07 13:18 
GeneralRe: COM on Linux? Pin
Josh Smith9-Jan-07 3:48
Josh Smith9-Jan-07 3:48 
GeneralRe: COM on Linux? Pin
Jörgen Sigvardsson9-Jan-07 4:27
Jörgen Sigvardsson9-Jan-07 4:27 
GeneralRe: COM on Linux? Pin
Josh Smith9-Jan-07 7:45
Josh Smith9-Jan-07 7:45 

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.