forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

UNICODE

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
MERO



Joined: 25 Apr 2006
Posts: 41
Location: Wuerzburg, Germany

PostPosted: Fri Mar 16, 2007 2:49 pm    Post subject: UNICODE Reply with quote

I need to convert a Unicode string (BSTR) to a Fortran string and back again.
The BSTR comes from COM Interface written in C++.
Question: how can I do that ?
Klaus
Back to top
View user's profile Send private message Visit poster's website
qt



Joined: 23 Aug 2005
Posts: 46
Location: Berlin, Germany

PostPosted: Sat Mar 17, 2007 5:03 pm    Post subject: Re: UNICODE Reply with quote

MERO wrote:
I need to convert a Unicode string (BSTR) to a Fortran string and back again.
The BSTR comes from COM Interface written in C++.
Question: how can I do that ?
Klaus


There are some WinAPI functions which might help. For example:

DWORD UnicodeToBytes(
LPWSTR lpWideCharStr,
UINT cchWideChar,
LPSTR lpMultiByteStr,
UINT cchMultiByte
);

of

int WideCharToMultiByte(
UINT CodePage, // code page
DWORD dwFlags, // performance and mapping flags
LPCWSTR lpWideCharStr, // wide-character string
int cchWideChar, // number of chars in string.
LPSTR lpMultiByteStr, // buffer for new string
int cbMultiByte, // size of buffer
LPCSTR lpDefaultChar, // default for unmappable chars
LPBOOL lpUsedDefaultChar // set when default char used
);


Kind regards

Joerg Kuthe
QT software GmbH
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group