Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a C++ DLL to use with FoxPro
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00048334
Message ID:
00051555
Views:
87
>After executing the program a few times. The first loop takes a total of 0.62secs and the second takes 0.20 seconds. This is a little slower than previous because I have since modified the COM date class and it is now updating two strings evertime you set the date!

Interesting. Internal speed will be fast - the calling interface to COM is what'll
be a little slower than a local object call I would guess. Again, I'm guessing.
I haven't really bothered with COM objects for use in VFP - I usually write
DLLs to this for me since it's a slam dunk that only takes a few minutes.

>
>Thanks for the correction. However, I have a related question. I have read about the allocation of memory from a local memory pool and a shared memory pool. If I understand correctly, the COM object can allocate memory from its own local memory pool, or can use a shared memory pool for passing parameters between the COM object and the client. If the COM object is in-process what is the name of the thing that the memory is local to or shared between?

If you allocate memory in the COM method call you have to clean it up. If you
pass back the buffer to VFP in anything other than a BSTR value you're responsible
for cleaning up the memory. BSTR's are OLE strings and they have built in reference
counting. When the pointers are all used up the memory gets released automatically.
If this weren't the case it'd be a bitch to call any method that returns a string,
since you'd have to make another call to clean up the string.

This is the reason that DLL functions typically require you to pass in a buffer
that's presized and gets filled. This is clearly one aspect where COM makes
use of the object a little easier since you don't have to presize anything.

>I noticed you posting on msnews.public.adc, maybe you can enlighten me. Am I guessing correctly that the next version of VFP is likely to be released with the latest version of ADO (RDS) and we will be able to bind user interface controls to field objects?

I don't have time today to get into this, but repost it under a new thread addressed
to me and I'll be glad to comment on it over the next few days. There are a couple
of interesting developments and somethings that you can do today without RDS...
(Ask Michel <s>...)

+++ Rick ---
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform