2006.06.28 07:01 "[Tiff] SOMEBODY HELP ME", by malathi p

2006.06.28 07:01 "[Tiff] SOMEBODY HELP ME", by malathi p

hi experts,

             iam trying to create a simple window,but its giving some sort of errors,which i couldnot understand anything,plz somebody help me,i attached my code as well errors

  my code:
  #include<tiffio.h>
#include<iostream.h>
#include<windows.h>
#include<resource.h>
//void main()
LRESULT CALLBACK wndProc(HWND,UINT,WPARAM,LPARAM);
  int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{

 //uint32 v,cnt;

 //TIFF *t=TIFFOpen("c:\\551997.tif","r");
    //v=TIFFGetField(t,256,&cnt);
 //cout<<"The:"<<v<<" "<<cnt;
 //TIFFClose(t);

 HWND hwnd;
 HWNDCLASS wndclass;
 if(!hPrevInstance)
 {
  wndclass.style=CS_HREDRAW|CS_VREDRAW;
  wndclass.lpfnwndProc=(WNDPROC)WndProc;
  wndclass.cbClsExtra=0;
  wndclass.cbwndExtra=0;
  wndclass.hInstance=hInstance;
  wndclass.hIcon=LoadIocon(NULL,IDI_APPLICATION);
  wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);
  wndclass.hbrBackground=GetStockobject(WHITE_BRUSH);
  wndclass.lpszMenuName="MYWINDOW";
  if(!RegisterClass(&wndclass))

 return 0;
 }

hwnd=CreateWindow("MYWINDOW","TIFF",WS_OVERLAPPEDWINDOW,10,110,400,400,NULL,NULL,hInstance,NULL);

ShowWindow(hwnd,nCmdShow);
     //cout<<"hai";

}

LRESULT CALLBACK WsndProc(HWND hwnd,UINT wMessage,WPARAM wParam,LPARAM lParam)
{
   return 0;
}

 error arises while compiling,iam doing in vc++6.0 console application

  --------------------Configuration: open - Win32 Debug--------------------
Compiling...
open.cpp

C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(21) : error C2065: 'HWNDCLASS' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(21) : error C2146: syntax error : missing ';' before identifier 'wndclass'
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(21) : error C2065: 'wndclass' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(24) : error C2228: left of '.style' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(25) : error C2228: left of '.lpfnwndProc' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(25) : error C2065: 'WndProc' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(26) : error C2228: left of '.cbClsExtra' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(27) : error C2228: left of '.cbwndExtra' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(28) : error C2228: left of '.hInstance' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(29) : error C2228: left of '.hIcon' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(29) : error C2065: 'LoadIocon' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(30) : error C2228: left of '.hCursor' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(30) : error C2664: 'LoadCursorA' : cannot convert parameter 1 from 'void *' to 'struct HINSTANCE__ *'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(31) : error C2228: left of '.hbrBackground' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(31) : error C2065: 'GetStockobject' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(32) : error C2228: left of '.lpszMenuName' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\prj\open.cpp(38) : error C2664: 'CreateWindowExA' : cannot convert parameter 9 from 'void *' to 'struct HWND__ *'
        Conversion from 'void*' to pointer to non-'void' requires an explicit cast

Error executing cl.exe.
  open.obj - 17 error(s), 0 warning(s)

  rgds
  Malathi

---------------------------------
 Yahoo! India Answers: Share what you know. Learn something new Click here
Catch all the FIFA World Cup 2006 action on Yahoo! India Click here