Click here to Skip to main content
16,004,887 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHardware Device Status Pin
mcsherry25-Jul-07 3:55
mcsherry25-Jul-07 3:55 
AnswerRe: Hardware Device Status Pin
ashukasama25-Jul-07 4:13
ashukasama25-Jul-07 4:13 
GeneralRe: Hardware Device Status Pin
mcsherry25-Jul-07 5:51
mcsherry25-Jul-07 5:51 
GeneralRe: Hardware Device Status Pin
Iain Clarke, Warrior Programmer25-Jul-07 5:54
Iain Clarke, Warrior Programmer25-Jul-07 5:54 
QuestionUsing Conditional operator v/s if-else statements Pin
AmbyJaved25-Jul-07 3:51
AmbyJaved25-Jul-07 3:51 
AnswerRe: Using Conditional operator v/s if-else statements Pin
CPallini25-Jul-07 3:55
mveCPallini25-Jul-07 3:55 
AnswerRe: Using Conditional operator v/s if-else statements Pin
#realJSOP26-Jul-07 2:24
professional#realJSOP26-Jul-07 2:24 
QuestionWM_SETTEXT - Pass a string... Pin
Ylno25-Jul-07 3:44
Ylno25-Jul-07 3:44 
Hello All,

Sorry if this question is off topic. I've just started messing around with C++.

I'm trying to set the Text property of a window using :

<br />
     SendMessage(handle,WM_SETTEXT,0,(LPARAM)"Hello");<br />


This works fine. The proplem comes when i try the replace "Hello" with a string
variable like so:

<br />
string s;<br />
    s = "Hello";<br />
    SendMessage(handle_of_editbox,WM_SETTEXT,0,(LPARAM)s);<br />


I get the following error: "Struct 'std::string' used where a "LPARAM" was expected.
And if i don't use the cast the error says it can not convert string to LPARAM.

How can i avoid this?

Thanks
AnswerRe: WM_SETTEXT - Pass a string... Pin
Nemanja Trifunovic25-Jul-07 3:47
Nemanja Trifunovic25-Jul-07 3:47 
AnswerRe: WM_SETTEXT - Pass a string... Pin
Jonathan [Darka]25-Jul-07 3:47
professionalJonathan [Darka]25-Jul-07 3:47 
AnswerRe: WM_SETTEXT - Pass a string... Pin
Ylno25-Jul-07 4:07
Ylno25-Jul-07 4:07 
Questionsend a text message to a cell phone from an application Pin
nahitan25-Jul-07 3:43
nahitan25-Jul-07 3:43 
AnswerRe: send a text message to a cell phone from an application Pin
ThatsAlok25-Jul-07 20:11
ThatsAlok25-Jul-07 20:11 
QuestionPerformance diff between Win2K and WinXP? Pin
cjlambre25-Jul-07 3:12
cjlambre25-Jul-07 3:12 
QuestionRe: Performance diff between Win2K and WinXP? Pin
David Crow25-Jul-07 3:34
David Crow25-Jul-07 3:34 
AnswerRe: Performance diff between Win2K and WinXP? Pin
cjlambre29-Jul-07 6:22
cjlambre29-Jul-07 6:22 
Questionmalloc and free? Pin
murali_utr25-Jul-07 2:30
murali_utr25-Jul-07 2:30 
AnswerRe: malloc and free? Pin
Jonathan [Darka]25-Jul-07 2:39
professionalJonathan [Darka]25-Jul-07 2:39 
AnswerRe: malloc and free? Pin
David Crow25-Jul-07 2:40
David Crow25-Jul-07 2:40 
AnswerRe: malloc and free? Pin
Nemanja Trifunovic25-Jul-07 3:04
Nemanja Trifunovic25-Jul-07 3:04 
AnswerRe: malloc and free? Pin
Randor 25-Jul-07 6:27
professional Randor 25-Jul-07 6:27 
QuestionClist ctrl in dialog Pin
deeps_cute25-Jul-07 2:06
deeps_cute25-Jul-07 2:06 
AnswerRe: Clist ctrl in dialog Pin
David Crow25-Jul-07 2:30
David Crow25-Jul-07 2:30 
GeneralRe: Clist ctrl in dialog Pin
deeps_cute25-Jul-07 3:07
deeps_cute25-Jul-07 3:07 
QuestionRe: Clist ctrl in dialog Pin
David Crow25-Jul-07 3:30
David Crow25-Jul-07 3:30 

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.