VS2010 rvalue

Intrebari despre programarea cu VC++ incluzand mediul de dezvoltare, instalare, setari, debugger, compilator, linker si documentatie.
Post Reply
u0m3
Membru
Membru
Posts: 80
Joined: 21 Dec 2008, 19:11
Judet: Bucureşti
Contact:

VS2010 rvalue

Post by u0m3 » 02 Jul 2009, 16:24

Am citi acest articol si am incercat sa-l pun in practica. Doar ca surprize-surprize: nu imi permite sa declar constructorul de move. Imi scapa ceva?

Code: Select all

#pragma once

class CCmdsBase
{
private:
	unsigned short m_keyComb;
	STDSTR m_paramString;
	bool m_wasPressed;
	CMDID_T m_cmdID;
	STDSTR m_className;
	STDSTR m_keyCombStr;
protected:
#ifdef _DEBUG
	TCHAR* m_ptDebugStr;
#endif
	void setParamString(const STDSTR& param);
	virtual void exec(void) =0;
public:
	CCmdsBase(const unsigned short keyComb, const CMDID_T cmdID = COMMAND_ID_BASE, const STDSTR& className = TEXT("CCmdsBase"));
	CCmdsBase(const CCmdsBase& obj);
#if _MSC_VER >= 1600
	CCmdsBase(CCmdsBase&& obj);      // Error!
#endif
	virtual ~CCmdsBase(void);
	unsigned short getKeys(void) const;
	STDSTR getParamAsString(void) const;
	STDSTR getKeysAsString(void) const;
	bool processKeys(unsigned short keyComb, const unsigned int eventID);
	bool isUsed(const unsigned short keyComb) const;
	CMDID_T getCmdID(void) const;
	STDSTR getCmdIDAsString(void) const;
	STDSTR getClassName(void) const;
	STDSTR getKeyCombName(void) const;
};
Si lista de include-uri(stdafx.h):

Code: Select all

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently

#pragma once

#ifndef _SECURE_ATL
#define _SECURE_ATL 1
#endif

#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN            // Exclude rarely-used stuff from Windows headers
#endif

#include "targetver.h"

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS      // some CString constructors will be explicit

// turns off MFC's hiding of some common and often safely ignored warning messages
#define _AFX_ALL_WARNINGS

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions


#include <afxdisp.h>        // MFC Automation classes



#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h>           // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>             // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

#include <afxcontrolbars.h>     // MFC support for ribbons and control bars


// Custom includes
#include <new>
#include <cctype>
#include <string>
#include <vector>
#include <fstream>
#include <utility>
#include <algorithm>

#include <stddef.h>
#include <strsafe.h>
#include <mmsystem.h>
#include <Winamp/wa_ipc.h>

#include "AboutDlg.h"
#include "customdefs.h"
#include "CmdsBase.h"
#include "CmdExecCmd.h"
#include "CmdWANextTrack.h"
#include "CmdWAPrevTrack.h"
#include "CmdWAPlay.h"
#include "CmdWAPause.h"
#include "CmdWAStop.h"
#include "CmdWAVolUp.h"
#include "CmdWAVolDown.h"
#include "CmdPSPNG.h"
#include "CmdCWPNG.h"
#include "CmdEjectCD.h"
#include "CmdInsertCD.h"
#include "CmdsStack.h"
#include "globalfunctions.h"

// Custom imports
#import <msxml6.dll>







#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif


Aceasta eroare pare sa fie doar pe partea de IntelliSense deoarece codul se compileaza... Visual Studio 2010 Professional Version 10.0.20506.1

Multumesc anticipat pentru sugestii...


Old-School: If at first you don't succeed, try and try again.
New-School: If at first you don't succeed, destroy every evidence that you have ever tried.
Citate nostime:
  1. Mintile umane sunt ca parasutele... Functioneaza doar daca sunt deschise.
  2. Light travels faster than sound, that's why some people seem Bright ...... untill they Speak...

User avatar
Marius Bancila
Fondator
Fondator
Posts: 2344
Joined: 11 Jul 2007, 11:45
Judet: Timiş
Location: Timisoara
Contact:

Re: VS2010 rvalue

Post by Marius Bancila » 03 Jul 2009, 10:10

Da, cred ca IntelliSensul mai are probleme. Am mai gasit si eu erori de intellisense, cand codul se compila OK (creaza un proiect MFC dialog base, si dai build - o sa vezi niste erori). Am facut un bug submit la Microsoft Connect. Eventual poti face si tu acelasi lucru.

Nu uita ca e doar beta, mai sunt destule probleme.
Marius Bancila
Fondator Codexpert, Microsoft MVP VC++
Site personal | Blog

u0m3
Membru
Membru
Posts: 80
Joined: 21 Dec 2008, 19:11
Judet: Bucureşti
Contact:

Re: VS2010 rvalue

Post by u0m3 » 03 Jul 2009, 18:53

Multumesc pentru raspuns... Am sa dau un ochi pe la Microsoft Connect.
Old-School: If at first you don't succeed, try and try again.
New-School: If at first you don't succeed, destroy every evidence that you have ever tried.
Citate nostime:
  1. Mintile umane sunt ca parasutele... Functioneaza doar daca sunt deschise.
  2. Light travels faster than sound, that's why some people seem Bright ...... untill they Speak...

Post Reply