NO

Author Topic: Split win32 gui project  (Read 1990 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: 1757
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.

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/