DWORD WINAPI newsocket(LPVOID lpparameter)
{
GetDlgItem(IDC_IP)->GetWindowText(ipfine,10);
return 0;
}编译错误提示:
--------------------Configuration: **** - Win32 Debug--------------------
Compiling...
ServerDlg.cpp
...: error C2660: 'GetDlgItem' : function does not take 1 parameters
...: error C2227: left of '->GetWindowTextA' must point to class/struct/union
Error executing cl.exe.
{
GetDlgItem(IDC_IP)->GetWindowText(ipfine,10);
return 0;
}编译错误提示:
--------------------Configuration: **** - Win32 Debug--------------------
Compiling...
ServerDlg.cpp
...: error C2660: 'GetDlgItem' : function does not take 1 parameters
...: error C2227: left of '->GetWindowTextA' must point to class/struct/union
Error executing cl.exe.
解决方案 »
- 给list控件添加变量没反应
- vs2008sp1 RichEdit2.0 控件,对话框程序,回车程序自动退出的问题
- 自定义控件
- ** VC++ 调试的时候就会 VC就没有相应了!!! 好郁闷的~ 有没有哪位碰到这个问题啊???**
- 还是打包问题:如何将可执行程序与另外一个驱动程序一起打包,实现一步安装到位?(IstallShield6.22)
- 在IDE中按F1,MSDN总是不能跳到正确的位置,WHY?
- 对话框中的下拉列表型组合框在何时加入列表项才能在DoModal后显示出来
- 新手求教
- 关于改变窗口大小的问题?(跟贴有分)
- 实现二叉树的动态演示!
- 如何判断一个ZIP文件是否加密
- EnumChildWindows,枚举到适当窗口,就中断枚举的疑惑?
你可以用API来实现:
HWND hwnd=::FindWindow(NULL,_T("对话框标题"));
HWND hIpHwnd=::GetDlgItem(hwnd,IDC_IP);
TCHAR buff[256];
GetWindowText(hwnd,buff,256);
CMyDlg* pDlg = (CMyDlg*)lParam;
然后就可以用
pDlg->GetDlgItem()了这个前提是你传线程参数的时候要传递 CMyDlg 的 this 指针过来
在创建线程的时候,把主窗口的句柄(m_hWnd)传到线程里。