PInvoke, load library from desired folder?

Discussion in 'ASP .Net' started by Edwin Knoppert, Nov 16, 2005.

  1. 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")> _
     
    Edwin Knoppert, Nov 16, 2005
    #1
    1. Advertising

  2. Edwin Knoppert

    tdavisjr Guest

    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
     
    tdavisjr, Nov 16, 2005
    #2
    1. Advertising

  3. 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" <> schreef in bericht
    news:...
    > 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
    >
     
    Edwin Knoppert, Nov 16, 2005
    #3
  4. Edwin Knoppert

    Bruce Barker Guest

    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" <> wrote in message
    news:437b5b7b$0$2346$...
    > 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")> _
    >
    >
    >
     
    Bruce Barker, Nov 16, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Isaac

    PInvoke

    Isaac, Dec 14, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    779
    Isaac
    Dec 14, 2003
  2. Ken Varn
    Replies:
    0
    Views:
    421
    Ken Varn
    Jan 30, 2006
  3. sirithvasa
    Replies:
    0
    Views:
    424
    sirithvasa
    Nov 7, 2006
  4. Replies:
    0
    Views:
    512
  5. Ivonne Riedel

    general question asynchronous webhandler with pinvoke

    Ivonne Riedel, Jan 30, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    158
    Ivonne Riedel
    Jan 30, 2006
Loading...

Share This Page