Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared 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…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

571 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