C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28629
Number of posts: 94611

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Re: Prototype warnings with Borland win32 project Posted by tsagld on 22 Apr 2006 at 2:29 PM
: : It could be that the compiler encouters the calls to the functions before it encounters the prototypes. That's why it is more elegant to have the prototypes in separate header files and #include them in all sources that contains calls to the functions.
: : If that is not the case, pls post some more code.
: :
: :
: : Greets,
: : Eric Goldstein
: : www.gvh-maatwerk.nl
: :
: I could only have both the prototypes and functions a very little bit closer to the front than they are now. In fact, I usually build my functions right after the protoypes right after all the variables are defined, as you'll see below. I'm probably supposed to have them somewhere else for win32, or perhaps I need to build a class or something?
:
: There is only one source file (.c) with several #includes (.h). None of the includes has any function calls. They are large array initializers and combobox fillers. Almost all of the program runs 100% on two different machines.
:
: Here's a stripped down version of the source:
:
: #include <windows.h>
: #include "BECommnd.h" // resource file
: 
: const char g_szClassName[] = "myWindowClass";
: HWND		hwnd, ...;
: 
: char		ExtKey, FKey = 'F', EKey = 'E';
: UINT		Timer1, Timer2;
: int		TType = 5, Timer, position = 0,
: 		MIN_POSITION = 0, MAX_POSITION = 0;
: DWORD		PBIndex;
: char		Position[100][65];
: char		PositionTemp[65];
: char		Command[500];
: 
: #include "CmdBox.h"
:  ...                   // these initialize large arrays
: #include "phlength.h"
: 
: void CheckButtons();
: void NextCommand();
: void UpdateWin();
: void swapWin(HWND window);
: void InitPosBox();
: void cancelCommand();
: void handleTimer1();
: 
: void handleTimer1()  // each of the following call back and forth
: {                    // with warnings proclaimed
:  ...
: }
: 
: void cancelCommand()
: {
:  ...
: }
: 
: void InitPosBox()
: {
:  ...
: }
: 
: void swapWin(HWND window)
: {
:  ...
: }
: 
: void UpdateWin()
: {
:  ...
: }
: 
: void NextCommand()
: {
:  ...
: }
: 
: void checkButtons()
: {
:  ...
: }
: 
: BOOL CALLBACK AboutDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
: {
:  ...
: }
: 
: LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
: {
:  ...   // calls from here to all above functions give warnings
:        // except for the call to AboutDlgProc
: }
: 
: int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
: 	 LPSTR lpCmdLine, int nCmdShow)
: {
:  ...
: }
: 

:
: Thanks for helping me through these learning experiences...
:
: Take Care,
: Ed
:

:
:
Aha. Got it. Look at the spelling of your checkButtons function and prototype....


Greets,
Eric Goldstein
www.gvh-maatwerk.nl


Thread Tree
Ed Hall Prototype warnings with Borland win32 project on 21 Apr 2006 at 7:28 PM
tsagld Re: Prototype warnings with Borland win32 project on 21 Apr 2006 at 10:49 PM
Ed Hall Re: Prototype warnings with Borland win32 project on 22 Apr 2006 at 6:42 AM
Ed Hall Re: Prototype warnings with Borland win32 project on 22 Apr 2006 at 5:45 PM
Ed Hall Re: Prototype warnings - Solved! on 23 Apr 2006 at 5:15 PM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.