Solved

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

Posted on 1997-06-03
5
389 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

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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…

912 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