Solved

Porting from MSVC 1.52 (16 bit) to MSVC 5.0 (32 bit)

Posted on 1997-06-03
5
385 Views
Last Modified: 2013-12-03
Hello experts !!!

I try to translate a WIN16-application written with MSVC++ v1.52 into a WIN32-application using the new MSVC++ 5.0 compiler.

The windows-part of my application is rather simple and uses the WIN SDK functions. No MFC.

I took the 16bit code and replaced the unknown 16bit-SDK functions with the complying 32bit-functions.

After some more small changes I succeeded in compiling the source code with no warnings or errors.

The application works fine, until I open a dialog box or
a MessageBox. Then sometimes but not always the program stops with an exception.

In the debug window of MSVC++ 5.0  I get the error message

First-chance exception in tickbase.exe (KERNEL32.DLL): 0xC0000005: Access Violation.

In 16bit I never had any problems with my dialog boxes.

Has someone else encountered a similar problem and can give me a hint how I can handle it.

Thanks in advance

            Bernd Laubender
0
Comment
Question by:laubender
  • 3
  • 2
5 Comments
 

Author Comment

by:laubender
ID: 1397828
Edited text of question
0
 
LVL 4

Accepted Solution

by:
AVaulin earned 100 total points
ID: 1397829
Open InfoViewer window in VC and find "Porting 16-bit Code to 32-bit Windows" topic. There is step-by-step instruction how to do what you want. Good luck.
0
 

Author Comment

by:laubender
ID: 1397830
In my search for the solution of the problem  I wrote this simple Windows programm which shows the same behaviour.

////////// Beginning of Source Code test.cpp //////////
#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
            MessageBox(NULL,"Text","Title",MB_ICONINFORMATION);             return 0;
}
////////// End of Source Code //////////

Really simple, isn't it.

So I created a WIN32-Application Project, added the file and started the compiler in Debug Mode.

The Compiler produced following output information.

Loaded 'C:\WINDOWS\SYSTEM\ADVAPI32.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\GDI32.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\KERNEL32.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\USER32.DLL', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM\ATICWDDE.DLL', no matching symbolic information found.
First-chance exception in testmain.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
First-chance exception in testmain.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
First-chance exception in testmain.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
First-chance exception in testmain.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
The thread 0xFFF28B67 has exited with code 0 (0x0).
The program 'C:\Work\32bit\test\testmain\Debug\testmain.exe' has exited with code 0 (0x0).

Without the MessageBox I get no exceptions.

Can someone explain me the exception messages.
Maybe somethings wrong in the projects settings. I use the default settings.

bye
      Bernd Laubender
0
 
LVL 4

Expert Comment

by:AVaulin
ID: 1397831
Incredible! What Windows version do you use?
0
 

Author Comment

by:laubender
ID: 1397832
I've got the Windows 95 - Version  4.00.950a
 
I tested the compiler on another system with the Windows 95 Version 4.00.950 and everything seems to work.

I've tested it also on a different computer with the
Windows 95 - Version  4.00.950a and faced similar problems.
Maybe MSVC 5.0 doesn't work with the 'a'-Version or my installed Window Version is corrupt.

Thanks for your help
                 Bernd Laubender

PS: I give you a C rate because you have given some good hints for solution, so in the end I could solve it by myself



0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

12 Experts available now in Live!

Get 1:1 Help Now