Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Visual Studio Watch can't see values of struct members

$
0
0

Hello, I'm using Visual Studio 2010. When I debug the following code, in my Watch window, when execution starts inside of WinMain(), Visual Studio isn't showing me the values of the members in the struct SpriteStruct. I've attached a screenshot to illustrate what I'm talking about. Does anyone know why this is? Thanks.

#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <string>
#include <vector>
#include <time.h>

using namespace std;

struct SpriteStruct
{
	RECT srcRect;
	int posX;
	int posY;

	int moveX;
	int moveY;

	int numFrames;
	int curFrame;
};

//globals
HINSTANCE hInst;
HWND wndHandle;
LPDIRECT3D9 pD3D;
LPDIRECT3DDEVICE9 pd3dDevice;
IDirect3DSurface9 *spriteSurface = NULL;
IDirect3DSurface9 *backBuffer = NULL;
SpriteStruct spriteStruct[10];

//prototypes
bool initWindow(HINSTANCE hInstance);
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
bool initDirect3D();
bool InitSprites();
void render();
void cleanUp();
IDirect3DSurface9* GetSurfaceFromBitmap(LPCWSTR fileName);


#define SPRITE_WIDTH 64
#define SPRITE_HEIGHT 23
#define SCRN_WIDTH 640
#define SCRN_HEIGHT 480



int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int CmdShow)
{
	if (!initWindow(hInstance))
		return false;

	if (!initDirect3D())
		return false;
	
	MSG msg;
	ZeroMemory(&msg, sizeof(msg)); //breakpoint here

//more code follows



Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>