cannot convert parameter 1 from 'unsigned int' to 'const char *'
-
sry to post this 2x but i figured some ppl wouldnt see it in my other thread. i get this error: cannot convert parameter 1 from 'unsigned int' to 'const char *' Conversion from int type to pointer type requires reinterpret_cast, C-style cast or functions-style cast for this line of code: m_port.AddString(ports.ElementAt(i)); How can i fix this? Thank you --------------------- And Like The Wind Our Hero Vanishes Off Into The Distance...
-
sry to post this 2x but i figured some ppl wouldnt see it in my other thread. i get this error: cannot convert parameter 1 from 'unsigned int' to 'const char *' Conversion from int type to pointer type requires reinterpret_cast, C-style cast or functions-style cast for this line of code: m_port.AddString(ports.ElementAt(i)); How can i fix this? Thank you --------------------- And Like The Wind Our Hero Vanishes Off Into The Distance...
It seems that ports.ElementAt if of type unsigned int (number) and must be of type const char * (string). Could you provide the ports structure/class declaration/initialization?
-
It seems that ports.ElementAt if of type unsigned int (number) and must be of type const char * (string). Could you provide the ports structure/class declaration/initialization?
im usinng the stuff the guy gave me in this thread: Can someone help me with this com port enumarator: http://www.codeproject.com/script/comments/forums.asp?forumid=1647&df=100&select=776802#xx776802xx if the link doesnt work it is just a few posts past this one. im using what he gave me not the link i porvided in the origional message thank you --------------------- And Like The Wind Our Hero Vanishes Off Into The Distance...
-
im usinng the stuff the guy gave me in this thread: Can someone help me with this com port enumarator: http://www.codeproject.com/script/comments/forums.asp?forumid=1647&df=100&select=776802#xx776802xx if the link doesnt work it is just a few posts past this one. im using what he gave me not the link i porvided in the origional message thank you --------------------- And Like The Wind Our Hero Vanishes Off Into The Distance...
Ok. The code in the thread is: tprintf(_T("COM%d\n"), ports.ElementAt(i)); then, port.ElementAt(i) is a number. You have to modify your code in the following way (or similar): char txt[256]; sprintf(txt,"COM%d",ports.ElementAt(i)); m_port.AddString(txt); Regards