Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending VFP arrays to/from C++?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00258437
Message ID:
00259558
Views:
18
Hi Michael,

First of all, a C++ DLL cannot manipulate an array directly. Even a FLL can only do so by calling certain functions (_Load) to request a structure that helds one array element. There's no way to quickly copy a block of memory to some location and have VFP treat this block as an array.

Second, one of the slowest part in VFPs access to DLL functions is the function call. A FLL function call, for example, is not significantly faster than a call of a user defined function. IOW, in order to speed up a process with a DLL/FLL you have to reduce the number of calls to the DLL, best is having one call that does anything.

My Struct class is definitely not a solution if speed is an issue. Internally, the structure is translated to a collection of member objects. Every time you create the string, a method in each of the member objects is executed. For arrays these member object perform the conversion for each array member. With string pointers this involves memory handling for each element, and so on. I wrote it with the ease of use in mind, not to break speed records.

Let's approach your problem in a more systematic way... What kind of string do you have, and where do you have this string, in a VFP variablem, is it stored at a memory address, is it in a memo field? How do you have to process the string? "Various ways" is a pretty vague statement. Why do you have to move this string into a VFP array? Do you have to do some further analysis, do you want to store this array in a MEM file? And how do you store this string into the array? One string makes one element, or, as I assume, do you break up the string. In this case, how do you do this?

If you can give us more details, we'll probably can give you a more approriate answer, because I think, the actual problem is not passing an array to a DLL.

Christof
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform