1. How did you send message from ActiveX DLL to winform application?
In dll compiled with "Unattended execution" and "Retained in Memory"
Const WM_COPYDATA = &H4A
Private Type COPYDATASTRUCT
dwData As Long
cbData As Long
lpData As Long
End Type
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As
Any) As Long
Public Property Let WinHandle(ByVal value As Long)
gHwnd = value
End Property
Public Sub SendData(ByVal hWnd As Long, ByRef data() As Byte)
Dim cds As COPYDATASTRUCT
cds.cbData = UBound(data) - LBound(data) + 1
cds.lpData = VarPtr(data(0))
SendMessage ByVal hWnd, WM_COPYDATA, ByVal hWnd, cds
End Sub
And finally in Loop
SendData gHwnd, DatAry
2. What is the actual issue, start a .NET thread or communicate with the
ActiveX DLL?
Yes. How do I start the separate thread and send it some data before the
data gathering loop starts.
Galen
"Luke Zhang [MSFT]" <lu******@online.microsoft.comwrote in message
news:Nk**************@TK2MSFTNGXA01.phx.gbl...
Hello Galen,
I think we may first make the question clear, so that we can just be on
the
right track :)
As I understand, you have a VB .NET 2005 winform project and it calls a VB
6.0 ActiveX DLL component. The DLL component will communicate with a
device
to gather data, then send messages to the winform application. In the
Winform application, you need to start a thread to handle these
message/data and display on the form.
But I still have some unclear:
1. How did you send message from ActiveX DLL to winform application?
2. What is the actual issue, start a .NET thread or communicate with the
ActiveX DLL?
Regards,
Luke Zhang
Microsoft Online Community Lead
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)