Unable to load DLL 'ace32.dll': The specified module is not found.

We encourage new members to introduce themselves here. Get to know one another and share your interests.
thilef
Posts: 14
Joined: Wed May 26, 2021 5:13 pm

Unable to load DLL 'ace32.dll': The specified module is not found.

Post by thilef »

Hi all,

I try to use some of the ADS X# functions. For example : AdsMgConnect().
An error message occurs at runtime when calling the function :
Unable to load DLL 'ace32.dll': The specified module is not found (Exception de HRESULT : 0x8007007E)

All the ADS dll (ace32, axcws32, etc.. v8.10) are present in the application folder.

The startup application is a C# webservice calling the X# librairy.

Am I missing something in the references or in the properties of the librairy ?
There is no previous call to some other ADS function before AdsMgConnect(), neither dbf opening..
Is there something to call before ?

Similar code was working correctly in Vulcan calling the Ace32.dll directly, prototyping the functions with _DLL FUNC, PSZ and VOSTRUCT parameters, like in VO.
I tried like this in X#, but an System.AccessViolationException : 'Try to read or write protected memory". occurs converting using Strin2Psz() functions.

Thanks for help,

Thierry
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Unable to load DLL 'ace32.dll': The specified module is not found.

Post by robert »

Thierry,

The ADS functions in the XSharp.RDD.DLL do not expect PSZ values. You can send in "normal" .Net strings. We take care of the conversion to the Ansi strings internally.

Can you show the code from which you are calling the function ?
And is your Webserver running in 32 bits or 64 bits mode ?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Unable to load DLL 'ace32.dll': The specified module is not found.

Post by ic2 »

Hello Thierry,

Do you use

Code: Select all

ACE.AdsMgConnect
(See https://devzone.advantagedatabase.com/d ... onnect.htm)

You also might want to read this, some ADS methods are not available in the X# runtime, Chris wrote there how to accesss these.

https://www.xsharp.eu/forum/public-prod ... ll-s#17922

Dick
thilef
Posts: 14
Joined: Wed May 26, 2021 5:13 pm

Unable to load DLL 'ace32.dll': The specified module is not found.

Post by thilef »

Robert,

Thanks for your answer.
I saw that strings are now expected in X# rather than psz in VO. My remark about psz was about additional tests I did to deal directly with Ace32.dll with my own Ads functions, not those from X#.

The application is running in 32 bits. I sent you a small solution with only few lines of code in 2 projects to reproduce the problem. The webservice has only one method returning some environment informations and the error message catched when calling the X# AdsMgConnect() in the X# project.

Thanks again,

Thierry
Attachments
Webservice Test XSharp.zip
(4.09 MiB) Downloaded 107 times
thilef
Posts: 14
Joined: Wed May 26, 2021 5:13 pm

Unable to load DLL 'ace32.dll': The specified module is not found.

Post by thilef »

Hi Dick,

Thanks for your help.
The AdsMgConnect() method is available in the XSharp.rdd module. My project compiles without any error. The problem occurs at runtime and the message show that ace32.dll was not found, even if the file is present in the application folder.

Thierry
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Unable to load DLL 'ace32.dll': The specified module is not found.

Post by robert »

Thierry,

When I run your test in the debugger then the call to the AdsMgConnect works and returns the number 5033.
That correspondents to the error message "Error 5033: No connected server was found for the given drive letter."

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
thilef
Posts: 14
Joined: Wed May 26, 2021 5:13 pm

Unable to load DLL 'ace32.dll': The specified module is not found.

Post by thilef »

Robert,

Thanks for your test.
It works also for me when I copy ace32.dll in a search path, for example c:Windows.
As if X# was not looking the dll in the application folder..
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Unable to load DLL 'ace32.dll': The specified module is not found.

Post by robert »

Thierry,

You will have to have the ace32.dll and the other support dlls in the search path or in the folder where the webservice runs.
X# does nothing special w.r.t. the ace32.dll.
It has marked the function calls as an imported native functions from a native dll and that is it.
The rest is handled by the .Net framework.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
thilef
Posts: 14
Joined: Wed May 26, 2021 5:13 pm

Unable to load DLL 'ace32.dll': The specified module is not found.

Post by thilef »

Robert,

This is very strange. The ace32.dll is present in the folder where the webservice runs. In the result of the webmethod, you can see the AppPath property which is the folder returns by : Path.GetDirectoryName(Assembly.GetAssembly(typeof(WebServiceTest)).CodeBase).
Then the property IsAce32dll returning if the ace32.dll is present in this folder (File.Exists(...)).

By digging a little more, it seems that the XSharp.rdd.dll referenced on the project is loaded from the GAC folder :
c:WindowsMicrosoft.NETassemblyGAC_MSILXSharp.Rddv4.0_2.6.0.0__ed555a0467764586)
but not from the folder where the webservice is run, despite the "CopyToLocal=True" in the Reference properties.

When the ADS dll is copied in the XSharp.rdd.dll GAC folder, the problem disapears.

As I have a workaround with a search path, I will be able to go further in my development. Hope the same problem will not appear in the release version.

Thanks again for your help,

Thierry
User avatar
robert
Posts: 4518
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Unable to load DLL 'ace32.dll': The specified module is not found.

Post by robert »

XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply