Ive created a DLL that, when called, needs to scan files and return information about them as it goes. Basically, my VB program calls my PB DLL , and the DLL should then scan my drive C, and if it finds any files that match the filename, it should use CopyMemory to send a message to my VB exe.
Ive ported this code over from VB ... im sure its about 99.9% correct, but there's something thats not right!
Can somebody please help ?
%WM_COPYDATA = &H4A
DIM cdCopyData AS COPYDATASTRUCT
DIM ThWnd AS LONG
DIM byteBuffer(1 TO 255) AS BYTE
DIM strTemp AS STRING
DIM i AS LONG
DIM JZ AS LONG
' Get the hWnd of the target application
ThWnd = FindWindow("", "My DDE Target")
strTemp = "Hello DDE target!"
' Copy the string into a byte array, converting it to ASCII
JZ = CopyMemory(byteBuffer(1), BYVAL strTemp, LEN(strTemp))
cdCopyData.dwData = 3
cdCopyData.cbData = LEN(strTemp) + 1
cdCopyData.lpData = VARPTR(byteBuffer(1))
i = SendMessage(ThWnd, %WM_COPYDATA, 0)
'Many thanks!
------------------
Ive ported this code over from VB ... im sure its about 99.9% correct, but there's something thats not right!
Can somebody please help ?
%WM_COPYDATA = &H4A
DIM cdCopyData AS COPYDATASTRUCT
DIM ThWnd AS LONG
DIM byteBuffer(1 TO 255) AS BYTE
DIM strTemp AS STRING
DIM i AS LONG
DIM JZ AS LONG
' Get the hWnd of the target application
ThWnd = FindWindow("", "My DDE Target")
strTemp = "Hello DDE target!"
' Copy the string into a byte array, converting it to ASCII
JZ = CopyMemory(byteBuffer(1), BYVAL strTemp, LEN(strTemp))
cdCopyData.dwData = 3
cdCopyData.cbData = LEN(strTemp) + 1
cdCopyData.lpData = VARPTR(byteBuffer(1))
i = SendMessage(ThWnd, %WM_COPYDATA, 0)
'Many thanks!
------------------
Comment