i have this code that put the value of a textbox field in the variable. The textbox is a Ip Address Control. How can i check if when the user press the OK button the field is empty or not? Thank you
char *myVar = new char[16];
*myVar = NULL;
GetDlgItemTextA(hDlg, IDC_MYVAR, myVar开发者_如何学Python, 16);
delete [] myVar;
You probably have to use the IPM_ISBLANK message (i am not an expert on winapi, so i may be mistaken).
I'd just get hold of the HWND for the control, send it a WM_GETTEXTLENGTH and compare the answer with zero.
Just check whether myVar[0] is zero after calling GetDlgItemTextA.  
char myVar[16];
GetDlgItemTextA(hDlg, IDC_MYVAR, myVar, 16);
if (myVar[0] == 0) // then field is empty
See here: GetWindowText Function
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论