insure msvbvm60.dll is installed and Try This
Private Declare Function VarPtr Lib "msvbvm60.dll" Alias "VarPtr" (ByVal lpObject As String) As Integer
Function StrPtr(ByVal x As String) As Integer
Return VarPtr(x)
End Function
Or see:
http://www.codeproject.com/KB/vb/Marshal.aspx
it explain code like:
Dim MyString As String = "Adnan Samuel"
Dim gh As GCHandle = GCHandle.Alloc (MyString, GCHandleType.Pinned)
Dim AddrOfMyString As IntPtr = gh.AddrOfPinnedObject()
Console.WriteLine (AddrOfMyString.ToString())
gh.Free()