Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralInternetGetConnectedState() failed on WINME Pin
ace_maggot3-Oct-04 19:02
ace_maggot3-Oct-04 19:02 
GeneralRe: InternetGetConnectedState() failed on WINME Pin
tgprakash3-Oct-04 20:20
tgprakash3-Oct-04 20:20 
GeneralRe: InternetGetConnectedState() failed on WINME Pin
tgprakash3-Oct-04 21:04
tgprakash3-Oct-04 21:04 
GeneralRe: InternetGetConnectedState() failed on WINME Pin
2249173-Oct-04 22:42
2249173-Oct-04 22:42 
GeneralRe: InternetGetConnectedState() failed on WINME Pin
David Crow4-Oct-04 4:14
David Crow4-Oct-04 4:14 
GeneralSending data with ::SendMessage(...) function Pin
Muhammad Azam3-Oct-04 18:49
Muhammad Azam3-Oct-04 18:49 
GeneralRe: Sending data with ::SendMessage(...) function Pin
ThatsAlok3-Oct-04 19:18
ThatsAlok3-Oct-04 19:18 
GeneralRe: Sending data with ::SendMessage(...) function Pin
Steen Krogsgaard4-Oct-04 3:52
Steen Krogsgaard4-Oct-04 3:52 
Since you are sending the CStrings within the same process and synchronously with SendMessage I'd simply cast the adresses of the two CString objects to WPARAM and LPARAM. If you need more room the the 64 bits that these two parameters give you you can allocate a struct on the stack and pass the adress of it in e.g. LPARAM

<br />
CString cs1, cs2;<br />
//.... some code<br />
<br />
res = ::SendMessage(hwnd, WM_MYMESSAGE, (WPARAM)&cs1, (LPARAM)&cs2);<br />


or

<br />
class CMyMessageData<br />
{<br />
public:<br />
CString m_str1;<br />
CString m_str2;<br />
....<br />
}<br />
<br />
//....<br />
<br />
CMyMessageData data;<br />
data.m_str1 = cs1;<br />
data.m_str2 = cs2;<br />
<br />
res = ::SendMessage(hwnd, WM_MYMESSAGE, 0L, (LPARAM)&data);<br />


But don't use this technique to send data to a window in another process or thread, or to send data using PostMessage.

Cheers
Steen.

"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
GeneralRe: Sending data with ::SendMessage(...) function Pin
Ed K4-Oct-04 16:07
Ed K4-Oct-04 16:07 
GeneralRe: Sending data with ::SendMessage(...) function Pin
Steen Krogsgaard4-Oct-04 20:50
Steen Krogsgaard4-Oct-04 20:50 
GeneralRe: Sending data with ::SendMessage(...) function Pin
Muhammad Azam4-Oct-04 20:33
Muhammad Azam4-Oct-04 20:33 
GeneralRe: Sending data with ::SendMessage(...) function Pin
Steen Krogsgaard4-Oct-04 21:25
Steen Krogsgaard4-Oct-04 21:25 
GeneralRe: Sending data with ::SendMessage(...) function Pin
Muhammad Azam4-Oct-04 23:26
Muhammad Azam4-Oct-04 23:26 
GeneralActive X Problem Pin
BAIJUMAX3-Oct-04 17:31
professionalBAIJUMAX3-Oct-04 17:31 
Generalcontext and winhelp menus not staying in foreground Pin
raultkd3-Oct-04 16:45
raultkd3-Oct-04 16:45 
QuestionI'm floating integer to hex? Pin
BOBOBOBOBS3-Oct-04 15:53
BOBOBOBOBS3-Oct-04 15:53 
AnswerRe: I'm floating integer to hex? Pin
ThatsAlok3-Oct-04 19:09
ThatsAlok3-Oct-04 19:09 
AnswerRe: I'm floating integer to hex? Pin
mirex4-Oct-04 2:40
mirex4-Oct-04 2:40 
GeneralHelp Pin
Anonymous3-Oct-04 14:22
Anonymous3-Oct-04 14:22 
GeneralRe: Help Pin
ThatsAlok3-Oct-04 20:36
ThatsAlok3-Oct-04 20:36 
GeneralExtract HBITMAP from IMAGELIST icon Pin
peterchen3-Oct-04 14:15
peterchen3-Oct-04 14:15 
GeneralRe: Extract HBITMAP from IMAGELIST icon Pin
PJ Arends3-Oct-04 16:24
professionalPJ Arends3-Oct-04 16:24 
GeneralMFC Progress Bar Pin
Anonymous3-Oct-04 11:59
Anonymous3-Oct-04 11:59 
GeneralRe: MFC Progress Bar Pin
ThatsAlok3-Oct-04 19:25
ThatsAlok3-Oct-04 19:25 
GeneralRe: MFC Progress Bar Pin
pubududilena4-Oct-04 0:06
pubududilena4-Oct-04 0:06 

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.