Jan, > You got a VT_BSTR VARIANT alright, but to translate it to a char*, you > need to convert wide characters to multibyte characters, which > VariantChangeType() won't do for you. Alternatively you can > use the wide > character API to write the string directly, using the BSTR value as a > wchar_t pointer. Thanks for clearing things up You've pinpointed the root of my problem. Right before I read your message, I had just finished looking up the documentation on msdn (the book I'm using doesn't fully document it) for VariantChangeType() and discovered that the error message I was getting (Type mismatch) is because of what you describe (no conversion from BSTR to char* via VariantChangeType). > The "automatic" translations between Perl values and VARIANTs is > documented in the Win32::OLE::Variant module documentation. I will definitely read through that. I think that's what I was trying to ask for in the first place, I just didn't know how to phrase it (thanks for reading my mind :-) > You may want to look a little into the Win32::OLE sources to > pick up some > techniques. But be warned: the soure code is big! I won't be ready to take that step for at least another two weeks! ;-) Thanks, Ed --- You are currently subscribed to perl-win32-users as: [archive@jab.org] To unsubscribe, forward this message to [EMAIL PROTECTED] For non-automated Mailing List support, send email to [EMAIL PROTECTED]
RE: perl passing variables to ole automation objects
MacDonald, Ed, CON, OASD(HA)/TMA Wed, 17 May 2000 13:28:49 -0700
- perl passing variables to ole automation ... MacDonald, Ed, CON, OASD(HA)/TMA
- RE: perl passing variables to ole au... Chris
- Re: perl passing variables to ole au... Jan Dubois
- RE: perl passing variables to ole au... MacDonald, Ed, CON, OASD(HA)/TMA
- RE: perl passing variables to ole au... MacDonald, Ed, CON, OASD(HA)/TMA
- re: perl passing variables to ole au... MacDonald, Ed, CON, OASD(HA)/TMA
- re: perl passing variables to ole au... Rudi Farkas
- Re: perl passing variables to ol... Jan Dubois