Solved

Visual C++ and Windows 3.1

Posted on 1998-05-05
5
280 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

831 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