Re: Build Errors



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!

Later! :)


"Victor Bazarov" wrote:

> Ross wrote:
> > Please view the following code fragment. Build errors are generated at build
> > time such as:
> >
> > c:\DATASOURCE_EXTRA\Programming\VC++CodeTesting_WINDOWS\CPZ_P192\WHATSIZE.C(12): error C2065: 'WndProc' : undeclared identifier
> >
> > c:\DATASOURCE_EXTRA\Programming\VC++CodeTesting_WINDOWS\CPZ_P192\WHATSIZE.C(64):
> > error C2365: 'WndProc' : redefinition; previous definition was a 'data
> > variable'
> >
> > c:\DATASOURCE_EXTRA\Programming\VC++CodeTesting_WINDOWS\CPZ_P192\WHATSIZE.C(12): warning C4047: '=' : 'WNDPROC' differs in levels of indirection from 'int'
>
> See below.
>
> >
> > c:\DATASOURCE_EXTRA\Programming\VC++CodeTesting_WINDOWS\CPZ_P192\WHATSIZE.C(42):
> > warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of
> > data
>
> Cast it (if you care to remove this warning).
>
> > Don't seem to see the typo's. Here is the code:
> >
> > #include <windows.h>
> >
> > int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInnstance,
> > PSTR szCmdLine, int iCmdShow)
> > {
> [...]
> > }
>
> Move the following two functions _above_ the "WinMain".
>
> >
> > 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)
> > {
> [...]
> > }
>
> >
> > Also the 2nd parameter of the following line:
> >
> > DPtoLP(hdc,(LPPOINT) &rect,2);
> >
> > requests a long pointer to a point structure, why include the (LPPOINT) part
> > of it.
>
> Because &rect is of type LPRECT, not LPPOINT. You need to cast to tell
> the compiler how to interpret the address.
>
> V
>
.



Relevant Pages

  • Re: Executable enty points incorrectly documented
    ... They have the same signature of int XXXXX. ... WinMain is not a starting function in CRT, ... Microsoft Online Community Support ... initial response from the community or a Microsoft Support Engineer within ...
    (microsoft.public.win32.programmer.kernel)
  • Having and Issue and Im unable to find SvcTraceViewer.exe
    ... works the first time I use it, maybe twice, and then after that fails ... private int findClosestDateInList(ListdateList, DateTime ... if (dd < smallestTimeSpan) ... closestMeter = reading.meterReading; ...
    (microsoft.public.dotnet.framework.webservices)
  • 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: Entry-point symbol issue
    ... You don't want to set the entry point to main. ... Not WinMain, right? ... Entry-point symbol: ... int WINAPI WinMain ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Rat In A Maze
    ... declaring two mazes is unnecessary. ... You should really have included an example data file. ... what does each int represent? ... see you made the same mistake the first time you declared retval as well. ...
    (comp.lang.java.help)