-
July 4th, 2012, 02:13 PM
#1
DLL problem on some machines
Hi, I'm having some problems with a very small app that uses a third party DLL. I can run the app on my computer (Windows 7, 32 bits), and could run it on several XP's, but on other windows 7 computers, the app won't run. I get a "The application stopped working" message, and then it closes. The problem is, I get no exception or anything, so I don't know what is causing the crash (at first glance). I tried putting MessageBox's before the first use of the DLLs resources and it crashes just after that.
Code:
MessageBox.Show("So far so good");
DllClassObject Object1 = new DllClassObject(); // This causes the crash
MessageBox.Show("This message will only show on XPs or my machine's Win7...");
Object1.Methods(...);
Every machine I tried this on has the original third party complete software installed so the libraries are correctly registered. And besides, I also put the dll file in the same directory as the exe, so (as far as I know) it should look for it there when needed right?
Is there anything else I can do? How can I fix this?
Thank you for reading.
-
July 5th, 2012, 04:28 AM
#2
Re: DLL problem on some machines
It might be that some other dll is missing on those machines, the correct MSVC runtime for instance. Use Dependency Walker http://www.dependencywalker.com/ to find out if that's the case.
-
July 5th, 2012, 07:33 AM
#3
Re: DLL problem on some machines
Hi SMA, I would doubt that very much, since I have the original third party complete app already installed and working on the machines, and a second application we developed that also uses that library (written in Delphi) that also works ok. It's my C# app that crashes, and only on Win 7 machines, EXCEPT mine!! =)
As for MSVC, should I really need that if I'm not intending to develop on that machine? I only want to run the app. It would be a pain to have to install it on the end-user's machine.
-
July 5th, 2012, 07:55 AM
#4
Re: DLL problem on some machines
It sounds like the .dlls that are causing the issues may be built for 32 bit OS's. When you build your application, are you building with "Any CPU" If so, what is happening is most likely this. On a 32Bit system, (XP) the application you built is run in 32bit mode and the .dll's you are linking to, work fine. On a 64bit system, your application starts in 32bit mode on your machine, and all runs fine. However, if it is run on a 64Bit system, the .dll signatures won't work and your application crashes.
Try building your application for "X86".
-
July 5th, 2012, 08:42 AM
#5
Re: DLL problem on some machines
I have compiled x86 and x64 versions of the software, and tried it in both 32 and 64-bit machines.
The 32bit version run on a both 32 and 64 bit windows will "Stop working", and the 64bit version run on a 64bit windows crashes with a cryptic error message on the same line.
The 64bit version run on a 32bit won't even start, naturally.
-
July 5th, 2012, 08:45 AM
#6
Re: DLL problem on some machines
And I'm using Framework 4.0 - installed on the machines. Actually the app starts ok, I can use some functions of it. But when I press a button that would make use of the DLL methods and objects, I get the crash.
-
July 5th, 2012, 09:08 AM
#7
Re: DLL problem on some machines
Also you may want to check the DLL on the target machine with DependencyWalker. Here is the link:
http://www.dependencywalker.com/
It will give you the names and the prototypes of the API calls as well as some other useful debugging information. See if #1 the funtions changed...possibly their names.
ahoodin
To keep the plot moving, that's why.
-
July 5th, 2012, 10:03 AM
#8
Re: DLL problem on some machines
Yes, S_M_A's post mentioned that already, but again, I have 2 other applications that make use of the library and they work! As far as I know, there is no "app-specific" dll registering, so if they use it, everyone can.
Running DLL Walker on the file, I get this message on my machine (where the app IS working)
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
No DLL files are marked with warning symbols, the application works fine.
Running DLL Walker on an XP machine, I get a warning symbol for WER.DLL, yet the app works fine!!!
Running DLL Walker on a Win7 machine, I got a warning symbol for IEShims.dll. I copied the file to ..\Windows\System32\ and the warning symbol disappeared, but the app still would not work.
Needless to say I feel a bit frustrated. Perhaps I'm not reading the DLL Walker interface correctly...? What am I looking for in case there is a problem with my DLL?
-
July 5th, 2012, 08:48 PM
#9
Re: DLL problem on some machines
Code:
try
{
DllClassObject Object1 = new DllClassObject(); // This causes the crash
Object1.Methods(...);
}
catch( Exception ex )
{
MessageBox.Show( String.Format("Help me figure this out: {0}", ex.Message );
}
-
July 6th, 2012, 06:50 AM
#10
Re: DLL problem on some machines
I'm already doing that, and no exception gets caught =(
The app just stops, a message shows with "The Application stopped working, Windows is trying to find a solution bla bla" and then it quits.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|