DLL PRoblem

Hi All,
I'm newbies to create DLL file.
I have wrote a custom class file, and I compiled it as a DLL.
However, I just couldn't get it register with regsrv32.
And I couldn't import or add this dll as a references to MS Access as well.
Can anyone give me some idea on what's the basic step we have to do in order to create a Dll file and use it in MS Access

REgards,
silkkeng



Answer this question

DLL PRoblem

  • Donna M. Singel

    Hi, I have succesfully register in the global assembly cache.
    I couldn't get the .DLL file references in the MS Access VBA.
    But I can get .tlb file references in the MS Access VBA.

    How do we get .DLL file to be referenced


  • faiga16

    Hi, Just another quick question, as I create a sub New procedures, to load the settings and read and write procedures.

    how do I make sure whether the dll file resources is free from memory

  • Kevin LZJ

  • Mayuresh

    Hi,
    I'm unfamiliar to COM wrapper this advanced things.
    I understand what COM does,
    but how are we going to manage "Create a COM wrapper for dll"
    And where can I find the documents of "how to create a COM wrapper to a managed dll"

    Please advise.

    Thanks in advanced.
    silkkeng

  • Patrick Gallucci MSFT

    Thanks, it was working now.


  • twostepted

    Have you checked the "Register for COM Interop" check box (Right click on the project in the Solution Explorer, choose Properties and Select the Configuration Properties -> Build property page, and the check box is one of the items on the right hand side of the page). This only works for DLL's: the check box is greyed out for .EXE's
  • Dave Waterworth

    Hi,

          The tbl will tell access how to use the dll.

    Ken

  • Lord_Anubis

    Yet, still couldn't get it work.
    Arh...:Sad
    can anybody outthere give help me with a walkthrough for this



  • Klaus Loffelmann

    Hi,

    Where did you create this dll If you created this on .net you cannot directly make it as a reference on your MS Access program. You'll have to create a COM wrapper for your dll to be recognized in a COM based application (MS Access). I guess this is also the reason that you cannot regsvr32 it to the system. Managed dll's acts differently to ActiveX dlls...

    Just see the docs on how to create a COM wrapper to a managed dll...

     

     

    cheers,

    Paul June A. Domag



  • SQLScott

    Hi,

          I created a new VB.Net classlibrary project and compiled this into classlibrary1.dll.  In the projects properties I checked the register for com interop in the configuration properties -> build tab.



    Imports System.Runtime.InteropServices

    <ComVisible(True)> _

    Public Class Class1

    <ComVisible(True)> _

    Public Function HelloWorld() As String

    Return "Hello World !!"

    End Function

    End Class


     



    I used regasm.exe classlibrary1.dll /tlb to register it.

    I opened up the northwind database.  In the visual basic editor added a reference to classlibrary1.tlb. In the startup module I added this code. 



    Function OpenStartup() As Boolean
    ' Displays Startup form only if database is not a design master or replica.
    ' Used in OnOpen property of Startup form.
    Dim c As New ClassLibrary1.Class1

    Dim s As String
    s = c.Helloworld
    MsgBox s

    On Error GoTo OpenStartup_Err


     



    The function worked but Intellisense was not working.

    Ken



  • jcviera

    Yes I already Done it.
    Or may be would be able to do a post for a complete step to create Dll file that can be used by Access Just a simple class file like people class with firstname and lastname will do.

    I've been doing research on this. Just couldn't get to find out why wasnt it allow to be register.

    Thanks

    Regards,
    silkkeng



  • DLL PRoblem