Questions tagged [winmain]

WinMain is the user provided entry point for graphical Windows based applications.

WinMain is the user provided entry point for graphical Windows based applications. It is used as an entry point in every such Windows application. WinMain is used to initialize the application, display its main window, and enter a message retrieval-and-dispatch loop that is the top-level control structure for the remainder of the application's execution.

125 questions
0
votes
1 answer

How to fix compilation error "WinMain" in a C program?

Have 3 files- 1.atm.c(Source file) 2.transactions.h(function declarations) 3.transactions.c(defining the functions) when i compile(GCC) this i am getting a WinMain Error. And i tried all the ways i know, that i can compile the program. Ex 1: …
heeat
  • 128
  • 2
  • 9
0
votes
1 answer

Function overloading problem with SDL2 code? Error Entry Point must be defined?

I am trying to open a window using some SDL2 coding. However, every time I try to compile and run the code, visual studio always gives me the same error(s). Error: 'identifier' : function cannot be overloaded Here is my code: #include…
0
votes
1 answer

Including calling conventions in function declarations

I am reading about Win32 programming with C/C++ and came across a page which defines the WinMain as: int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow); I understand most of this, except I do not…
user1720897
  • 1,216
  • 3
  • 12
  • 27
0
votes
1 answer

Undefined reference under WinMain@16 in cygwin

i am new to stackflow and i previously i have no background in computer system and programming. However, now i need to run analysis under cygwin for my bioinformatics project. I encounter some error when i try to compile a file name…
Shawn
  • 21
  • 4
0
votes
1 answer

A Couple Questions About Creating Windows

In trying to get a grasp on creating windows (in Windows OS), I encountered this function definition LRESULT CALLBACK Window::MsgRouter(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) (taken from here) Me being only a beginner in C++ I…
Ell
  • 4,238
  • 6
  • 34
  • 60
0
votes
1 answer

Missing WinMain() arguments in Windows SDK sample

In one of the samples that come w/ Windows SDK (the CreateProcessVerb sample), the WinMain code is as follows: int APIENTRY wWinMain (HINSTANCE, HINSTANCE, PWSTR pszCmdLine, int) { .. Note that only the 3rd argument is actually specified, the rest…
Sabuncu
  • 5,095
  • 5
  • 55
  • 89
0
votes
0 answers

giving a window the focus of the application in Win32 C++

I am trying to make a simple game in Win32 C++ and I made a settings window that gets called when the user presser the 'P' button or 'Esc'. Now my question is how can I give that settings window the focus as long as the window is not destroyed, I…
0
votes
2 answers

Simple project won't compile

I'm still having issues with an ongoing project that just won't compile. I've narrowed it down to the Includes but can't figure out what is going on. I've read that i need to add a WinMain entry point but that doesnt add up - I have classmates that…
doria90
  • 45
  • 8
0
votes
0 answers

Writing a C++ console application in Code::Blocks and getting a WinMain@16 undefined ref

I'm taking a programming 101 class and I have an assignment to do which has me modify the following example files. I'm not asking for help on that part as I think I understand what I have to do to the files. My issue is that the files as given (both…
C-Mac
  • 31
  • 5
0
votes
2 answers

Is it correct/proper to use DialogBox as the main window?

Is it correct-proper as in windows doesn't say it's bad or not recommended. For example like this: int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, …
Carl Serl
  • 51
  • 6
0
votes
1 answer

Redefinition of WinMain Error in OpenGL example

I'm trying to get in touch with OpenGL with this example: #include #include #pragma comment (lib, "opengl32.lib") LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); int WinMain( __in HINSTANCE…
nonsensation
  • 3,627
  • 6
  • 28
  • 41
0
votes
1 answer

What's wrong with my using argc/argv this way in c?

This works: int main( int argc, char *argv[]) { .... gtk_init(&argc, &argv); .... But this doesn't: int WINAPI WinMain (HINSTANCE p1, HINSTANCE p2, LPSTR argv, int argc) { .... gtk_init(&argc, &argv); .... Can someone point out what's wrong…
user198729
  • 61,774
  • 108
  • 250
  • 348
0
votes
0 answers

How do I create window using WinMain

I cant create a Window using WinMain.It doesnt give any errors,it just doesnt work.I even tried to copy Source code in tutorials but it didnt work.I am using : MinGW32 ,Eclipse CDT Version: 8.1.2.201302132326 The code: #define…
0
votes
1 answer

How to disable WinMain entry point for a MFC application?

I understand that is not possible to have applications with multiple entry points under Windows. I have a MFC application and I added code for making it running as a service (main() entry point and other required stuff) but it looks that Windows…
sorin
  • 161,544
  • 178
  • 535
  • 806
0
votes
3 answers

WinMain not called before main (C/C++ Program Entry Point Issue)

I was under the impression that this code #include #include int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { printf("WinMain\n"); return 0; } int main() { …
BT.
  • 229
  • 1
  • 9
1 2 3
8 9