Click here to Skip to main content
15,914,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: need help coverting a char* to a unsigned short* Pin
Christian Graus15-Apr-02 17:10
protectorChristian Graus15-Apr-02 17:10 
GeneralRe: need help coverting a char* to a unsigned short* Pin
Tim Smith16-Apr-02 2:21
Tim Smith16-Apr-02 2:21 
GeneralRe: need help coverting a char* to a unsigned short* Pin
moliate16-Apr-02 2:36
moliate16-Apr-02 2:36 
GeneralRe: need help coverting a char* to a unsigned short* Pin
Le centriste16-Apr-02 3:22
Le centriste16-Apr-02 3:22 
GeneralRe: need help coverting a char* to a unsigned short* Pin
moliate16-Apr-02 4:22
moliate16-Apr-02 4:22 
GeneralRe: need help coverting a char* to a unsigned short* Pin
16-Apr-02 5:19
suss16-Apr-02 5:19 
Generalneed help coverting a char* to a unsigned short* Pin
15-Apr-02 17:06
suss15-Apr-02 17:06 
GeneralRe: need help coverting a char* to a unsigned short* Pin
Le centriste16-Apr-02 3:41
Le centriste16-Apr-02 3:41 
I suggest:

WCHAR *_ip_name = A2W(tempbuf_ip);


The beauty of this, you don't need to deallocate memory, since A2W uses _alloca.

Anonymous wrote:
char *tempbuf_ip;
WCHAR _ip_name[256];

GetDlgItemText(hwnd, IDC_IP, tempbuf_ip, 256);


This last line of the snippet above is likely to make your program crash since GetDlgItemText expects that tempbuf_ip points to a valid block of memory, which is not the case, unless you took off some code statements from your example.



Michel

If I am wrong or said something stupid, I apologize in advance Wink | ;)
GeneralInitializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 15:39
valikac15-Apr-02 15:39 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 15:59
Diarrhio15-Apr-02 15:59 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 16:03
valikac15-Apr-02 16:03 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 16:17
Diarrhio15-Apr-02 16:17 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 16:24
valikac15-Apr-02 16:24 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 16:48
Diarrhio15-Apr-02 16:48 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 16:58
valikac15-Apr-02 16:58 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 17:08
Diarrhio15-Apr-02 17:08 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 17:30
valikac15-Apr-02 17:30 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac15-Apr-02 18:04
valikac15-Apr-02 18:04 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 18:50
Diarrhio15-Apr-02 18:50 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
Diarrhio15-Apr-02 18:48
Diarrhio15-Apr-02 18:48 
GeneralRe: Initializing a CProgressCtrl Object Inside CDialog :: MFC Pin
valikac16-Apr-02 4:50
valikac16-Apr-02 4:50 
GeneralRe: Before or After Pin
valikac16-Apr-02 12:46
valikac16-Apr-02 12:46 
GeneralBitBlt problem Pin
Jack Handy15-Apr-02 15:26
Jack Handy15-Apr-02 15:26 
GeneralRe: BitBlt problem Pin
Paul M Watt15-Apr-02 18:51
mentorPaul M Watt15-Apr-02 18:51 
GeneralRe: BitBlt problem Pin
Jack Handy15-Apr-02 19:12
Jack Handy15-Apr-02 19:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.