I have created my own ActiveX EXE now...I have subclassed a form in this...
And I have the following in a standard EXE:
Now...while in design mode and running the active x exe app from the IDE I can SendByte Array to the activeX...this isn't a problem...however...if I compile the ActiveX EXE then run the above code the SendByte array function fails...the ActiveX doesn't even pick up the custom message, and so ALWAYS returns a 0 for the pointer value, however, the POSTMessage does work...but I need SendMessage...VB Code:
Public Function SendByteArray(ByVal hWnd As Long, ByVal ByteArray As String) As Long Dim lngRet As Long marBuffer = ByteArray With mudtStruct .Length = UBound(marBuffer) + 1 .Pointer = VarPtr(marBuffer(0)) End With SendByteArray = SendMessage(hWnd, CUSTOM_MESSAGE, GetCurrentProcessId, mudtStruct) Erase marBuffer End Function Public Sub PostByteArray(ByVal hWnd As Long, ByVal ByteArray As String) marBuffer = ByteArray With mudtStruct .Length = UBound(marBuffer) + 1 .Pointer = VarPtr(marBuffer(0)) End With Call PostMessage(hWnd, CUSTOM_MESSAGE, GetCurrentProcessId, VarPtr(mudtStruct)) End Sub
Why is this?
Woka




Reply With Quote