Can not use MFC application with unicode on windows 98


I have made an MFC application (Visual Studio 2005) that uses unicode, but when I start it on windows 98 it does not work.
I have added unicows.lib at Linker/Additional dependencies,
also I am using MFC in a static library

What elese must I do, to have an MFC application that uses unicode running on windows 98?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

evilrixSenior Software Engineer (Avast)Commented:
I presume you've read the following articles since you are linking with unicows.lib but I'll paste it anyway just for reference. It might be worth reading through them just to be sure you've covered all the bases.

IF that doesn't help can you state exactly what behavior you are seeing? Doe it crash? Do you get any errors? If so what are they? Please provide as much info as possible.


Alex7777qqAuthor Commented:
May be I am wrongly adding the dlls (described in the text below, taken from the link in the evilrix experts comment) at Project/Properties/Linker/input/additional dependencies. Is that the correct place,as it is empty by default?
To take advantage of this scheme, you can use the following three-step plan:

Include the following in the link list:

/nod:kernel32.lib /nod:advapi32.lib /nod:user32.lib /nod:gdi32.lib
/nod:shell32.lib /nod:comdlg32.lib /nod:version.lib /nod:mpr.lib
/nod:rasapi32.lib /nod:winmm.lib /nod:winspool.lib /nod:vfw32.lib
/nod:secur32.lib /nod:oleacc.lib /nod:oledlg.lib /nod:sensapi.lib

Include unicows.lib.

Include all of the libraries that MSLU (and your application) might need:

kernel32.lib advapi32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib
version.lib mpr.lib rasapi32.lib winmm.lib winspool.lib vfw32.lib
secur32.lib oleacc.lib oledlg.lib sensapi.lib

Let's examine these steps and the reasons for them, one at a time.


evilrixSenior Software Engineer (Avast)Commented:
So, are you saying that after following the does it still doesn't work? Can you explain what actually does or doesn't happen please?
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Alex7777qqAuthor Commented:
When I start the application under windows 98 i get a dialog with a cross in a red circle with a text:
Runtime Error!
Program test.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the applications support team for more information.

OK button
When I click it I get:
This program has performed an illegal operation and will be shut down.

when I open details of the error, it starts with:
test.exe caused an exception 40000015H in module test.exe at 0167:00426f24.

evilrixSenior Software Engineer (Avast)Commented:
Hmmm. The application is termination because something within has thrown an exception and you've not caught it and handled it. This may or may not be related to the Unicode module. What makes you think it is the use of this module? Have you tried using the debugger to break at the point the exception is thrown? I'd suggest trying this to see where the exception propergates from.

Also, I'd suggest writing a very small and simple program that uses the Unicows library just to see if you can get it working in another project. Maybe just do something simple like display a message box using Unicode. The rational behind this suggestion is to try and remove as many unknowns from the equation as possible to try and prove of disprove you are using the library correctly.

You can also use the following tool to produce diagnostics about a crashing program that might prove helpful in solving this issue.

"Process Crashes: A process crash is usually indicative of an unhandled exception occurring in a process or code running in a process that actively terminates the process. To debug a process crash, start by creating a crash rule against the process(s) in question. Similar to previous debuggers, DebugDiag will attach to a specific process (s) and will monitor the process for multiple types of exceptions or any custom breakpoints that cause the process(s) to terminate unexpectedly. When the crash occurs, a full memory dump file will be created, in the directory specified when setting up the crash rule."

If you can generate a memory dump and post it here I can analyze it for you, which may help identify the issue.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Alex7777qqAuthor Commented:
i have found the poblem. When the MFC application is executed in windows 98, it demands unicows.dll file to be in the same directory as the exe file. Afer I copied it to the exe directory is started working.
I thought that I don't need to attach any dlls, but I was wrong.

Thank you for the assistance.
evilrixSenior Software Engineer (Avast)Commented:
Ah yes, the DLL needs to be available to the application. It shouldn't necessarily need to be in the same folder, just in the DLL search path.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.