URLDownloadToFile  
Author Message
wildlywicked





PostPosted: Thu Jan 05 21:31:41 CST 2006 Top

Visual Studio C++ >> URLDownloadToFile

hi there

With VS2005. Im using the function URLDownloadToFile
and by default its obviously picking up the
URLDownloadToFileW version with LPCWSTR ..

IS there a directive i can modify to use the old AINSI ?

if not, how can i pass my BSTR as LPCWSTR ?

thanks

Visual Studio113  
 
 
Igor





PostPosted: Thu Jan 05 21:31:41 CST 2006 Top

Visual Studio C++ >> URLDownloadToFile

> With VS2005. Im using the function URLDownloadToFile
> and by default its obviously picking up the
> URLDownloadToFileW version with LPCWSTR ..
>
> IS there a directive i can modify to use the old AINSI ?

If you want your whole project to compile as ANSI, that would be Project
| Properties | General | Character Set = Use Multi-Byte Character Set

> if not, how can i pass my BSTR as LPCWSTR ?

BSTR is compatible with LPCWSTR, you can just pass it as is. Now if you
change your project to ANSI, you would need a conversion - BSTRs are
Unicode.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


 
 
ama





PostPosted: Fri Jan 06 18:36:33 CST 2006 Top

Visual Studio C++ >> URLDownloadToFile
>"Igor Tandetnik" wrote
> If you want your whole project to compile as ANSI, that would be Project |
> Properties | General | Character Set = Use Multi-Byte Character Set
>

thanks a lot.

before i checked here for a reply, i went and found the
charset setting and chose "Not Set" and it works..

But is Not Set going to create problems ?

thanks again Igor.



 
 
Igor





PostPosted: Fri Jan 06 20:17:16 CST 2006 Top

Visual Studio C++ >> URLDownloadToFile

>> "Igor Tandetnik" wrote
>> If you want your whole project to compile as ANSI, that would be
>> Project | Properties | General | Character Set = Use Multi-Byte
>> Character Set
>
> before i checked here for a reply, i went and found the
> charset setting and chose "Not Set" and it works..
>
> But is Not Set going to create problems ?

Not for calling Win32 API, but some CRT functions may behave incorrectly
when working with double-byte encodings (e.g. Chinese, Japanese or
Korean). Then again, it's very difficult to get CJK right without
Unicode, with or without multibyte support.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925