Home > Software engineering >  C programs written in SetDlgItemText does suggest SetDlgItemTextA don't accept two parameters
C programs written in SetDlgItemText does suggest SetDlgItemTextA don't accept two parameters

Time:09-16

SetDlgItemText is written in c + + program, compile results suggest "SetDlgItemTextA:" function does not accept two parameters, ask how does this change?
 
Case DBT_DEVICEREMOVECOMPLETE://DBT_DEVICEREMOVECOMPLETE, equipment unloading or pull out
{
If (LPDB - & gt; Dbch_devicetype==DBT_DEVTYP_VOLUME)//logical volume
{
PDEV_BROADCAST_VOLUME LPDBV=(PDEV_BROADCAST_VOLUME LPDB);
The switch (LPDBV - & gt; Dbcv_flags)
{
Case 0://U disk
{
STD: : string sUnplugMsg (" U disk is detected: [");
SUnplugMsg +=FirstDriveFromMask (LPDBV - & gt; Dbcv_unitmask);
SUnplugMsg +="] pull out!" ;

SetDlgItemText (IDC_EDIT1, sUnplugMsg c_str ());

}
break;
Case DBTF_MEDIA://CD

STD: : string sCDMsg (" detect disc: [");
SCDMsg +=FirstDriveFromMask (LPDBV - & gt; Dbcv_unitmask);
SCDMsg +="] insert!" ;
SetDlgItemText (IDC_EDIT1, sCDMsg c_str ());
break;
}
}
}

CodePudding user response:

Because you call SetDlgItemText SDK API, not MFC CWnd: : SetDlgItemText, SDK API for more than a HWND window handle parameters, and MFC CWnd class without the first parameter,

CodePudding user response:

Method 1: in the first parameter in the function,
Method 2: add: before function:

CodePudding user response:

Method 1 function to use access control class pointer, pointer with GetDlgItem () function

CodePudding user response:

Handle and control the ID is not the same thing

CodePudding user response:

One is a global function, one is the CWND class internal function

CodePudding user response:

1 #, 3 # positive solution,
  • Related