Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Delcare DLL caused an exception

971 views
Skip to first unread message

JP

unread,
Jan 25, 2006, 1:04:41 AM1/25/06
to
I'm running code that does some FTP function calls. Odd thing the program
works at home but on this other PC it generates this error "Declare DLL
caused an exception". I haven't seen much documentation on this error
message.

Help! I'm not sure where to start.


Rick Bean

unread,
Jan 25, 2006, 9:32:32 AM1/25/06
to
JP,
I just started getting this error on a DLL that we've been using for years! Now
I get that error almost always - very strange.

Program Error
Declare DLL call caused an exception.

Cancel Suspend Ignore Help

I've been speculating that it's XP SP2, one of the many security patches or .NET
2.0, since that is all that has changed on my system. Luckly our users haven't
started complaining yet.

Rick

P.S. I'm also looking forward to someone coming up with the real problem and a
consistant solution!

"JP" <Z...@Z.com> wrote in message news:EIqdnXgh75Z...@gvtc.com...

Fred Taylor

unread,
Jan 25, 2006, 10:31:10 AM1/25/06
to
Have you tried checking the security tab by right clicking on the .DLL file
itself in Explorer and seeing if you need to change the access? Right
click/Properties/Security tab.

--
Fred
Microsoft Visual FoxPro MVP


"Rick Bean" <rgb...@unrealmelange-inc.com> wrote in message
news:uKqh5ub...@TK2MSFTNGP12.phx.gbl...

Lee Mitchell

unread,
Jan 25, 2006, 10:44:36 AM1/25/06
to
Hi JP:

I don't know what is going on here, but I will offer some ideas.

Is the DLL the same version on both machines? Download Dependency Walker
(http://www.dependencywalker.com/) and look at the dependencies files on
both machines. You might have a different version of a file on your home
machine when compared to the other PC.


I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/

*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003

Leonid

unread,
Jan 25, 2006, 11:23:54 AM1/25/06
to
Error "Declare DLL caused an exception" indicates that DLL procedure try to
access protected memory. One of the most common reasons is wrong passed
parameters, but also may be others. Here is a simple example

declare RtlMoveMemory in Win32API String @st, Integer, Integer
a=replicate(chr(0),4)
RtlMoveMemory(@a,1024*1024-16,4)

Leonid

"JP" <Z...@Z.com> wrote in message news:EIqdnXgh75Z...@gvtc.com...

Olaf Doschke

unread,
Jan 25, 2006, 12:13:51 PM1/25/06
to
> declare RtlMoveMemory in Win32API String @st, Integer, Integer
> a=replicate(chr(0),4)
> RtlMoveMemory(@a,1024*1024-16,4)
True.

You can also get this error, if you use some GDI+ function
before you initialized GDI+ with GdiplusStartup(...).

This may also end up reading or wrinting to protected
memory, but the reason in this case is wrong use of the DLL...

Bye, Olaf.


Rick Bean

unread,
Jan 25, 2006, 3:25:02 PM1/25/06
to
Fred,
There is no Security tab on this .DLL (it's enumproc.dll that I got from the
UT).

Rick

"Fred Taylor" <fta...@mvps.org!REMOVE> wrote in message
news:elQXfRcI...@TK2MSFTNGP09.phx.gbl...

Rick Bean

unread,
Jan 25, 2006, 3:28:37 PM1/25/06
to
Lee,
In my case it's the same machine, and it doesn't seem to depend on anything I've
figured out yet. Once I ran three times in a row, then I couldn't get it to work
again until I rebooted. I've checked, and I've only got one version of this DLL
on the system, so I can't see how it could be the "DLL Hell" problem. (One
version running when you want to use another.)

Rick

"Lee Mitchell" <Le...@online.microsoft.com> wrote in message
news:imGyBZcI...@TK2MSFTNGXA02.phx.gbl...

Rick Bean

unread,
Jan 25, 2006, 3:31:20 PM1/25/06
to
Leonid,
Unfortunately in my case there are no parameters for this procedure call. It's
just used to set up other calls to procedures in the .DLL.

Rick

"Leonid" <leo...@NOgradaSPAM.lv> wrote in message
news:OOUj9ucI...@TK2MSFTNGP14.phx.gbl...

Fred Taylor

unread,
Jan 26, 2006, 1:33:22 AM1/26/06
to
Really? I've yet to see a .DLL that didn't have the tab (it's Windows
driven). Then again, I've certainly not checked them all out. ;)

--
Fred
Microsoft Visual FoxPro MVP


"Rick Bean" <rgb...@unrealmelange-inc.com> wrote in message

news:%23A9K4ze...@TK2MSFTNGP09.phx.gbl...

Christian Ehlscheid

unread,
Jan 26, 2006, 8:17:14 AM1/26/06
to
Hi,

the enumproc.dll comes with sourcecode,
just load the project into Visual Studio and build a debug version.

Set a breakpoint on the the first line of the "OpenProcList" function
Hit F5 to start debugging, select vfp9.exe as the debugging executable.
In VFP, change the current directory to "pathtoenumprocsource\debug", so
the debuggable version of the DLL is found.
DECLARE the functions and call OpenProcList from the Command window. The
debugger will come to the foregroud and then you can step through the
code to see where the real problem is.

>>> I've been speculating that it's XP SP2, one of the many security
>>> patches or .NET 2.0, since that is all that has changed on my system.

I could run the OpenProcList function on my XP machine with all
currently available patches + .NET 2.0 framework installed just fine.

I don't believe that it has anything todo with security patches nor the
NET framework.

>>> P.S. I'm also looking forward to someone coming up with the real
>>> problem and a consistant solution!

You can only find out yourself by debugging it.

Regards
Christian


0 new messages