2 Replies - 5555 Views - Last Post: 28 March 2009 - 09:15 PM Rate Topic: -----

#1 Hanarecca  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 24-March 09

Error: No conversion from 'int' to '__w64 unsigned int

Posted 28 March 2009 - 08:01 PM

Here is the code, I am getting 3 errors. Any help would be highly appreciated.

error C3867: 'std::vector<_Ty>::size': function call missing argument list; use '&std::vector<_Ty>::size' to create a pointer to member

error C2446: '<=' : no conversion from 'int' to '__w64 unsigned int (__thiscall std::vector<_Ty>::* )(void) const'

error C2296: '<=' : illegal, left operand has type '__w64 unsigned int (__thiscall std::vector<_Ty>::* )(void) const'


void chatDisplay::setText()
{
	
	std::vector<std::string> ChatLog;
	// Make static so memory is not allocated every frame.

	sprintf(buffer2, "Chat: %s\n", ChatBuffer.c_str());

	int bottom;
	if(md3dPP.Windowed)
	bottom=md3dPP.BackBufferHeight-20;
	else
	bottom=GetSystemMetrics(SM_CYSCREEN)-20;

	RECT Rc = {5, bottom, 0, 0};//rec top should be screensize minus number, check if full or window
	HR(mGfxStats->mFont->DrawTextA(0, buffer2, -1, &Rc, DT_NOCLIP, D3DCOLOR_XRGB(0,0,0)));

	//chat log
	for(int x=0;x<ChatLog.size();x++)
	{
	sprintf(buffer2, "%s", ChatLog[x].c_str());
	RECT Rc = {5,(x*-20)+(bottom-20), 0, 0};

	HR(mGfxStats->mFont->DrawTextA(0, buffer2, -1, &Rc, DT_NOCLIP, D3DCOLOR_XRGB(0,0,0)));
	}

}


*edit: please use code tags in the future, thanks! :code:

This post has been edited by Martyr2: 28 March 2009 - 08:28 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Error: No conversion from 'int' to '__w64 unsigned int

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4404
  • View blog
  • Posts: 12,260
  • Joined: 18-April 07

Re: Error: No conversion from 'int' to '__w64 unsigned int

Posted 28 March 2009 - 08:44 PM

And when you double click the first error about size, what line does it take you to? Is it in the setText method?
Was This Post Helpful? 0
  • +
  • -

#3 Hanarecca  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 24-March 09

Re: Error: No conversion from 'int' to '__w64 unsigned int

Posted 28 March 2009 - 09:15 PM

View PostMartyr2, on 28 Mar, 2009 - 07:44 PM, said:

And when you double click the first error about size, what line does it take you to? Is it in the setText method?


Sorry about not formatting that right, I did a cleanup and the errors went away but this popped up now >.>

Error 1 error C3867: 'std::basic_string<_Elem,_Traits,_Ax>::size': function call missing argument list; use '&std::basic_string<_Elem,_Traits,_Ax>::size' to create a pointer to member d3dapp.cpp 249

Error 2 error C2446: '<=' : no conversion from 'int' to '__w64 unsigned int (__thiscall std::basic_string<_Elem,_Traits,_Ax>::* )(void) const' 3dapp.cpp 249

Error 3 error C2296: '<=' : illegal, left operand has type '__w64 unsigned int (__thiscall std::basic_string<_Elem,_Traits,_Ax>::* )(void) const' d3dapp.cpp 249

	switch( msg )
	{		
		case WM_CHAR:
			if(wParam >= 97 && wParam <= 123 || wParam == 32)
			{
				if(ChatBuffer.size <= 254)// only allows up to 255 characters
			//add wParam to string buffer
			ChatBuffer.push_back(wParam);
			}
				return 0;



Its pointing at line 249 for all 3 erros, which line 249 is
if(ChatBuffer.size <= 254)// only allows up to 255 characters


I have ChatBuffer set in my D3DApplic.cpp file.

class D3DApp
{
public:
	D3DApp(HINSTANCE hInstance, std::string winCaption, D3DDEVTYPE devType, DWORD requestedVP);
	virtual ~D3DApp();

	HINSTANCE getAppInst();
	HWND	  getMainWnd();

	// Framework methods.  Derived client class overrides these methods to 
	// implement specific application requirements.
	virtual bool checkDeviceCaps()	 { return true; }
	virtual void onLostDevice()		{}
	virtual void onresetDevice()	   {}
	virtual void updateScene(float dt) {}
	virtual void drawScene()		   {}
	virtual void drawLetters()		   {}

	// Override these methods only if you do not like the default window creation,
	// direct3D device creation, window procedure, or message loop.  In general,
	// for the sample programs of this book, we will not need to modify these.
	virtual void initMainWindow();
	virtual void initDirect3D();
	virtual int run();
	virtual LRESULT msgProc  (UINT msg, WPARAM wParam, LPARAM lParam);

	void enableFullScreenMode(bool enable);
	bool isDeviceLost();

protected:
	// Derived client class can modify these data members in the constructor to 
	// customize the application.  
	std::string ChatBuffer;
	std::string mMainWndCaption;
	D3DDEVTYPE  mDevType;
	DWORD	   mRequestedVP;
	
	// Application, Windows, and Direct3D data members.
	HINSTANCE			 mhAppInst;
	HWND				  mhMainWnd;
	HWND				  other;
	HWND				  btnJoin;
	IDirect3D9*		   md3dObject;
	bool				  mAppPaused;
	D3DPRESENT_PARAMETERS md3dPP;
};



UPDATE: Fixed, was missing ()

This post has been edited by Hanarecca: 28 March 2009 - 10:13 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1