Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting a VB DLL declaration and function
Message
From
19/04/2007 09:51:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
19/04/2007 09:46:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01217662
Message ID:
01217762
Views:
7
>>>Hi Sergey.
>>>
>>>I just found this same function in the VFP9 help file while browsing for pointer related topics :) It does indeed appear to give me the text I want, so thanks for that help.
>>>
>>>However, the text returned is as long as the len parameter specified and hence contains a lot of "garbage". I can SUBSTR() the text on the first chr(0) character of course but I am curious as to how the VB code does that using this byte array and strconv( bytephrase,vbunicode) function. Any ideas?
>>>
>>>
>>>>Assuming that lngStrAddress is a pointer to a string
>>>>
>>>>lcStr = SYS(2600, lngStrAddress, 500)
>>>>
If you're using VFP version tha doesn't have SYS(2600), see How to add/delete custom printer forms under Windows NT/2K/XP FAQ #21202.
>>>>
>>
>>To VB string is not equal to bytearray and thus it generally documents that it might return more data when converted to byte array. Why are you trying to convert to byte array? Probably you're inventing the CreateBinary()?
>>Cetin
>
>Hi Cetin.
>
>I have been trying to convert some VB code to VFP but was not familiar with certain function calls the VB code was making. I seem to be pretty much there now though.
>
>Thanks.

Jos,
Do not try to convert line by line. Check what does it do with it afterwards. One place it had use in VB6 but not in VFP was converting a string to a bytearray to pass to say a VB data object.
It looks like in VB:

RtlMoveMemory( byteArr, string
dataObject.SetData( byteArr, nFormat )

In VFP simply:

dataObject.SetData( CreateBinary( string ), nFormat )

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform