473,788 Members | 2,868 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dllImport unable to load DLL

I have my own win app developed in VS C# 2005.
This app uses a dll file (I import methods from the library by dllimport
attribute).
The dll file is provided by another program (let's call it program AA) that
is installed on my computer.When I put my app into the folder where program
AA is installed my app works ok (in this case only!). When I put my app into
any other folder (e.g desktop) I am getting error: unable to load dll. I am
getting that error even if I put provided dll with my app file.
I have checked PATH variable - it points out the folder with AA program.
But my app still does not work. Why?
Jun 27 '08 #1
4 2941
"Chris" <Ch***@discussi ons.microsoft.c omwrote in message
news:F8******** *************** ***********@mic rosoft.com...
>I have my own win app developed in VS C# 2005.
This app uses a dll file (I import methods from the library by dllimport
attribute).
The dll file is provided by another program (let's call it program AA)
that
is installed on my computer.When I put my app into the folder where
program
AA is installed my app works ok (in this case only!). When I put my app
into
any other folder (e.g desktop) I am getting error: unable to load dll. I
am
getting that error even if I put provided dll with my app file.
I have checked PATH variable - it points out the folder with AA program.
But my app still does not work. Why?

Possibly because there are other dll's *the* dll depends on!

Willy.

Jun 27 '08 #2
I do not think so. I have checked in Dependency Walker.
Moreover, that happens on one machine only. On any other computers that
works fine.
Jun 27 '08 #3
"Chris" <Ch***@discussi ons.microsoft.c omwrote in message
news:11******** *************** ***********@mic rosoft.com...
>I do not think so. I have checked in Dependency Walker.
Moreover, that happens on one machine only. On any other computers that
works fine.

"dependency walker" will not tell you anything about dynamically loaded
modules. Point is, the application fails to load a module, to find out witch
one, load the program in the debugger and check the modules loaded when it
works.
Willy.
Jun 27 '08 #4
"Willy Denoyette [MVP]" wrote:
"... load the program in the debugger and check the modules loaded when it
works."

Ok, sounds good. The problem happens on a remote machine. Can use remote
debugging?
Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2563
by: mike | last post by:
I have a form that uses a C++ dll through DLLImport. Then I created a new project and had Form1 inherit the DLL form. I can run it without problem, but I cannot open the derrived form in the form designer because I get a message "An exception occurred while trying to create an instance of DLLForm.ControlForm. The exception was "Unable to load DLL (TestDLL.dll).".
4
18531
by: Michael Tissington | last post by:
I have a C# function that calls into a C++ DLL I have placed the DLL in the 'bin' folder of my asp.net project I'm using something like However when I try to call the function I'm getting an error 'Unable to Load DLL'
15
4469
by: Jim | last post by:
I am extremely frustrated. I am building c# application for a call center and am using a third party API to access some hardware. When develop and test my class using the windows console the application runs flawlessly, but once I call the class from inside a c# windows application the program freezes, crashes etc... there must be a way to make this work inside a windows app as it run great as a command line app.
2
2422
by: pnp | last post by:
Hi all, i'm having a problem using DllImport with Win98. It works just fine with XP & 2000 but in 98 it prompts: "Unable to find xxxxx.dll". Any ideas? error is: System.DllNotFoundException: Unable to load DLL (etc\fectfmn.dll). Peter
2
10483
by: Brian Anderson | last post by:
Hello, is it possible to use DllImport to call a DLL in ASP.NET ? Or is it necessarry that my DLL has to be copied into \System32 ? My DLL is a native C++ 7.1 DLL (not managed, no COM, no regsvr32) and uses Assembler to make some math in SSE. The result is given out as an Int. Using a C# console app (code below) it work fine & fast.
6
19909
by: Steve | last post by:
I'm sure I'm missing something basic. I have an class library that uses an unmanaged dll. Let's say the class library is called "CL1.dll" and is located at: and the unmanaged dll is called "UM.dll" and is located at For my DllImport attribute I was using and this worked.
1
4324
by: nirbhay | last post by:
Hello All I am experiencing a problem calling one of my un-managed C++ DLL from a Web page This was working fine in Visual Studio 2003 version but gives following error in Visual Studio 2005 Unable to load DLL 'xxxx.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) I am calling my DLL from the web page using DLLImport. I read in other posts something related to dependency.
0
1607
by: kayakyakr | last post by:
I'm working with a set of experiments in a large system that is using AppDomains for isolation and wants to make a call out to an umanaged dll. The test dll has two methods, SetNumber(int num) and GetNumber(), and a global variable. The DllImport and getting and setting the numbers are fine. The problem comes when I make the calls to the libraries from separate AppDomains. Calling SetNumber with 3 different values across 3 different...
1
3020
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
Hello, Newsgroupians: I have created an unmanaged DLL using Visual Studio 2005, which was created in Visual C++. I have some functions in the DLL that I am trying to call. When I "dumpbin -exports ManipLib.dll" I can see all of my exported functions, which I have defined in my definition file. They are not name mangled or decorated. Now, when I call the function in my C# program, I have the following definition...
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10112
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.