Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DECLARE DLL problem
Message
From
16/11/2001 14:02:35
 
 
To
16/11/2001 12:52:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00580332
Message ID:
00582876
Views:
47
>>>>>Cetin and Ed:
>>>>>
>>>>>With your help now this code is working. But sometimes DoubleToNum function provokes C000005 error.
>>>>>
>>>>>Indeed I am forgetting something.
>>>>>
>>>>>Alejandro Fernandez
>>>>Alejandro,
>>>>Are you sure it's DoubleToNum invoking C000005 ? Might it something else with DLL.
>>>>Cetin
>>>
>>>I found this error tracing the source with SET STEP ON.
>>
>>That will happen if the address in memory is not valid; either it's non-existant, or you do not have read privileges for the address. Check the value of the pointer - some people's implementation of the DWORDToNum() UDF is subtly flawed, since VFP treats a 4 byte integer as a value between -2147483647 to 2147483647, not 0 to 4294967295.
>
>C000005 error appear sometimes when and UDF is called too. It's not always in DoubleToNum function. Sometimes calling my DLL provokes the same error.

It's a memory management error of some sort - if you're using VFP 6, ensure that you've upgraded to at least SP3, and preferably to SP6 or later. AFA UDFs, the functions included in ClsHeap are well-behaved, and do proper casting of elements, so if you've rolled your own, investigate using the ones in the current public release of ClsHeap, available on UT or my web site.

>
>I had thought to check pointer in order to avoid it, but I don`t know exactly what function to use here.
>

Depending on what the pointer is being used for (read/write/execute) there are a whole series of pointer validation APIs; see the MSDN Platform SDK docs.
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
Previous
Reply
Map
View

Click here to load this message in the networking platform