Solved

CInternetSession and Unicode

Posted on 1998-04-07
2
490 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 100 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

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 121
Looking for a specific application/software 2 124
mapBully challenge 6 196
Way to decrease size of apk file 9 131
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.

737 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