Home > Back-end >  Questions about the char unicode transformation
Questions about the char unicode transformation

Time:09-29

Define a structure
Struct SDK_NetWifiDevice {
Char sSSID [36].//SSID Number
Int nRSSI;//SEE SDK_RSSI_SINGNAL
Int nChannel;
Char sNetType [32].//Infra, Adhoc
Char sEncrypType [32].//NONE, WEP, TKIP and AES
Char sAuth [32].
//OPEN, SHARED, WEPAUTO WPAPSK, WPA2PSK WPANONE, WPA, connected,
};

Define a structure variable and successful assignment
SDK_NetWifiDevice WifiDevice=XXXX;
In c + + BIULDER XE8 in
TListItem * Item=LV_WIFIList - & gt; The Items - & gt; The Add ();
Item - & gt; Caption=WifiDevice. SSSID;
Results all gibberish, how should solve, Item - & gt; Caption is UnicodeString,

CodePudding user response:

This is right, not the code
 
Struct SDK_NetWifiDevice
{
Char sSSID [36].//SSID Number
Int nRSSI;//SEE SDK_RSSI_SINGNAL
Int nChannel;
Char sNetType [32].//Infra, Adhoc
Char sEncrypType [32].//NONE, WEP, TKIP and AES
Char sAuth [32].
//OPEN, SHARED, WEPAUTO WPAPSK, WPA2PSK WPANONE, WPA, connected,
};

SDK_NetWifiDevice WifiDevice;
Strcpy (WifiDevice sSSID, AnsiString (" China "). The c_str ());

TListItem * Item=ListView1 - & gt; The Items - & gt; The Add ();
Item - & gt; Caption=AnsiString (WifiDevice. SSSID);

CodePudding user response:

Char sSSID [36]. Its just applied for a memory, before the point to memory can be used, which may exist before leaving any data, must be reset or fill data, civilized words said initialization

, if you don't reset or fill in the application if the memory is not be used in all normal, if used is arbitrary data, therefore, each time you run the program reads the data are different

Specific code on the first floor have been given

CodePudding user response:

May express has a problem, to mention the problem,
A, define structure
Struct SDK_NetWifiDevice {
Char sSSID [36].//SSID Number
Int nRSSI;//SEE SDK_RSSI_SINGNAL
Int nChannel;
Char sNetType [32].//Infra, Adhoc
Char sEncrypType [32].//NONE, WEP, TKIP and AES
Char sAuth [32].
//OPEN, SHARED, WEPAUTO WPAPSK, WPA2PSK WPANONE, WPA, connected,
};

Struct SDK_NetWifiDeviceAll {
Int nDevNumber;
SDK_NetWifiDevice vNetWifiDeviceAll [NET_MAX_AP_NUMBER];
};
Second, the code
Struct SDK_NetWifiDeviceAll WifiDeviceAll;
DWORD dwRetLen=0;
H264_DVR_GetDevConfig (iLoginId E_SDK_CONFIG_NET_WIFI_AP_LIST, 1, (char *) & amp; WifiDeviceAll, sizeof (SDK_NetWifiDeviceAll), & amp; DwRetLen nWaitTime);//by the remote device information

Struct SDK_NetWifiDevice WifiDevice;
WifiDevice=WifiDeviceAll. VNetWifiDeviceAll [0];

TListItem * Item=LV_WIFIList - & gt; The Items - & gt; The Add ();
Item - & gt; Caption=WifiDevice. SSSID;
Three, the problem
Run the Item - & gt; Caption is garbled, can see WifiDevice. When debugging sSSID is normal display text,



  • Related