Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Loading a non 64-bit PLUGIN .dll

Aug
2,799
144
When I accidentally attempt to load a non 64-bit PLUGIN .dll using the PLUGIN /L command in TCC,
that is,
I accidentally attempt to load a 32-bit PLUGIN .dll,
I receive the following error message;

Code:
U:\>plugin /l FileUtils-x86.dll
TCC: (Sys) The specified module could not be found.
 "Could not load file or assembly '495104 bytes loaded from TC-DotNetPluginHost64, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."

U:\>plugin /l 4console.dll
TCC: (Sys) The specified module could not be found.
 "Could not load file or assembly '73216 bytes loaded from TC-DotNetPluginHost64, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."

U:\>
In TCC/LE 14 (32-bit), when attempting to load a non-32-bit PLUGIN .dll,
I receive the following error message;

Code:
[U:\]plugin /l FileUtils.dll
TCC: (Sys) FileUtils.dll is not a valid Win32 application.

I would like to suggest that a cleaner error message be output for the PLUGIN command in TCC x64,
stating that the plugin is 32-bit,
or something along that line.

Yes, I could check before loading a PLUGIN in TCC x64,
Code:
U:\>echo %@exetype[fileutils.dll]
9

U:\>echo %@exetype[FileUtils-x86.dll]
6

...but hoping that this can be added to a cleaner error message.

Joe
 
I would like to suggest that a cleaner error message be output for the PLUGIN command in TCC x64,

The error-code from LoadLibrary() would be ERROR_BAD_EXE_FORMAT (= 193).
Would be trivial to add a custom error-text for such a common mistake.
 
While no longer being updated,
TCC/LE 32-bit is still available for download from JPSoft.

Ref: https://jpsoft.com/downloads/v14/tccle.exe

I still use 32-bit TCC LE 14.00.9 on Windows 10 [Version 6.3.19045],
with the plugins I developed using PowerBASIC 10,
which I did not bother to re-write using 64-bit PureBasic.

I use many of the plugins developed and updated by Charles Dye.

Charles includes 32-bit and 64-bit versions of his plugins with each release.

For example, the FileUtils plugin;
Ref: FileUtils Plugin

1788707688156.webp


Thus, I use the plugins developed by Charles Dye in both

TCC 36.52.88 x64 Windows 10 [Version 10.0.19045.7663]

and


32-bit TCC LE 14.00.9 Windows 10 [Version 6.3.19045]

Thankfully, Charles recognizes that not everyone has left the 32-bit world behind.

Joe
 
So is 4DOS, but I'm not supporting either of them ...
I'm not asking you to support TCC/LE.
I'm not asking you to support 4DOS.

I'm asking for a clearer error message when the PLUGIN command in TCC v36 attempts to load a 32-bit TCC plugin.

This is not a clear error message;
Code:
U:\>plugin /l FileUtils-x86.dll
TCC: (Sys) The specified module could not be found.
 "Could not load file or assembly '495104 bytes loaded from TC-DotNetPluginHost64, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."

U:\>plugin /l 4console.dll
TCC: (Sys) The specified module could not be found.
 "Could not load file or assembly '73216 bytes loaded from TC-DotNetPluginHost64, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."

U:\>

Joe
 
Back
Top