Solved

CInternetSession and Unicode

Posted on 1998-04-07
2
482 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
not able to insert into temp table 68 157
post4 challenge 28 93
FizzBuzz challenge 9 77
Use of condition with 'serial' in ansible 2 50
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

861 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

21 Experts available now in Live!

Get 1:1 Help Now