Click here to Skip to main content
15,917,538 members
Home / Discussions / C#
   

C#

 
AnswerRe: string problem ? help please ¿ Pin
stancrm6-Jul-06 22:58
stancrm6-Jul-06 22:58 
AnswerRe: string problem ? help please ¿ Pin
Guffa6-Jul-06 22:59
Guffa6-Jul-06 22:59 
AnswerRe: string problem ? help please ¿ Pin
Nader Elshehabi6-Jul-06 23:15
Nader Elshehabi6-Jul-06 23:15 
GeneralRe: string problem ? help please ¿ Pin
Anh_Tuan7-Jul-06 2:18
Anh_Tuan7-Jul-06 2:18 
AnswerRe: string problem ? help please ¿ Pin
V.7-Jul-06 1:10
professionalV.7-Jul-06 1:10 
Questioninstance of a crystal report Pin
cellardoor07166-Jul-06 22:25
cellardoor07166-Jul-06 22:25 
AnswerRe: instance of a crystal report Pin
V.7-Jul-06 1:14
professionalV.7-Jul-06 1:14 
QuestionMarshaling Object Pin
Anh_Tuan6-Jul-06 22:22
Anh_Tuan6-Jul-06 22:22 
Hi,

I have applications that need to communicate with each other using HWND_BROADCAST

Here is the prototype for unmanged code function SendMessage

[DllImport("user32.dll")]<br />
extern static IntPtr SendMessage(IntPtr hWnd, int msg, MyClass myClass, IntPtr lParam);


where WParam is passed as an object reference.

In the overriden WndProc method on the other application, the WParam variable is marshaled back to the original object like this

protected override void WndProc(ref Message m)<br />
{<br />
if (m.Msg == CommonMessageID)<br />
{<br />
...<br />
// myClass contains junk data here<br />
MyClass myClass = (MyClass)Marshal.PtrToStructure(m.WParam, typeof(MyClass));<br />
...<br />
}<br />
base.WndProc(ref m);<br />
}


However, it does not hold the information that was initialized by the other app. What did I do wrong here?



Jup
AnswerRe: Marshaling Object Pin
mav.northwind7-Jul-06 1:14
mav.northwind7-Jul-06 1:14 
GeneralRe: Marshaling Object Pin
Anh_Tuan7-Jul-06 3:20
Anh_Tuan7-Jul-06 3:20 
Questionrunning a function in a thread Pin
Mridang Agarwalla6-Jul-06 22:21
Mridang Agarwalla6-Jul-06 22:21 
AnswerRe: running a function in a thread Pin
Anh_Tuan6-Jul-06 22:32
Anh_Tuan6-Jul-06 22:32 
GeneralRe: running a function in a thread Pin
Adadurov7-Jul-06 0:22
Adadurov7-Jul-06 0:22 
Questioncreate custom database [modified] Pin
z1z16-Jul-06 22:14
z1z16-Jul-06 22:14 
AnswerRe: create custom database Pin
Paul Conrad6-Jul-06 23:18
professionalPaul Conrad6-Jul-06 23:18 
Questioncombo box issue Pin
V.6-Jul-06 22:10
professionalV.6-Jul-06 22:10 
Questionexporting int array from c++ dll to c# client Pin
Tugberk_Kara6-Jul-06 22:07
Tugberk_Kara6-Jul-06 22:07 
QuestionOutlook automation in Citrix MetaFrame supresses notifications [modified] Pin
Corinna John6-Jul-06 22:03
Corinna John6-Jul-06 22:03 
QuestionMousePosition vs lParam Pin
syedhassan46-Jul-06 21:11
syedhassan46-Jul-06 21:11 
AnswerRe: MousePosition vs lParam Pin
fang_eric6-Jul-06 21:20
fang_eric6-Jul-06 21:20 
Questionhourglass mouse still clicking Pin
lushgrass6-Jul-06 19:53
lushgrass6-Jul-06 19:53 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi6-Jul-06 20:38
Nader Elshehabi6-Jul-06 20:38 
GeneralRe: hourglass mouse still clicking Pin
lushgrass6-Jul-06 21:02
lushgrass6-Jul-06 21:02 
AnswerRe: hourglass mouse still clicking Pin
Nader Elshehabi6-Jul-06 21:22
Nader Elshehabi6-Jul-06 21:22 
GeneralRe: hourglass mouse still clicking Pin
lushgrass6-Jul-06 22:24
lushgrass6-Jul-06 22:24 

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.