PC Review


Reply
 
 
=?Utf-8?B?QmFydA==?=
Guest
Posts: n/a
 
      19th Mar 2006
Hi,

Imagine the following situation : a.dll depends on b.dll and a.dll is
imported in C# with DllImport["a.dll"].
Is it correct that if b.dll cannot be found, you get an error about a.dll
and *not* about b.dll ?

Thanks,
Bart

--
www.xenopz.com
 
Reply With Quote
 
 
 
 
scott blood
Guest
Posts: n/a
 
      20th Mar 2006
Bart,

If you import a dll that has one or more dependancies missing, you should
get an error message about the DLL you are importing, not being able to
load.

Regards
Scott Blood
C# Developer
"Bart" <(E-Mail Removed)> wrote in message
news:A1E74712-607B-4653-A3D2-(E-Mail Removed)...
> Hi,
>
> Imagine the following situation : a.dll depends on b.dll and a.dll is
> imported in C# with DllImport["a.dll"].
> Is it correct that if b.dll cannot be found, you get an error about a.dll
> and *not* about b.dll ?
>
> Thanks,
> Bart
>
> --
> www.xenopz.com



 
Reply With Quote
 
Stoitcho Goutsev \(100\)
Guest
Posts: n/a
 
      20th Mar 2006
Bart,

The easiest way to find out is to test the case. Did you test it? What was
the result?

I can see both possible. I'd peffer to get an arror anout a.dll, but never
tried.


--

Stoitcho Goutsev (100)

"Bart" <(E-Mail Removed)> wrote in message
news:A1E74712-607B-4653-A3D2-(E-Mail Removed)...
> Hi,
>
> Imagine the following situation : a.dll depends on b.dll and a.dll is
> imported in C# with DllImport["a.dll"].
> Is it correct that if b.dll cannot be found, you get an error about a.dll
> and *not* about b.dll ?
>
> Thanks,
> Bart
>
> --
> www.xenopz.com



 
Reply With Quote
 
=?Utf-8?B?QmFydA==?=
Guest
Posts: n/a
 
      20th Mar 2006
Hi Scott,

Thanks for the reply. That's indeed the behaviour I've seen, is there any
way to get error message which indicate which dll is missing ?

Thanks,
Bart
--
www.xenopz.com


"scott blood" wrote:

> Bart,
>
> If you import a dll that has one or more dependancies missing, you should
> get an error message about the DLL you are importing, not being able to
> load.
>
> Regards
> Scott Blood
> C# Developer
> "Bart" <(E-Mail Removed)> wrote in message
> news:A1E74712-607B-4653-A3D2-(E-Mail Removed)...
> > Hi,
> >
> > Imagine the following situation : a.dll depends on b.dll and a.dll is
> > imported in C# with DllImport["a.dll"].
> > Is it correct that if b.dll cannot be found, you get an error about a.dll
> > and *not* about b.dll ?
> >
> > Thanks,
> > Bart
> >
> > --
> > www.xenopz.com

>
>
>

 
Reply With Quote
 
=?Utf-8?B?QmFydA==?=
Guest
Posts: n/a
 
      20th Mar 2006
Hi Stoitcho,

I did test the a.dll - b.dll case. Personally, I think that the (default)
behaviour is a bit confusing. The run time complains about not finding a call
in a.dll, while the actual problem is the absence of b.dll.
This is particulary annoying while interfacing with matlab : matlab
instructs to use "dependency walker" to find all dependent dlls. In such a
case, it would be nice if the run time informs you about missing dlls.

Regards,
Bart
--
www.xenopz.com


"Stoitcho Goutsev (100)" wrote:

> Bart,
>
> The easiest way to find out is to test the case. Did you test it? What was
> the result?
>
> I can see both possible. I'd peffer to get an arror anout a.dll, but never
> tried.
>
>
> --
>
> Stoitcho Goutsev (100)
>
> "Bart" <(E-Mail Removed)> wrote in message
> news:A1E74712-607B-4653-A3D2-(E-Mail Removed)...
> > Hi,
> >
> > Imagine the following situation : a.dll depends on b.dll and a.dll is
> > imported in C# with DllImport["a.dll"].
> > Is it correct that if b.dll cannot be found, you get an error about a.dll
> > and *not* about b.dll ?
> >
> > Thanks,
> > Bart
> >
> > --
> > www.xenopz.com

>
>
>

 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      20th Mar 2006
There is no way for the run-time to know what DLL's are dynamically loaded
by the imported DLL, these are not loaded by the assembly loader, they are
loaded by the OS loader. It's up to the DLL author to report load failures,
but most just test the return value of "LoadLibrary" and just bail out when
the DLL is not found without leaving any trace why it failed, all the
run-time knows is that a load failed with an error code 2 (that is file not
found), but that's all.

Willy.

"Bart" <(E-Mail Removed)> wrote in message
news:7195E84B-E5C9-480B-8B19-(E-Mail Removed)...
| Hi Stoitcho,
|
| I did test the a.dll - b.dll case. Personally, I think that the (default)
| behaviour is a bit confusing. The run time complains about not finding a
call
| in a.dll, while the actual problem is the absence of b.dll.
| This is particulary annoying while interfacing with matlab : matlab
| instructs to use "dependency walker" to find all dependent dlls. In such a
| case, it would be nice if the run time informs you about missing dlls.
|
| Regards,
| Bart
| --
| www.xenopz.com
|
|
| "Stoitcho Goutsev (100)" wrote:
|
| > Bart,
| >
| > The easiest way to find out is to test the case. Did you test it? What
was
| > the result?
| >
| > I can see both possible. I'd peffer to get an arror anout a.dll, but
never
| > tried.
| >
| >
| > --
| >
| > Stoitcho Goutsev (100)
| >
| > "Bart" <(E-Mail Removed)> wrote in message
| > news:A1E74712-607B-4653-A3D2-(E-Mail Removed)...
| > > Hi,
| > >
| > > Imagine the following situation : a.dll depends on b.dll and a.dll is
| > > imported in C# with DllImport["a.dll"].
| > > Is it correct that if b.dll cannot be found, you get an error about
a.dll
| > > and *not* about b.dll ?
| > >
| > > Thanks,
| > > Bart
| > >
| > > --
| > > www.xenopz.com
| >
| >
| >


 
Reply With Quote
 
bart_deboeck@hotmail.com
Guest
Posts: n/a
 
      2nd Apr 2006
Hi Willy,

Thanks for the reply. Do you know any article which documents this
behaviour?

Thanks,
Bart

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
asp.net and dllimport Larry Microsoft C# .NET 1 7th Oct 2008 08:51 AM
What's the difference of [DllImport ....] with _declspec(dllimport) Ed Microsoft VC .NET 2 31st Jul 2007 02:31 AM
Using DllImport k Microsoft C# .NET 2 8th Feb 2005 11:53 AM
C++ to C# using DllImport t_msreddy Microsoft C# .NET 0 1st Oct 2004 09:01 PM
DllImport into C# Tim Mulholland Microsoft C# .NET 5 20th Feb 2004 09:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:40 PM.