Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending VFP arrays to/from C++?
Message
From
30/08/1999 20:48:31
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00258437
Message ID:
00259462
Views:
29
>Hey Christof. Thanks for the info on the struct.zip. I've been looking at it. Some good stuff in there! The DLL I am talking about is a plain procedural DLL. The problem I am faced with is basically this: I need to manipulate a long string in various ways as fast as possible. VFP hasn't been able to meet the benchmarks I was shooting for, so I figured creating a similar function in C++ might improve performance. Ultimately, the modfied string will be moved to a VFP array. I am concerned if I manipulate the string in C++ and return it to VFP only to have VFP move that string into an array performance will once again suffer. Perhaps a better solution would be to pass a VFP array to C++ and allow it to populate the array. All I really need to do this is a byte-map of how VFP stores arrays. Do you know of any resources for this sort of thing?

From my experience, VFP is almost as fast as C/C++ on string manipulation (and consider that C++ is usually faster than C! Using the MFC-CString or the STL-string classes is usually faster than manipulating plain char*!!). Unless you have something really weird, if you do it properly in VFP you'll be able to obtain almost the same (within 2-3%) speed. So, my advice is to see first if you can do it faster in C++.

Basically, you don't need to pass an array. Just pass your string by reference. VFP will pass only the pointer to your string, so, only 4 bytes. Being passed by reference, you can modify the string inside you dll functions.

Vlad
Previous
Reply
Map
View

Click here to load this message in the networking platform