>I'm using windows messages and the LParam parameter to send chars as ASCII
>numbers from VB6 to C#. How can I retrieve the right int value from the
>IntPtr in .NET?
What does the SendMessage code on the VB6 side look like?
To pass data buffers between processes, you typically have to use the
WM_COPYDATA message.
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Miro - 31 Mar 2007 15:28 GMT
The code is as follows. Is it enough to change the MessageID to WM_COPYDATA
or do I have to create and send a COPYDATASTRUCT? I f you have some code I
would be grateful.
Public Function SendMessageToCSharp(theChar As Integer)
Dim hwndTarget As Long
Dim MessageId As Long
If WindowMessagingInitialised = False Then
InitWindowMessaging
End If
'Get TargetWindow handle from global Window Name
hwndTarget = CSharp_WindowHandle
'Get MessageId from API call to RegisterMessage
MessageId = VB6_TO_CSharp_MessageId
'If Window target exists, then SendMessage to target
If hwndTarget <> 0 Then
Call PostMessage(hwndTarget, MessageId, o, theChar)
End If
End Function
> >I'm using windows messages and the LParam parameter to send chars as ASCII
> >numbers from VB6 to C#. How can I retrieve the right int value from the
[quoted text clipped - 6 lines]
>
> Mattias