Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New VB Features
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00425458
Message ID:
00425959
Vues:
20
>>>I don't think that there's anything particularly difficult about it's implementation. It's pretty much of a universal construct in the higher level languages implemented on a PC (Pascal, C, C++, MS Basic at least as far back as QB3, Modula 2, etc.). Rather it may be a matter of utility. Since VFP plays around with its internal memory allocation so much, pointers would be extremely difficult to implement, so they might cause a problem, which in turn further limits the utility. However, of the top of my head, I can think of a bunch of structures required by API calls that don't involve pointers, and the structures are simply a section of contiguous memory.
>>
>>The problem is pointers and the storage of strings (the only thing usable in VFP to create structures); VFP's loose typing requires multiple indirections of storage references via something called the NTI, and during VFP's memory management, storage is often rearranged, with the net result that any pointer created prior to the reshuffling is probably invalid. As a result, there's no 'simple' method of creating and maintaining a structure in fixed locations in VFP-managed memory - that's where something like CLSHeap or STRUCT come into play; both allocate blocks of memory not managed by VFP's manager, and can then return pointers to these blocks safely (as integers).
>
>Oh, I understand this. However, it would seem that if we can use a string to simulate things like a WIN32_FIND_DATA with embedded FILETIME structures or a BITMAPINFO (with its BITMAPINFOHEAD and RGBQUAD structures), then creating a construct that would allow us to do away with all the associated string functions required would be doable. Or am I completely missing something here?

You can embed a structure within a structure with no problem; it's when there's a pointer to a structure embedded in the structure that the problem occurs. As long as everything 'fits' inside the block of memory, and does not require that you treat the reference as a linear memory address, the problem doesn't exist. It's when the reference is to a location, even if it's withoin the same block - move the block, and the pointer doesn't change values.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform