Solved

CInternetSession and Unicode

Posted on 1998-04-07
2
478 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 100 total points
Comment Utility
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
Comment Utility
Thanks Mike, for clarifying those things. I hope that Unicode support will be added in the near future.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now