[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

CInternetSession and Unicode

Posted on 1998-04-07
2
Medium Priority
?
502 Views
Last Modified: 2013-11-20
Environment: Windows NT 4.0 (Swedish) with servicepack 3, Visual C++ 5.0 with servicepack 3.

I have a MFC EXE application with a CDocument derived document class. In this class I have a CInternetSession member variable (private, default constructor used). In a Unicode (UNICODE and _UNICODE macros defined, Entry-point symbol wWinMainCRTStartup in Link Output defined) debug build the constructor for the variable fails, resulting in that the creation of the document fails, and the application exits.
It works with no problems whatsoever in a normal (non-unicode) build.
Is this a known problem? How can it be solved? I have searched the MSDN without any hit.
0
Comment
Question by:stefanr
2 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 200 total points
ID: 1317509
At this time, the WININET APIs, which CInternetSession (and all of its friends) use, do not support Unicode: they simply fail.

If you must use the WININET APIs in a Unicode MFC app, you must code to the APIs directly, and you must make sure you call the A-versions of the APIs explicitly. That means that you'll need to convert to and from ANSI and Unicode for any strings that are going back and forth between your app and the calls to the APIs.

That stinks, but that's the way it is.

.B ekiM


0
 
LVL 3

Author Comment

by:stefanr
ID: 1317510
Thanks Mike, for clarifying those things. I hope that Unicode support will be added in the near future.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question