NO

Author Topic: Split win32 gui project  (Read 3478 times)

acidvertigo

  • Guest
Split win32 gui project
« 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);

acidvertigo

  • Guest
Re: Split win32 gui project
« Reply #1 on: June 30, 2015, 08:57:04 PM »
Seems that this link has the correct answer: 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

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Split win32 gui project
« Reply #2 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.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Snowman

  • Guest
Re: Split win32 gui project
« Reply #3 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/