Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > PInvoke, load library from desired folder?

Reply
Thread Tools

PInvoke, load library from desired folder?

 
 
Edwin Knoppert
Guest
Posts: n/a
 
      11-16-2005
It seems DllImport() only handles the filename, no folders.
I have a (rather heavy) workaround to preload the dll but can it be done in
a more easy way?

Currently:
<DllImport("MYDLL.DLL")> _

Would like (or similar):
<DllImport("~/bin/MYDLL.DLL")> _



 
Reply With Quote
 
 
 
 
tdavisjr
Guest
Posts: n/a
 
      11-16-2005
I'm not totally sure; but the option that you would like ( using the ~)
may not work. I have never seen code for DllImport referenced like
that. I think you must use Absolute file references like
c:\mydlls\mydll.dll.

However, if you place your dll in the system32 directory you can
reference the dll just by using the file name. You may be already doing
that; but just stating this for the benefit of everyone.
-HTH

 
Reply With Quote
 
 
 
 
Edwin Knoppert
Guest
Posts: n/a
 
      11-16-2005
Maybe this is done to avoid multiple and different instances in ASP.NET/IIS.

The full path didn't work, i tried that already.




"tdavisjr" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed) ups.com...
> I'm not totally sure; but the option that you would like ( using the ~)
> may not work. I have never seen code for DllImport referenced like
> that. I think you must use Absolute file references like
> c:\mydlls\mydll.dll.
>
> However, if you place your dll in the system32 directory you can
> reference the dll just by using the file name. You may be already doing
> that; but just stating this for the benefit of everyone.
> -HTH
>



 
Reply With Quote
 
Bruce Barker
Guest
Posts: n/a
 
      11-16-2005
one thing to remember, when your asp.net page is running, the current
directory (thus the default dir), is windows\system32 dir (where the asp.net
service is running from), not the dir where the page is running from.

-- bruce (sqlwork.com)


"Edwin Knoppert" <(E-Mail Removed)> wrote in message
news:437b5b7b$0$2346$(E-Mail Removed). ..
> It seems DllImport() only handles the filename, no folders.
> I have a (rather heavy) workaround to preload the dll but can it be done
> in a more easy way?
>
> Currently:
> <DllImport("MYDLL.DLL")> _
>
> Would like (or similar):
> <DllImport("~/bin/MYDLL.DLL")> _
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Can't parse desired text from file after opening .Net Sports ASP .Net 2 01-20-2006 10:00 PM
Asynchronous Messages (using JMS) improves performance even when the desired comm. mode is synchronous eJAYBee Java 0 12-10-2004 08:52 PM
post form data to a modal dialog window with desired height and width Matt HTML 1 06-20-2004 04:53 AM
Calling a Managed C++ library which uses a load library function from a WS Sammy ASP .Net Web Services 1 08-18-2003 10:51 PM
Open Internet Explorer to desired page jowl Computer Support 5 06-30-2003 08:28 PM



Advertisments