Re: Build Errors



Ross wrote:

Hi Victor!

The problem was, as you stipulated, the 2 functions had to be moved to the top of WINMAIN. However this is the first time in all my examples that I had to do this. Furthermore, the example in book was coded as I showed it.

Concerning the DPtoLP(hdc,(LPPOINT) &rect,2); line, I am curious to see where the
LPRECT type is defined. I will try to look in Windows.h later. Let me know if it is elsewhere!



Ross:

I think you are trying to learn Windows programming before you have learned C and/or C++. Not an easy thing to do.

In C and C++ every function must be defined OR DECLARED before it is used. Perhaps your book contains declarations of these 2 functions before WinMain()? The declarations should look like this:

void Show (HWND hwnd, HDC hdc, int xText, int yText, int iMapMode,
		   TCHAR * szMapMode);

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
lParam);

If you do this at the top, you can put the corresponding function definitions at the bottom.

HTH,

David Wilkinson
.



Relevant Pages

  • Re: C library interface
    ... HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ...
    (comp.lang.forth)
  • Re: Build Errors
    ... However this is the first time in all my examples that I had ... >> int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInnstance, ... >> LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM ...
    (microsoft.public.vc.language)
  • RE: MoveWindow not sending WM_SIZE on deeply nested windows
    ... > window whose size I've requested to change. ... > int find_window (HWND hwnd) { ... > void display_error { ...
    (microsoft.public.win32.programmer.ui)
  • Re: Windows c programing
    ... > LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM ... > HDC hdc; ...
    (comp.lang.c)
  • Re: GetWindowText results in Stack Overflow
    ... LRESULT myEdit::OnUpdate(UINT uMsg, WPARAM wParam, HWND hwnd, BOOL ... OnUpdate is a handler for EN_UPDATE notification. ... SetWindowText would, obviously, cause EN_UPDATE to be sent, so if you ...
    (microsoft.public.vc.language)