Click here to Skip to main content
15,910,797 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Posting string using postmessage() function Pin
Nish Nishant18-Sep-06 5:55
sitebuilderNish Nishant18-Sep-06 5:55 
AnswerRe: Posting string using postmessage() function Pin
tanvon malik18-Sep-06 6:38
tanvon malik18-Sep-06 6:38 
GeneralRe: Posting string using postmessage() function Pin
ThatsAlok18-Sep-06 18:51
ThatsAlok18-Sep-06 18:51 
AnswerRe: Posting string using postmessage() function Pin
Mohammad A Gdeisat18-Sep-06 7:26
Mohammad A Gdeisat18-Sep-06 7:26 
AnswerRe: Posting string using postmessage() function Pin
Jun Du18-Sep-06 8:06
Jun Du18-Sep-06 8:06 
GeneralRe: Posting string using postmessage() function Pin
ThatsAlok18-Sep-06 18:48
ThatsAlok18-Sep-06 18:48 
GeneralRe: Posting string using postmessage() function Pin
Jun Du19-Sep-06 15:58
Jun Du19-Sep-06 15:58 
QuestionRe: Posting string using postmessage() function Pin
priyank_ldce20-Sep-06 1:25
priyank_ldce20-Sep-06 1:25 
Thanks for your reply.
Now I am using WM_COPYDATA to send string to my other application. I also want to send 2 integer values with this string. So, I made a structure of 1 string and 2 integers. But on the other side I am able to get 2 integer values but not string. I get blank string on that side. Here I am sending my code.

Sender application
struct MYDATASTRUCT
{
LPCSTR myString;
int myX;
int myY;
};
MYDATASTRUCT myStringData;
myStringData.myX = X;
myStringData.myY = Y;
myStringData.myString = lpString;
COPYDATASTRUCT myData;
myData.dwData = 0;
myData.cbData = sizeof(myStringData);
myData.lpData = &myStringData;
::SendMessage(g_mainHwnd,WM_COPYDATA,NULL,(LPARAM)&myData);

Receiver application
PCOPYDATASTRUCT myData = (PCOPYDATASTRUCT)lParam;
MYDATASTRUCT* myStringData = (MYDATASTRUCT*)myData->lpData;
int X = myStringData->myX;
int Y = myStringData->myY;
LPCSTR lpString = myStringData->myString;

Now when I am sending this string directly without structure and integer value I am able to get that string on receiver application.
Can anyone find what is the problem with structure code?
Thanks,
Priyank
QuestionPosting string using postmessage() function Pin
priyank_ldce19-Sep-06 1:27
priyank_ldce19-Sep-06 1:27 
QuestionWMI performance counters Pin
Jim Crafton18-Sep-06 4:54
Jim Crafton18-Sep-06 4:54 
QuestionSingle instance Pin
Waldermort18-Sep-06 4:41
Waldermort18-Sep-06 4:41 
AnswerRe: Single instance Pin
_AnsHUMAN_ 18-Sep-06 4:52
_AnsHUMAN_ 18-Sep-06 4:52 
GeneralRe: Single instance Pin
Waldermort18-Sep-06 4:57
Waldermort18-Sep-06 4:57 
GeneralRe: Single instance Pin
ThatsAlok18-Sep-06 5:05
ThatsAlok18-Sep-06 5:05 
GeneralRe: Single instance Pin
Waldermort18-Sep-06 5:35
Waldermort18-Sep-06 5:35 
GeneralRe: Single instance Pin
toxcct18-Sep-06 5:12
toxcct18-Sep-06 5:12 
AnswerRe: Single instance Pin
led mike18-Sep-06 5:27
led mike18-Sep-06 5:27 
AnswerRe: Single instance Pin
Lambry18-Sep-06 6:27
Lambry18-Sep-06 6:27 
GeneralRe: Single instance Pin
ThatsAlok18-Sep-06 18:12
ThatsAlok18-Sep-06 18:12 
GeneralRe: Single instance Pin
Lambry19-Sep-06 0:08
Lambry19-Sep-06 0:08 
GeneralRe: Single instance Pin
ThatsAlok19-Sep-06 0:48
ThatsAlok19-Sep-06 0:48 
GeneralRe: Single instance Pin
Lambry19-Sep-06 4:06
Lambry19-Sep-06 4:06 
GeneralRe: Single instance Pin
ThatsAlok19-Sep-06 19:07
ThatsAlok19-Sep-06 19:07 
QuestionProblem with Doc /View Pin
ramanand_bulusu18-Sep-06 4:24
ramanand_bulusu18-Sep-06 4:24 
AnswerRe: Problem with Doc /View Pin
Zac Howland18-Sep-06 4:45
Zac Howland18-Sep-06 4:45 

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.