dbTalk Databases Forums  

Need help converting a function from VB to FoxPro

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss Need help converting a function from VB to FoxPro in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
fdecker
 
Posts: n/a

Default 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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.