unexpected 'class Window (' ??? i dont understand the error
im getting a few errors when i try to compile my program. here is what i get:
e:\c++\dx\clswindow.cpp(5) : error C2629: unexpected 'class Window ('
e:\c++\dx\clswindow.cpp(5) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
E:\c++\dx\main.cpp(27) : error C2661: 'Window::Window' : no overloaded function takes 3 parameters
here is some of my code:
class Window
{
public:
Window(int Height, Width, long ColorKey) *****The first two errors point here.*****
{
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_CKSRCBLT;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
ddsd.dwHeight = Height;
ddsd.dwWidth = Width;
// Set the source color key to green.
ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = ColorKey;
ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = ColorKey;
if (FAILED(lpDD->CreateSurface(&ddsd, &DDSPrimary, NULL)))
{
return Fail(hwnd, "Couldn't create off-screen one.\n");
}
}
LoadPic(LPSTR File)
{
LoadImage(DDSPrimary, File)
}
~Window()
{
if (DDSPrimary != NULL)
{
DDSPrimary->Release();
DDSPrimary = NULL;
}
}
LPDIRECTDRAWSURFACE DDSPrimary; //Primary DD Surface
private:
DDSURFACEDESC ddsd; //The Direct Draw description
};
and the last error points here:
main.cpp:
Window winTest(100,100,0);
so, can anyone help me? im a beginer in c++, but i have programmed for around 9-10 years.
TIA
Echo
one more error, and question on warnings
thx, but now i have a few more questions
i dont understand where this error is coming from
e:\c++\dx\clswindow.cpp(24) : error C2660: 'LoadImageA' : function does not take 2 parameters
i dont have a LoadImageA function, i have a LoadImage function
here is the first part of that function
bool LoadImage(LPDIRECTDRAWSURFACE lpDDS, LPSTR szImage)
{
the error poings to this line:
LoadImage(DDSPrimary, File);
where File is LPSTR and DDSPrimary is LPDIRECTDRAWSURFACE
i dont understand what is wrong.
it also says that this this
if (~DestKey)
is unsafe. is it realy unsafe? i probley should try to night have any warnings right?
thanks for everything.
Echo