And don't you wish Microsoft and other's could spit out intelligent error 
messages like:



"64-bit application trying to load 32-bit DLL".



I ding my students whey do stupid stuff like:



FILE *fp=fopen(filename,"r");

if (fp == NULL) {

  fprintf(stderr,"Cannot open file\n");

}



Instead of

if (fp == NULL) {

  perror(filename);

}



Which actually tells you what the problem is, permissions, not existing, etc....



It would be so simple for the DLL manager to be able to do this.  But it's the 
same as Microsoft's old error message of "Cannot load dll".  To which I always 
screamed "what DLL and why not!!!!????"



You're just seeing the new version of it.





Michael D. Black

Senior Scientist

NG Information Systems

Advanced Analytics Directorate



________________________________
From: [email protected] [[email protected]] on 
behalf of Joe Mistachkin [[email protected]]
Sent: Friday, July 22, 2011 10:31 AM
To: 'General Discussion of SQLite Database'
Subject: EXT :Re: [sqlite] System.Data.Sqlite problem


Jack Hughes wrote:
>
> The 64 bit version works like a charm but the 32 bit version unfortunately
does not. The error
> message given by test.exe is given at the end of the message. The
BadImageFormatException might
> suggest a bad download... so I've re-downloaded a number of times and the
result with the 32 bit
> version is always the same.
>

This is the expected behavior, let me explain why.

First off, I'm going to assume you downloaded the non-mixed-mode packages.
They both include a native "SQLite.Interop.dll" (for the appropriate
processor architecture) that contains the SQLite core.  They also include a
pure managed "System.Data.SQLite.dll" (marked as "pure IL" in the CLR
header).

When any .NET application marked as "pure IL" runs on 64-bit Windows, it
will run as a 64-bit process.  Similarly, if you run that exact same
application on 32-bit Windows, it will run as a 32-bit process.  A 64-bit
process cannot load a 32-bit DLL.

Therefore, the "test.exe" program starts as a 64-bit process and then
attempts to load the 32-bit "SQLite.Interop.dll", which raises the
BadImageFormatException.

--
Joe Mistachkin

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to