Discussion:
Delcare DLL caused an exception
(too old to reply)
JP
2006-01-25 06:04:41 UTC
Permalink
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
2006-01-25 14:32:32 UTC
Permalink
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!
Post by JP
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.
Fred Taylor
2006-01-25 15:31:10 UTC
Permalink
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
Post by Rick Bean
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!
Post by JP
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
2006-01-25 20:25:02 UTC
Permalink
Fred,
There is no Security tab on this .DLL (it's enumproc.dll that I got from the
UT).

Rick
Post by Fred Taylor
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
Post by Rick Bean
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!
Post by JP
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.
Fred Taylor
2006-01-26 06:33:22 UTC
Permalink
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
Post by Rick Bean
Fred,
There is no Security tab on this .DLL (it's enumproc.dll that I got from
the UT).
Rick
Post by Fred Taylor
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
Post by Rick Bean
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!
Post by JP
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.
Christian Ehlscheid
2006-01-26 13:17:14 UTC
Permalink
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.
Post by Rick Bean
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.
Post by Rick Bean
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

Lee Mitchell
2006-01-25 15:44:36 UTC
Permalink
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
Post by JP
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
2006-01-25 20:28:37 UTC
Permalink
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
Post by Lee Mitchell
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!! --*
http://msdn.microsoft.com/vfoxpro/
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr
http://support.microsoft.com/gp/lifeselectindex
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003
Post by JP
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.
Leonid
2006-01-25 16:23:54 UTC
Permalink
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
Post by JP
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.
Olaf Doschke
2006-01-25 17:13:51 UTC
Permalink
Post by Leonid
a=replicate(chr(0),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
2006-01-25 20:31:20 UTC
Permalink
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
Post by Leonid
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
a=replicate(chr(0),4)
Leonid
Post by JP
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.
Loading...