From: Jamal Mazrui Date: 2006-05-02T01:23:55+09:00 Subject: Re: BSTR data type An example of a DLL that uses the BSTR data type is the free spell checker, PwrSpell, at http://www.zcureit.com/powerbasic/pwrspell.zip The library is compiled with PowerBasic, and the provided include file is also PB-oriented. Visual Basic or other languages that natively support BSTR strings could also readily use the library by tweaking the function signatures. If Ruby can also do so, that would be great. -----Original Message----- From: Berger, Daniel [mailto:Daniel.Berger@qwest.com] Sent: Monday, May 01, 2006 11:52 AM To: ruby-talk ML Subject: Re: BSTR data type > -----Original Message----- > From: Jamal Mazrui [mailto:Jamal.Mazrui@fcc.gov] > Sent: Monday, May 01, 2006 9:43 AM > To: ruby-talk ML > Subject: BSTR data type > > > I have some Windows DLLs that include functions where the > BSTR data type is used as a parameter and/or return value. > The Win32API library does not seem to support this data type > (at least directly). Does anyone have code to do so? How > about the variant data type? (I am not talking about COM > server libraries that could be called with Win32OLE.) BSTR is a wide string, so your declaration would be 'P' (or 'L' if you plan on passing addresses around). I've never dealt with BSTR directly, but it looks like you may have to manipulate your strings with MultiByteToWideChar() and WideCharToMultiByte() first, before passing them to whatever function you use that requires BSTR data types. If you can provide an example of something you're having trouble with we can probably help you better. Regards, Dan This communication is the property of Qwest and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.