Solved

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

Posted on 1997-06-03
5
397 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
[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
  • 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

689 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