JustSuds 0 Newbie Poster

Problem solved!

I just made a global variable WPARAM wPara, and in my WndProc I set wPara to wParam. Calling DoInput with my wPara value from a generic update method.

JustSuds 0 Newbie Poster

Hey, I've been working on my movement and controls and I've got a solid "DoInput(WPARAM wParam)" method built up. When I try to call it from WndProc like this:

switch (message)
	{
	case WM_CLOSE:
		{
			g_bDone = true;
			PostQuitMessage( 0 );
		} break;
	case WM_KEYDOWN:
			[B]DoInput(wParam);[/B]
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;

(Entire WndProc body there).

I get a " Error 1 error C2352: 'Controls::DoInput' : illegal call of non-static member function c:\development\mine\Controls\source\Controls.cpp 275 " error.

My question is; what exactly do I need to do to my DoInput method to make it legal?

The declaration looks like this:

void DoInput(WPARAM wParam);

If I simply make it "static void" I get many errors about illegal references to my position variables.

Thanks!

JustSuds 0 Newbie Poster

It might be helpful if you attach a screenshot of your monitor when that popup appears.

Sure, the top one is the default Output Window and the Bottom one is the nicer Error List:

JustSuds 0 Newbie Poster

I couldn't see a more appropriate place to make this thread, and I can only think of ambiguous terms to google, like "Output Error Windows Visual Studio".

The issue is, when I build my project (I'm using Visual Studio 2010, but I always had the same issue with VS2008), the output window pops up, with several lines of useful info, as is normal. I would like to diable this. I want to just have the Error List window displayed down the bottom, as is default in VC#.

I find the Error List to contain more concise and to-the-point information. I've only ever used the output window when there was something ambiguous in the error list. So, only about twice.

Can anyone point me towards disabling the output window? Thankyou very much.

JustSuds 0 Newbie Poster

Thanks. I'll look into it. The only problem I see with the solution is that I can get a blank device up and rendering in the same project (you know, the blue-filled window). Are there separate libraries that include the DX maths and the Device classes?

What I've got is (under right click project->properties->VC++ Directories->Include Directories) $(DXSDK_DIR)include

And under Library directories I have $(DXSDK_DIR)lib\x86\

I havent modified anyhting under executable directories, reference directories, source directories, or exclude directories. Do I need to add something? or is there a typo in my includes/library directories?

I appreciate the insight you've given me. Thanks.

JustSuds 0 Newbie Poster

I couldnt decide whether to put this question here (as I'm programming with DirectX) or in the C++ section.

I seem to only get this error occasionally. I understand the MSDN examples, and how they work. But I'm wondering if anyone can give a more human explanation?

See, this only happens to me when I'm trying to use DirectX objects/functions, etc. For example these lines:

D3DXVECTOR3 vEyePt( 0.0f, 3.0f,-5.0f );
    D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f );
    D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f );

Generate an LNK2019 each. They're call from within one of my own functions "SetupMatrices()".

I've actually been building this from a tutorial (its beginners DirectX for C++ Veterans) where the source code compiles and runs perfectly, yet, even pasting the source into my project (or even only pasting SMALL parts of it) yields the Unresolved external errors.

I dont understand the error fully, nor what I can do to resolve it. Any suggestions?

Thanks!

*Also, I have had this project working before i tried setting up matrices and whatnot, so I know the includes and libs are setup properly. I've compared my code to the tutorial source, line for line, and I can't see anything that is noticibly different. There are minor differences, but I can't see them affecting functionality.

JustSuds 0 Newbie Poster

For a class or a struct that's being referred to by a pointer, -> represents the dereference of the pointer followed by a dot operator.

For example say you have a class MyClass and public member function myMethod:

MyClass * mycl = new MyClass();
mycl->myMethod();
would be the same as
(*mycl).myMethod();

Thanks so much, that takes ALL the confusion out of it. The worst part was trying to google "->" - Google didnt seem to recognise that as a search term, lol.

Thanks!

JustSuds 0 Newbie Poster

Hi everyone, I just can't seem to find an explanation for using this "->" in code, in C++. I've migrated from Java and C#, and haven't seen this notation before. Basic example:

CMesh *pMesh = WorldObjects[i]->m_pMesh;

As best as I can tell, this is the C++ equivalent of C#'s

WorldObjects[i].m_pMesh;

. (as if to say that m_pMesh is a member variable, or method of the WorldObjects object, but as it is only a code snippet, I cant check the classes to see)

Just a quick syntactic explanation is all I need. Thanks.