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
[quoted text, click to view] "Mattias Sjögren" wrote:
> >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
>
> --
> Mattias Sjögren [C# MVP] mattias @ mvps.org
>
http://www.msjogren.net/dotnet/ |
http://www.dotnetinterop.com > Please reply only to the newsgroup.