Want to use a vendor's dll in my web app

Last post 11-05-2009 12:22 PM by some_yahoo. 4 replies.

Sort Posts:

  • Want to use a vendor's dll in my web app

    10-31-2009, 8:47 PM
    • Member
      56 point Member
    • some_yahoo
    • Member since 09-25-2007, 5:02 PM
    • Posts 48

    I have a DLL that contains a function which generates a string.  The call looks like

    string mystring =MakeCode(A, B, C, D, E, F, G);


    I have no access to the source of the DLL.  What I want to do is have my ASP page use the DLL to generate a string which is then displayed on the web page.

    I have never done this from ASP.NET before so please be complete.  I have seen many answers that say, "just register it and use it in your project".    I need to know how to do these things.

    I have placed the DLL in my APP_CODE subdirectory.


    Thanks in advance.

    I'd rather live with false hope than with false despair.
  • Re: Want to use a vendor's dll in my web app

    11-01-2009, 1:13 AM
    • Contributor
      2,194 point Contributor
    • ratish_shriyan
    • Member since 10-05-2009, 8:55 AM
    • A D I T I Technologies, Bangalore
    • Posts 308

    Hi,

    Since its a DLL, you need reference it in your project so that it gets added to the Bin folder and not the App_Code folder. App_Code will contain code (.cs files that you write ). In Visual Studio, Right click on the Website Icon in solution explorer, Select Add Reference..., Select the Browse tab, then locate the DLL, click OK. Now the DDL would be shown in the References folder of your website. Next step is to use the code in the DLL. If you know the namespace, you need to import the same in the code like,

    import MyDll.MyNamespace

    If you do not know what namespace to import, no problem, just write the method call( just as you call any other method ) and the smart tag would ask you whether you want to import the namespace( it will be clear once you get to this step )

    Hope this helps!


    Knowledge Is Power
  • Re: Want to use a vendor's dll in my web app

    11-01-2009, 2:39 PM
    • Member
      56 point Member
    • some_yahoo
    • Member since 09-25-2007, 5:02 PM
    • Posts 48

    no go.  I get this...

    ---------------------------
    Visual Web Developer 2008 Express Edition
    ---------------------------
    A reference to 'C:\Documents and Settings\All Users\Documents\Visual Studio 2008\WebSites\afi\Bin\CodeGen.dll' could not be added. This is not a COM component.
    ---------------------------
    OK  
    ---------------------------

    I'd rather live with false hope than with false despair.
  • Re: Want to use a vendor's dll in my web app

    11-04-2009, 4:38 AM
    • Participant
      844 point Participant
    • Nowall
    • Member since 12-19-2007, 9:53 AM
    • Posts 108

    Is it COM component? If so, see http://support.microsoft.com/kb/828986

    Also check out http://msdn.microsoft.com/en-us/library/hsy826az.aspx

    Please make the reply as answer if it helps!
  • Re: Want to use a vendor's dll in my web app

    11-05-2009, 12:22 PM
    Answer
    • Member
      56 point Member
    • some_yahoo
    • Member since 09-25-2007, 5:02 PM
    • Posts 48

    As I said in the initial post it's not a component at all. There is one function that accepts parameters and returns a string.


    I figured it out though... though it was not easy.  http://vstudiojourney.blogspot.com/2009/11/using-legacy-windows-dll-in-aspnet.html

    I'd rather live with false hope than with false despair.
Page 1 of 1 (5 items)