•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 455,965 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,684 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums
Views: 1235 | Replies: 8
![]() |
•
•
Join Date: Apr 2007
Posts: 15
Reputation:
Rep Power: 2
Solved Threads: 0
I'm using Visual C++ 2005 Express.
In my solution I have 2 projects, a static library project and a executable project.
The problem starts because I need WinMain() inside the static library to remove almost all the platform specific code from the executable project.
How you set the entry point on the executable project to the WinMain() inside the static library?
In my solution I have 2 projects, a static library project and a executable project.
The problem starts because I need WinMain() inside the static library to remove almost all the platform specific code from the executable project.
How you set the entry point on the executable project to the WinMain() inside the static library?
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,539
Reputation:
Rep Power: 40
Solved Threads: 972
If you create a windows project (as opposed to a console program) just remove the winmain() that the IDE created and put it in the library. That's all there is to it. I assume you downloaded the Windows Platform SDK and installed it according to the instructions on M$ site. If you didn't then you can't create a windows program.
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,539
Reputation:
Rep Power: 40
Solved Threads: 972
I just tried it and the IDE does not have an option to include more than one project in the same solution, or maybe I just don't know how its done. I do it a lot with the Pro edition, but don't see it in the Express edition.
So zip up your project after deleting all compiler-generated files and post it and I'll give it a try.
So zip up your project after deleting all compiler-generated files and post it and I'll give it a try.
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,539
Reputation:
Rep Power: 40
Solved Threads: 972
you can not do MFC with the Express edition of the compiler because the libraries are not included in the Windows PSDK. You need the Standard or better version.
•
•
Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 11,539
Reputation:
Rep Power: 40
Solved Threads: 972
It is standard win32 api function. Scroll down to the bottom of the page and it will tell you what libraries are required.
•
•
Join Date: Dec 2006
Location: india
Posts: 1,084
Reputation:
Rep Power: 9
Solved Threads: 163
> I don't want any CRT in my application
do not use anything from the library that rquires CRT to be initialized. no malloc or new, no printf or streams, no statics requiring dynamic initialization or having non-trivial destructors, no atexit etc. and write your own entry-point function. here is a sample console based program:
do not use anything from the library that rquires CRT to be initialized. no malloc or new, no printf or streams, no statics requiring dynamic initialization or having non-trivial destructors, no atexit etc. and write your own entry-point function. here is a sample console based program:
c Syntax (Toggle Plain Text)
#include <windows.h> // link with switches /SUBSYSTEM:CONSOLE /ENTRY:"look_ma_no_main" // to set these from within the ide // properties -> Linker -> System -> SubSystem := Console // properties -> Linker -> Advanced -> Entry Point := look_ma_no_main extern "C" int look_ma_no_main() { char hello[] = "hello world!\n\r" ; // assumes narrow character console DWORD ignore = 0 ; WriteFile( GetStdHandle(STD_OUTPUT_HANDLE), hello, sizeof(hello)-1, &ignore, 0 ) ; MessageBoxA( 0, "Hello World!", "No CRT", MB_ICONEXCLAMATION ) ; return 0 ; }
![]() |
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- How to find a through line in a C++ project? (C++)
- static and shared library (C)
- adding library (C++)
- C++ Random Library (C++)
- Mounting Hardware For Access Point Moved Outside (Networking Hardware Configuration)
- Using MFC in a Static Library (C++)
Other Threads in the C++ Forum
- Previous Thread: Output Doesnot Show..anyone plzz
- Next Thread: Gets all information in listView into a binary file/String variables/textBox in VC++



Linear Mode