15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


UNICODE and CString on Win95

R Venkatesan -- venkatr@indus.hclt.com
Saturday, October 12, 1996



Environment: Visual C++ 4.0, Win95

 My App generatres a binary file which should be used by the 95 and NT
 version of the app. So I decided to write UNICODE strings into the file.
 using the UNICODE version of CString in my MFC Windows app.

 I works fine in NT, but in 95, it says MFC40UD.DLL missing. After copying
 the DLL in to my Windows directory, this guy say "Cannot Load this DLL on
 Win95 as it uses WInNT features".

 Does this mean I can use the UNICODE version of CString in my Win95 app?
 Is their any other work around other than using the Win32 API's supported
 by Win95?

 Any help will be highly appreciated.
 Thanks in advance.

-- 
 Have a Good Day
 R.Venkatesan 
 venkatr@hclt.com
 HCL Technologies Ltd.




Joseph Jones -- jjones@FrontofficeTech.com
Monday, October 14, 1996

[Mini-digest: 3 responses]

Try this:

	add #include  to your stdafx.h header file

	Load the strings from the binary file into a wchar array.

	Use code similar to the following to get and save the strings:

		//This will put a UNICODE string into a CString:
		USES_CONVERSION; //VERY important for the comversion routines in
afxconv
		CString myString = OLE2T(UnicodeStringFromFile);

		//This will perform the opposite mapping
		wchar* UnicodeStringToFile = T2OLE(myString);

	Hope this helps!

	joe


>-----Original Message-----
>From:	R Venkatesan [SMTP:venkatr@indus.hclt.com]
>Sent:	Saturday, October 12, 1996 3:28 PM
>To:	mfc-l@netcom.com
>Cc:	venkatr@indus.hclt.com
>Subject:	UNICODE and CString on Win95
>
>
>
>Environment: Visual C++ 4.0, Win95
>
> My App generatres a binary file which should be used by the 95 and NT
> version of the app. So I decided to write UNICODE strings into the
>file.
> using the UNICODE version of CString in my MFC Windows app.
>
> I works fine in NT, but in 95, it says MFC40UD.DLL missing. After
>copying
> the DLL in to my Windows directory, this guy say "Cannot Load this DLL
>on
> Win95 as it uses WInNT features".
>
> Does this mean I can use the UNICODE version of CString in my Win95
>app?
> Is their any other work around other than using the Win32 API's
>supported
> by Win95?
>
> Any help will be highly appreciated.
> Thanks in advance.
>
>-- 
> Have a Good Day
> R.Venkatesan 
> venkatr@hclt.com
> HCL Technologies Ltd.
>
-----From: Ian Brown 



     Hi.
     
     I may not be textbook perfect in my answer below, but it should be 
     enough to help...
     
     Windows NT has been built upon Unicode technology from the ground up, 
     and uses it throughout. Obviously NT supports non-Unicode operations 
     to allow legacy code to run unchanged.
     
     Windows 95 does not use Unicode internally, but it is supported in 
     places (e.g. the OLE subsystem). This is due to its DOS ancestry, and 
     to help maintain the high-level of backwards compatibility to DOS and 
     16-bit Windows apps.
     
     Basically NT can work with ANSI (non-Unicode) characters seamlessly, 
     but getting 95 to run 'Unicode' apps is going to be a non-starter. 
     Unfortunately you took the wrong decision at the outset of your 
     project.
     
     The Win32 API provides functionality to convert ANSI to Unicode and 
     back, and the Visual C++/MFC header files provide plenty of help in 
     the way of macros, character-set independent runtime library functions 
     etc.
     
     Hopefully you have used these character-set independent facilities and 
     library functions within your code, and you are now left with just 
     having to remove the UNICODE define from your compiler options.
     
     Take a wander around Books On-Line on some of the following subjects 
     to get an overview for the support available...
     
        WideCharToMultiByte (conversion for Unicode/ANSI)
        _tcslen (example of a character-set independent library call)
        Unicode (loads of information)
     
     Hope this helps.
     
     Ian


-----From: Mario Contestabile

> I works fine in NT, but in 95, it says MFC40UD.DLL missing. After copying
> the DLL in to my Windows directory, this guy say "Cannot Load this DLL on
> Win95 as it uses WInNT features".

Ouch. Get that DLL out of there. Win95 doesn't support UNICODE.
Do not #define _UNICODE for 95 builds, only for NT.

mcontest@universal.com





| Вернуться в корень Архива |