Solved

CInternetSession and Unicode

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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…
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

724 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