永发信息网

fatal error C1021: invalid preprocessor command '#ifdef_AFXDLL '怎解决?#ifdef_AFXDLL在vc中不变色?

答案:2  悬赏:0  手机版
解决时间 2021-01-29 01:18
  • 提问者网友:心如荒岛囚我终老
  • 2021-01-28 10:39
BOOL CDialogExamApp::InitInstance()

{

AfxEnableControlContainer();

AfxEnableControlContainer();

#ifdef_AFXDLL

Enable3dControls(); // Call this when using MFC in a shared DLL

#else

Enable3dControlsStatic(); //Call this when linking to MFC statically

#endif

//以下为用户添加的代码

bool ifquit=0; //是否退出的标记

int inputnumber=0; //输入密码次数统计

while(inputnumber<3)

{

CPassWordDlg MyPasswordDialog;

if(MyPasswordDialog.DoModal()==IDOK)

if((strcmp(MyPasswordDialog.m_strPassword,"good'')!=0)||(strcmp(MyPasswordDiaiog.m_strUSERNAME, ''good'')!=0))

{

MessageBox(NULL,"用户名或密码错误,请重 试!","错误 信息",MB_OK|MB_ICONERROR);

inputnumber++;

}

else

break;

else

{

ifquit=1;

break;

}

}

if(inputnumber ==3)

{

ifquit=1;

MessageBox(NULL, "用户名或密码输入已经超过三次,请退出! ","错误信息",MB_OK|MB_ICONERROR);

}

if(ifquit) return FALSE; //Change the registry key under which our settings are stored.

//TODO:You should modify this string to be something appropriate

//such as the name of your company or organization.

SetRegistryKey(_T("Local AppWizard-Generated Applications"));

LoadStdProfileSettings(); //Load standard INI file options(including MRU)
最佳答案
  • 五星知识达人网友:神鬼未生
  • 2021-01-28 11:49
貌似是少了一个空格吧?
#ifdef_AFXDLL 应该是 #ifdef _AFXDLL

#ifdef 后面应该有一个空格。
全部回答
  • 1楼网友:轻雾山林
  • 2021-01-28 12:36
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯