Send an string from C++ to Visual basic?

patiferoolz

New member
Joined
Sep 30, 2003
Messages
1
Im trying to pass a string from a DLL i made in C++ to visual basic .net. Im using SendMessage for that, cause i dont wanna mess with interop (i tried.. but its too bulky). I pass the string address, and try to get its contents in VB with CopyMem but i cant get it to work.

Declaration:
Code:
    Private Declare Sub CopyMem Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As String, ByVal Source As Integer, ByVal Length As Integer)

then:
Code:
            CopyMem(String, lpString, nLen)

where lpString is the string address, nLen its length (both passed with SendMessage and caught with WndProc successfully. Any ideas? See that i declare Destination ByRef and Source ByVal. Other ideas of sending strings from C++ to visual basic are welcome :) Too bad Visual Basic .NET lost its built in DDE support.. would make things much easier :(
 
Back
Top