Solved

Visual C++ and Windows 3.1

Posted on 1998-05-05
5
282 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
[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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

730 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