| View previous topic :: View next topic |
| Author |
Message |
JackFoo Senior Member


Joined: 05 Feb 2003 Posts: 373 Location: ERROR
|
Posted: Wed Mar 19, 2003 12:56 pm Post subject: Win Apps |
|
|
Hi, I've been thinking of rewriting lst2str into a windows app. instead of a console app.; However I have no experience with win. apps, I replaced
| Code: | | int main(int argc, char *argv[]) |
with:
| Code: | | int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) |
and am now calling the argv as __argv and the same for argc, however despite these changes I can still see the console window popping up, any help would be greatly appreciated.
P.S. All pure C, no C++ or delphi please ;-).
Chears. |
|
| Back to top |
|
 |
Aezay Senior Member


Joined: 12 Feb 2003 Posts: 247 Location: Denmark
|
Posted: Wed Mar 19, 2003 1:08 pm Post subject: |
|
|
I dont really know, but since there's an Image Subsystem value in the Portable Executeable Optional Header of the exe file, I would guess u have to tell the compiler that it's not a console app somehow.
This Image Subsystem value is 3 if its a console, and 2 if GUI. _________________ Of all the planets I've been to, this one is my favorite. |
|
| Back to top |
|
 |
soreno Junior Member


Joined: 13 Feb 2003 Posts: 81 Location: Grenaa, Denmark
|
Posted: Wed Mar 19, 2003 1:11 pm Post subject: |
|
|
It depends on your compiler.
You should set the subsystem to "windows" instead of "console"
With MinGW (GCC for Win32) you could link with this parameter:
With MSVC++ you could paste these lines:
| Code: |
//#pragma comment(linker, "/subsystem:\"console\" /entry:\"mainCRTStartup\"")
#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
|
_________________ http://www.dotnetforum.dk/blogs/soren.olesen/ |
|
| Back to top |
|
 |
soreno Junior Member


Joined: 13 Feb 2003 Posts: 81 Location: Grenaa, Denmark
|
|
| Back to top |
|
 |
JackFoo Senior Member


Joined: 05 Feb 2003 Posts: 373 Location: ERROR
|
Posted: Wed Mar 19, 2003 1:41 pm Post subject: |
|
|
So simple, damn, I'm deeply vexed. Thanks a lot soreno, -mwindows worked like a charm!!!!
Cheers. |
|
| Back to top |
|
 |
|