473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

how to build plain-dos EXE using Borland C++ 3.1 which uses WINAPI

Please help me.

I need to use some of Windows API, but my program must be also runnable from
plain dos.

I can not simply switch target to Win app. :(

Question: how link program witch <windows.h> included, but with plain DOS
startup code?

My program should detect if is running under windows and then use some of
API calls.
--

pozdrawiam / best regards
B.a.z.i.c * a.t * b.a.z.i.c * d.o.t * p.l

Jul 22 '05 #1
2 1806
"Przemysław Dmochowski" <ba***@bazic.not.exist.pl> wrote in message
news:bt*********@nemesis.news.tpi.pl...
Please help me.

I need to use some of Windows API, but my program must be also runnable from plain dos.

I can not simply switch target to Win app. :(

Question: how link program witch <windows.h> included, but with plain DOS
startup code?

My program should detect if is running under windows and then use some of
API calls.
--

pozdrawiam / best regards
B.a.z.i.c * a.t * b.a.z.i.c * d.o.t * p.l


I'd build two versions of the program, one for DOS and one for Windows.
Then build a third program that execs on of the other two depending on the
OS.

PS you're asking in the wrong newsgroup.
Jul 22 '05 #2

"Przemysław Dmochowski" <ba***@bazic.not.exist.pl> wrote in message
news:bt*********@nemesis.news.tpi.pl...
I need to use some of Windows API, but my program must be also runnable from plain dos.


Build a dos version, then a windows version. When linking the windows
version, use the dos version as the "stub executable". Then, even though the
result is only one big executable file, the dos version will run when in
dos, and the windows version will run when run under windows. This even
works when the dos version is a 32 bit dos extended version. I used to do
this all the time, it works great.

-Walter
www.digitalmars.com free C/C++/D compilers
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: xp | last post by:
I got the building error of "Could not copy temporary files to the output directory.". What do I do ? Thanks. xp
14
by: Akseli Mäki | last post by:
Hi, Hopefully this is not too much offtopic. I'm working on a FAQ. I want to make two versions of it, plain text and HTML. I'm looking for a tool that will make a plain text doc out of the...
8
by: LRW | last post by:
I'm not sure this message is totally appropriate for this group, so please, if anyone has a better group suggestion, let me know! My company sends out a monthly newsletter in HTML format to our...
2
by: Lamont | last post by:
When I took Course 2310B, "Developing MS ASP.NET Web Apps Using VS.Net, the classroom IDE listed a "Build and Browse" option upon right click on a form in the Solutions Window. On my own machine...
3
by: fragget | last post by:
where can i find a plugin that will automatically update the build number in vs.net? thx fg
3
by: John | last post by:
Hi, I need to build a BAUDOT lookup table for an encoder. I see to use a char as the index 'A' or 'B' and get back an array of booleans (five elements long). Baudot = {00011} Baudot =...
6
by: Ivan Demkovitch | last post by:
Hi! Here is my problem: I'm inserting script for Trust Logo from one of the SSL authorities. It works fine when I do it in HTML, but I need to build it dynamically: HtmlTableRow tR = new...
8
by: Doominato | last post by:
good day, I was just wondering how can I download a web page as plain text from a certain web site. I have tried to use the OpenURL() method from INET control in my VB.NET app, but it returns...
9
by: yevvi | last post by:
Hi, We have a product with bunch of dlls which are now built with Visual Studio 2003. We want to switch the build to use VS2005. I have read that in VS2005 runtime libraries come as...
1
by: mac | last post by:
I just put C# express editiion on my son's computer so he can learn how to code, and we've run into a weird problem. Whenever he makes a change to his code and hits F6 (build) the IDE reports...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.