Need help converting a function from VB to FoxPro -
06-02-2005
, 05:19 PM
Hi, I wrote the folowing in VB and it works perfectly in VB. I'm not
a FoxPro guy, but trying to convert something for a client and the
syntax is killing me. Can anyone look at what I've tried and help fix
the syntax? Thanks!
-------- VB6 -----------------
Private Declare Function SysAllocStringByteLen Lib "oleaut32" (ByVal
lpString As Long, ByVal lLen As Long) As String
Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal
lpString As Long) As Long
Private Function PtrToVBString(ByVal lPointer As Long) As String
PtrToVBString = SysAllocStringByteLen(lPointer, lstrlen(lPointer))
End Function
Text2.Text = PtrToVBString(myPointerStructure)
-------- FoxPro ?? --------------
Are all the strings and integers there? What about use of "@" in these
functions?
Declare String SysAllocStringByteLen in oleaut32;
Integer lpString,; && these are longs, what are they in FP?
Integer lLen
Declare Integer lstrlen In kernel32 as lstrlenA; && returns a long
Integer lpString && int or string in FP?
FUNCTION PtrToVBString && can't get this to work at all
LPARAMETERS lPointer
retval = SysAllocStringByteLen(lPointer, lstrlen(lPointer))
RETURN(retval)
ENDFUNC
I get a "methods and events cannot contain nested procedure..." error
in the actual function. Thanks.
Fred |