?
Solved

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

Posted on 1997-06-03
5
Medium Priority
?
400 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 200 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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 you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

752 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