CPoint pt;
GetCursorPos(&pt);
CMy750_clientApp* app = (CMy750_clientApp*)AfxGetApp();
HMENU hmenu = LoadMenu(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDR_MENU1));
HMENU hpopup = GetSubMenu(hmenu, 0);
switch(TrackPopupMenu(hpopup,TPM_RETURNCMD|TPM_RIGHTBUTTON,
pt.x,pt.y,0,m_hWnd,NULL))
{
case ID_Config1: //配置中队
m.Format(TEXT("%d"),(inifile.GetNumKeys()+1));
ttt=m;
//截取x=ip;y=netmask;z=gateway
// ".... .... ...."
x = m_tree.GetItemText(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET));
temp=x.Mid(x.Find(" ")+1,x.GetLength());
z=temp.Mid(temp.Find(" ")+1,temp.GetLength());
x=x.Left(x.Find(" "));
y=temp.Left(temp.Find(" "));
//
inifile.SetPath("test.ini");
inifile.ReadFile();
//根据中队名Name查找IP地址
for(h=1;h<=(inifile.GetNumKeys());h++)
{
s.Format(TEXT("%d"),h);
if((inifile.GetValue(s,"Name"))==m_tree.GetItemText(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET)))
{
x=inifile.GetValue(s,"Ip");
y=inifile.GetValue(s,"NetMask");
z=inifile.GetValue(s,"GateWay");
ttt = s;
}
}
ICspAdmin::CAMCFG *pCam = (ICspAdmin::CAMCFG *)m_tree.GetItemData(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET));
zzz dlg(pCam,ttt,m_tree.GetItemText(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET)),x,y,z);
dlg.DoModal();
break;
case ID_Config3:
CSname dlg(NULL);
dlg.DoModal();
break;
这是我做的右健弹出式菜单的选择的语句,不过总报错,帮我看看,不胜感谢
C:\Downloads\750_client\750_clientDlg.cpp(439) : error C2360: initialization of 'dlg' is skipped by 'case' label
C:\Downloads\750_client\750_clientDlg.cpp(434) : see declaration of 'dlg'
C:\Downloads\750_client\750_clientDlg.cpp(439) : error C2360: initialization of 'pCam' is skipped by 'case' label
C:\Downloads\750_client\750_clientDlg.cpp(433) : see declaration of 'pCam'
C:\Downloads\750_client\750_clientDlg.cpp(440) : error C2371: 'dlg' : redefinition; different basic types
C:\Downloads\750_client\750_clientDlg.cpp(434) : see declaration of 'dlg'
GetCursorPos(&pt);
CMy750_clientApp* app = (CMy750_clientApp*)AfxGetApp();
HMENU hmenu = LoadMenu(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDR_MENU1));
HMENU hpopup = GetSubMenu(hmenu, 0);
switch(TrackPopupMenu(hpopup,TPM_RETURNCMD|TPM_RIGHTBUTTON,
pt.x,pt.y,0,m_hWnd,NULL))
{
case ID_Config1: //配置中队
m.Format(TEXT("%d"),(inifile.GetNumKeys()+1));
ttt=m;
//截取x=ip;y=netmask;z=gateway
// ".... .... ...."
x = m_tree.GetItemText(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET));
temp=x.Mid(x.Find(" ")+1,x.GetLength());
z=temp.Mid(temp.Find(" ")+1,temp.GetLength());
x=x.Left(x.Find(" "));
y=temp.Left(temp.Find(" "));
//
inifile.SetPath("test.ini");
inifile.ReadFile();
//根据中队名Name查找IP地址
for(h=1;h<=(inifile.GetNumKeys());h++)
{
s.Format(TEXT("%d"),h);
if((inifile.GetValue(s,"Name"))==m_tree.GetItemText(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET)))
{
x=inifile.GetValue(s,"Ip");
y=inifile.GetValue(s,"NetMask");
z=inifile.GetValue(s,"GateWay");
ttt = s;
}
}
ICspAdmin::CAMCFG *pCam = (ICspAdmin::CAMCFG *)m_tree.GetItemData(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET));
zzz dlg(pCam,ttt,m_tree.GetItemText(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET)),x,y,z);
dlg.DoModal();
break;
case ID_Config3:
CSname dlg(NULL);
dlg.DoModal();
break;
这是我做的右健弹出式菜单的选择的语句,不过总报错,帮我看看,不胜感谢
C:\Downloads\750_client\750_clientDlg.cpp(439) : error C2360: initialization of 'dlg' is skipped by 'case' label
C:\Downloads\750_client\750_clientDlg.cpp(434) : see declaration of 'dlg'
C:\Downloads\750_client\750_clientDlg.cpp(439) : error C2360: initialization of 'pCam' is skipped by 'case' label
C:\Downloads\750_client\750_clientDlg.cpp(433) : see declaration of 'pCam'
C:\Downloads\750_client\750_clientDlg.cpp(440) : error C2371: 'dlg' : redefinition; different basic types
C:\Downloads\750_client\750_clientDlg.cpp(434) : see declaration of 'dlg'
解决方案 »
- CListBox控件如何让它支持 选择复制功能
- 在对话框类里面添加一个DDX使变量与对话框控键联系起来后出现的问题!
- 如何实现把一个表中所有数据拷到另一个表中,并做为表中的一个属性集
- WSAAccept函数疑惑,在线等
- 求VC怎样才能知道Oracle数据库中的一个表的记录增加了的代码?(在线等待)急!!!
- 请问网口通信的原理是什么
- 用socket写客户端,当有数据反馈回来时,如何自动触发事件,最好有简单的例子
- 我是新手,有个简单问题想问。
- 求助啊,画一个多边形,然后在多边形里面用学号进行填充
- 发现一个奇怪的错误,MFC的View类
- 问个简单的clipboard的问题,16日18:00前结账
- ListCtrl中Item取得焦点时产生哪个消息,如何响应?
比如
switch(a)
{
case 1:
{
int b=0;
}
break;
...
CSname dlg(NULL);
dlg.DoModal();
break;改为
case ID_Config3:
{
CSname dlg(NULL);
dlg.DoModal();
}
break;
{
}
请详细说一下好吗
{
case ID_Config1: //配置中队
{
m.Format(TEXT("%d"),(inifile.GetNumKeys()+1));
ttt=m;
//截取x=ip;y=netmask;z=gateway
// ".... .... ...."
x = m_tree.GetItemText(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET));
temp=x.Mid(x.Find(" ")+1,x.GetLength());
z=temp.Mid(temp.Find(" ")+1,temp.GetLength());
x=x.Left(x.Find(" "));
y=temp.Left(temp.Find(" "));
//
inifile.SetPath("test.ini");
inifile.ReadFile();
//根据中队名Name查找IP地址
for(h=1;h<=(inifile.GetNumKeys());h++)
{
s.Format(TEXT("%d"),h);
if((inifile.GetValue(s,"Name"))==m_tree.GetItemText(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET)))
{
x=inifile.GetValue(s,"Ip");
y=inifile.GetValue(s,"NetMask");
z=inifile.GetValue(s,"GateWay");
ttt = s;
}
}
ICspAdmin::CAMCFG *pCam = (ICspAdmin::CAMCFG *)m_tree.GetItemData(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET));
zzz dlg(pCam,ttt,m_tree.GetItemText(m_tree.GetNextItem(TVI_ROOT,TVGN_CARET)),x,y,z);
dlg.DoModal();
break;
}
case ID_Config3:
{
CSname dlg(NULL);
dlg.DoModal();
break;
}
pt.x,pt.y,0,m_hWnd,NULL)) 没有结束语句.
{ CSname dlg(NULL);
dlg.DoModal();
break;
}