Learn Game Programming using DirectX9 visit: http://lightportal.co.nr
Replyhow can i make a game wit direct x sdk, and win 2005 visual basic c/c++
ReplyHi, I write a program to play Video files using Directshow and MFC ( Visual C++ 6.0 , DirectX 9.0 ) I compile in DEBUG mode, It runs well and correctly. But when I compile in RELEASE mode. It reports error : "Unhandle exception in Playwnd.exe (MFC42.dll)0xC0000005: Access Violation" Is there any problem on MFC42.dll ? Please help me to correct it. Thank you very much. Noi - nvnoi76@yahoo.com
ReplyI am getting compilation error because of above files. fatal error C1083: Cannot open include file: '../GameLib/Image.h': No such file or directory
The file isn't needed at all, just delete the line: #include "../GameLib/Image.h"
ReplyI encountered the same problem,but when I followed your suggestion,my computer compiled succeddfully.Thanks a lot!
ReplyI had the same problem. Luckily I found the file using explorer. I copied into the project file, added it to the header files in 'file view' and it worked ok. If you cannot find a copy on your machine, the contents are lested below
#ifndef __IMAGE_H__
#define __IMAGE_H__
typedef struct
{
unsigned short imagic;
unsigned short type;
unsigned short dim;
unsigned short sizeX, sizeY, sizeZ;
char name[128];
unsigned char *data;
} IMAGE;
IMAGE *ImageLoad(char *);
#endif /* !__IMAGE_H__! */
Reply
If the user changes the display mode -- for example from 1024x768 pixels to 800x600 pixels -- the application cannot work anymore. But I think I have found the right way to get round this.
When the user changes the resolution, all the windows receive the WM_DISPLAYCHANGE message.
So I added this declaration in file ddraw_in_mfcwindView.h, class CDdraw_in_mfcwindView:
afx_msg LRESULT OnDisplayChange(WPARAM wParam, LPARAM lParam);
I updated the message map in file ddraw_in_mfcwindView.cpp like this:
BEGIN_MESSAGE_MAP(CDdraw_in_mfcwindView, CView)
//{{AFX_MSG_MAP(CDdraw_in_mfcwindView)
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_DISPLAYCHANGE, OnDisplayChange)
END_MESSAGE_MAP()
And I added the code for OnDisplayChange method in file ddraw_in_mfcwindView.cpp like this:
LRESULT CDdraw_in_mfcwindView::OnDisplayChange(WPARAM wParam, LPARAM lParam)
{
LRESULT _lResult;
_lResult = CWnd::OnDisplayChange(wParam, lParam);
ddobj.Terminate();
bDDrawActive = FALSE;
if (!ddobj.Init(GetSafeHwnd()))
{
AfxMessageBox("Failed to Create DirectDraw Interface.");
}
else
{
bDDrawActive = TRUE;
}
return _lResult;
}
It seems to work pretty well.
Reply
Originally posted by: Deutsch
I've tried to create a simple animation on the basis of this
tutorial. The problem is, that the function OnDraw in the view class must be called to renew the screen, and because of this the screen is blinking.
Avoid OnDraw by calling: ddobj.Clear(); ddobj.TestDraw(x, y); ddobj.Display(); from somewhere else (e.g. OnTimer()). Do not invalidate the view This will not stop the flicker. You must take out the blt to the m_pddsFrontBuffer in the CDDrawSystem::Clear() function, then it works fine
ReplyOriginally posted by: Ren�
Nice code, however I can assure you it will not work in an
activex application. I made an activex and in Ondraw I implemented the blitting of a bmp-file. Code worked perfectely in windows 98 and directx > 7.0. It also works in win2000 directx7 but not in directx8 and 9. So again an example of lousy microsoft testing. The problem in the latter case is that it seems that the blitting will not compensate for the coordinates gotten by clienttoscreen. The drawing can be anywhere in the screen, depending on the location of the picturebox of which the activex is a child.
Originally posted by: anita
hai
can you tell me where can I foind ddutil.h and resource.h
thank you
Originally posted by: Zygoman
Very good stuff !!!! I used it for a dialog-based application, and there was no problem at all !!!!! Thanks a lot, save a lot amount of time :-)
ReplyOriginally posted by: Tyrone Deane
Thanks for the tip about how to include the DirectX lib and include directories. My code now complies. Yippee!!!!
Reply