Pelles C forum

C language => Beginner questions => Topic started by: acidvertigo on June 30, 2015, 12:50:52 PM

Title: Split win32 gui project
Post by: acidvertigo on June 30, 2015, 12:50:52 PM
Hello,
i'm building a project using the windows application wizard and selecting the "hello word" template.

what i want is to split main.c file so every dialog functions are in separate c files as i have to build a big menu for my application.

For example if i remove the last AboutDlgProc function from the main file and move to another aboutdlg.c file is a good practice to declare the function prototype as external in the main.c file as follows?:

Code: [Select]
extern LRESULT WINAPI AboutDlgProc(HWND, UINT, WPARAM, LPARAM);
Title: Re: Split win32 gui project
Post by: acidvertigo on June 30, 2015, 08:57:04 PM
Seems that this link has the correct answer: http://c-faq.com/cpp/hfiles.html (http://c-faq.com/cpp/hfiles.html)

So is best to put the external prototype in the header file. Just sharing here for beginners like me.  ;D
Title: Re: Split win32 gui project
Post by: frankie on July 01, 2015, 05:30:10 PM
Yes, you're right.
The prototypes are normally put in header files (.h).
Welcome on the forum.
Title: Re: Split win32 gui project
Post by: Snowman on July 02, 2015, 08:46:57 AM
acidvertigo I am glad you found the C FAQ site.
It is one of the sites I always recommend to beginners. Others being:

http://en.cppreference.com/w/c
http://mycquiz.com/
http://crypto.stanford.edu/~blynn/c/