-
May 24th, 2021, 09:53 AM
#1
Thread Starter
Member
Unable to load DLL
I have been documentation for a project in C++.
I'm trying to write it in VB.Net.
The project contains a DLL - FriDll.dll
I have the following code:
Code:
Declare Function FriDllVersion Lib "FriDll.dll" Alias "DllVersion" () As Integer
and
Code:
MsgBox(FriDllVersion)
I just (initially) want to display the dll version number to check I can call the dll.
But I get the message 'Unable to load DLL'
I have added the dll to the System32 folder, to the project debug folder, to the project using 'add Existing' - but still get the same error.
Looking at similar questions I have run the Dependency Walker - but wasn't sure if it showed anything missing.
Any ideas?
Thank you.
-
May 24th, 2021, 11:26 AM
#2
Re: Unable to load DLL
Have you attempted to load it as a reference?
-
May 24th, 2021, 01:47 PM
#3
Re: Unable to load DLL
Originally Posted by DavidGraham
I have been documentation for a project in C++.
I'm trying to write it in VB.Net.
The project contains a DLL - FriDll.dll
I have the following code:
Code:
Declare Function FriDllVersion Lib "FriDll.dll" Alias "DllVersion" () As Integer
and
Code:
MsgBox(FriDllVersion)
I just (initially) want to display the dll version number to check I can call the dll.
But I get the message 'Unable to load DLL'
I have added the dll to the System32 folder, to the project debug folder, to the project using 'add Existing' - but still get the same error.
Looking at similar questions I have run the Dependency Walker - but wasn't sure if it showed anything missing.
Any ideas?
Thank you.
Is the DLL compiled as 32 or 64 bit? Is your VB app configured the same? Does the DLL have any other dependencies that might be missing from the system?
-
May 24th, 2021, 05:37 PM
#4
Re: Unable to load DLL
Since this is a C++ dll I'm not sure that what I suggest will work but you can try to use the System.Diagnostics.FileVersionInfo to display the dll version number
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
May 25th, 2021, 03:09 AM
#5
Thread Starter
Member
Re: Unable to load DLL
Originally Posted by dday9
Have you attempted to load it as a reference?
Yes, It says 'a reference to ..... could not be added'.
-
May 25th, 2021, 03:10 AM
#6
Thread Starter
Member
Re: Unable to load DLL
Originally Posted by sapator
Since this is a C++ dll I'm not sure that what I suggest will work but you can try to use the System.Diagnostics.FileVersionInfo to display the dll version number
The call to the version number is just one (simple) example of the calls I would like to make.
-
May 25th, 2021, 03:13 AM
#7
Thread Starter
Member
Re: Unable to load DLL
Originally Posted by PlausiblyDamp
Is the DLL compiled as 32 or 64 bit? Is your VB app configured the same? Does the DLL have any other dependencies that might be missing from the system?
I'm not sure if it is compiled as 32 or 64 bit.
-
May 25th, 2021, 03:18 AM
#8
Thread Starter
Member
Re: Unable to load DLL
Originally Posted by PlausiblyDamp
Is the DLL compiled as 32 or 64 bit? Is your VB app configured the same? Does the DLL have any other dependencies that might be missing from the system?
Looking again at the Dependency Walker it gives a big list of dependencies not found - the list was so big I wasn't sure what to do.
It says:
API-MS-WIN-CORE .....
API-MS-WIN-EVENTING-PROVIDOR .....
API-MS-WIN-SECURITY .....
EXT-MS-ONECORE....
etc.
Any ideas if I should be including some other references?
-
May 25th, 2021, 06:55 AM
#9
Re: Unable to load DLL
Originally Posted by DavidGraham
Looking again at the Dependency Walker it gives a big list of dependencies not found - the list was so big I wasn't sure what to do.
It says:
API-MS-WIN-CORE .....
API-MS-WIN-EVENTING-PROVIDOR .....
API-MS-WIN-SECURITY .....
EXT-MS-ONECORE....
etc.
Any ideas if I should be including some other references?
Where is this dll from? Is it something developed internally or is part of a 3rd party system? Is it normally installed as part of another package or application?
-
May 25th, 2021, 09:02 AM
#10
Thread Starter
Member
Re: Unable to load DLL
Originally Posted by PlausiblyDamp
Where is this dll from? Is it something developed internally or is part of a 3rd party system? Is it normally installed as part of another package or application?
It has been developed by a 3rd party and I'm trying to run it. There were instructions on how to include it in a C++ application but not for VB.Net. Looking at the documentation it looks to be 'stand alone'.
-
May 25th, 2021, 08:05 PM
#11
Addicted Member
Re: Unable to load DLL
Just for reference if the library is 64 bit it would normally be found in System32 folder or if it is 32 bit then found in SysWOW64 folder. Whichever folder the dll is placed perhaps try specifically targeting x64 or x86 rather than targeting AnyCPU within the VB app properties.
-
May 26th, 2021, 10:59 AM
#12
Thread Starter
Member
Re: Unable to load DLL
Some have suggested using dllImport - but it is not compiling
Code:
<DllImport("FRI.dll", CharSet:=CharSet.Auto, SetLastError:=True)>
I cannot work out what the syntax should be.
Following I also have:
Code:
Declare Function FriDllVersion Lib "FriDll.dll" Alias "DllVersion" () As Integer
Declare Function FriDllBuild Lib "FriDll.dll" Alias "DllBuild" () As Integer
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
|