Solved

Visual C++ and Windows 3.1

Posted on 1998-05-05
5
278 Views
Last Modified: 2013-12-14
I have an application realized with Visual C++ 5.0 for Windows 95.
Then I have made a file .exe of this application.
What  can I do to run this execute in Windows 3.1 ??  
Is it possible ?? or I have to write again the application with Visual C++ for Windows 3.1??
0
Comment
Question by:gurgief
  • 4
5 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 100 total points
ID: 1172912
answer coming.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1172913
If the application uses only the windows API functions that are available on windows 3.1, then the application will run under windows 3.1.  However, if you use functions that are only available on windows 95 or NT, then the program will not run.  When the user tries to run the application windows will display an error message saying that the application could not be loaded.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1172914
I believe that you can use the WINVER preprocessor definition to indicate what target operating system you want.  If you set winver to 0x0310 then, the preprocessor will not include procedures that are not available on 3.1.  Thus if you try to use one of these procedures, you will get a compiler error.  You can set WINVER by placing the line

#define WINVER 0X0310

before the line where you include windows.h.  Or you can place the definition in your project settings.
0
 

Author Comment

by:gurgief
ID: 1172915
I have a Dialog Based Application composed by CBandoAppl and CBandoDlg classes
There is not included windows.h. Where I have to place
 #define WINVER 0X0310  ??
or where I have to place it in my project settings ??
thanks in advance
0
 
LVL 22

Expert Comment

by:nietod
ID: 1172916
You must be including some file that is including windows.h.  If you are using MFC, there must be an MFC include file that includes windows.h.  Place the #define above the line that includes this file.  You could put it before the first include to be safe.

It turns out this sort of definition can't be placed in the project settings, so use the #define.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

747 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

11 Experts available now in Live!

Get 1:1 Help Now