Create Entry Point in Class Library

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christiano Donke

    Create Entry Point in Class Library

    Plz..

    I intend to share a class library though network. This library is gonna
    be called by a VB6 project.

    I've found out that a late file-based binding on vb6 is the easiest way
    to bind it...
    DECLARE FUNCTION Enc (str As String) LIB "enc.dll" As Boolean
    for example...


    But .NET Class Library doesn't have an entry point, so my plans were
    flushed away.


    Reading in over the internet i found out that System.Reflecti on can
    create this EntryPoint, but the farest i got is
    Dim instance as Assembly
    Dim value as MethodInfo
    value = instance.EntryP oint

    To it seens to be what I need... but... How do I use it???
    I couldn't find any sample codes... Nor any clarifying information...

    Any little help is appreciated...
    Tks in advance...
    christiano




  • Herfried K. Wagner [MVP]

    #2
    Re: Create Entry Point in Class Library

    "Christiano Donke" <cdonke@digiexp ress.com.brschr ieb:
    I intend to share a class library though network. This library is gonna
    be called by a VB6 project.
    >
    I've found out that a late file-based binding on vb6 is the easiest way
    to bind it...
    DECLARE FUNCTION Enc (str As String) LIB "enc.dll" As Boolean for
    example...
    >
    >
    But .NET Class Library doesn't have an entry point, so my plans were
    flushed away.
    Exposing managed functions the way it's done in the unmanaged (Win32) world
    is not supported by .NET, except maybe when using C++/CLI.

    If your client is written in VB6, you could also expose classes and their
    members to COM.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    • =?Utf-8?B?Um9u?=

      #3
      Re: Create Entry Point in Class Library

      I created a VB.Net DLL to be run with VB6.
      Using the Declare approach (in VB6), I also get the "entry Point" Killer
      when trying to run it.
      Using the COM approch (in VB6), Intellisense shows me all aspects of the
      DLL, compiles ok, but gives the "Automation error -2147024894 System cannot
      find the file specified" when trying to run it. I have been surfing the net
      for hours, finding lots of junk responses, but no step by step answer. Maybe
      I am expecting too much.
      Ron

      "Herfried K. Wagner [MVP]" wrote:
      "Christiano Donke" <cdonke@digiexp ress.com.brschr ieb:
      I intend to share a class library though network. This library is gonna
      be called by a VB6 project.

      I've found out that a late file-based binding on vb6 is the easiest way
      to bind it...
      DECLARE FUNCTION Enc (str As String) LIB "enc.dll" As Boolean for
      example...


      But .NET Class Library doesn't have an entry point, so my plans were
      flushed away.
      >
      Exposing managed functions the way it's done in the unmanaged (Win32) world
      is not supported by .NET, except maybe when using C++/CLI.
      >
      If your client is written in VB6, you could also expose classes and their
      members to COM.
      >
      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
      >
      >

      Comment

      • =?Utf-8?B?Um9u?=

        #4
        Re: Create Entry Point in Class Library


        Thanks Herfried for responding to my note, but as best as I can tell, it is
        the same reply you gave to the original person on this thread. I did
        investigate the links you provided (some interesting stuff) but after wading
        through it, I did not find anything to further the solution. If I am missing
        something, consider me ... (whatever). I'm afraid I missed the point of your
        reply.

        Ron

        "Ron" wrote:
        I created a VB.Net DLL to be run with VB6.
        Using the Declare approach (in VB6), I also get the "entry Point" Killer
        when trying to run it.
        Using the COM approch (in VB6), Intellisense shows me all aspects of the
        DLL, compiles ok, but gives the "Automation error -2147024894 System cannot
        find the file specified" when trying to run it. I have been surfing the net
        for hours, finding lots of junk responses, but no step by step answer. Maybe
        I am expecting too much.
        Ron
        >
        "Herfried K. Wagner [MVP]" wrote:
        >
        "Christiano Donke" <cdonke@digiexp ress.com.brschr ieb:
        I intend to share a class library though network. This library is gonna
        be called by a VB6 project.
        >
        I've found out that a late file-based binding on vb6 is the easiest way
        to bind it...
        DECLARE FUNCTION Enc (str As String) LIB "enc.dll" As Boolean for
        example...
        >
        >
        But .NET Class Library doesn't have an entry point, so my plans were
        flushed away.
        Exposing managed functions the way it's done in the unmanaged (Win32) world
        is not supported by .NET, except maybe when using C++/CLI.

        If your client is written in VB6, you could also expose classes and their
        members to COM.

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

        Comment

        • Phill W.

          #5
          Re: Create Entry Point in Class Library

          Ron wrote:
          I created a VB.Net DLL to be run with VB6.
          Using the Declare approach (in VB6), I also get the "entry Point" Killer
          when trying to run it.
          Not surprising; It's extremely difficult to build "Native" Windows dll's
          (that use Entry Points) in either flavour of Visual Basic.
          Using the COM approch (in VB6), Intellisense shows me all aspects of the
          DLL, compiles ok, but gives the "Automation error -2147024894 System cannot
          find the file specified" when trying to run it.
          /Where/ are you putting the .Net Dll for your VB6 application find it?

          When trying to load assemblies, the Framework /will/ look in the
          application directory.

          HTH,
          Phill W.

          Comment

          • =?Utf-8?B?Um9u?=

            #6
            Re: Create Entry Point in Class Library

            Hi Phill

            Thanks for the reply, Sadly I did place the dll (and tlb) in the same
            directory as the source code I was running (but is that the "applicatio n"
            directory??). I even ran Regasm on the dll located there. I have been reading
            somewhere that the problem is with the registry as it may not have the
            correct pointers. With caution, I have modified the registry, but that did
            not work either. I am getting to the point of trying a dll written in C to
            gain access to the entry points.

            Ron


            "Phill W." wrote:
            Not surprising; It's extremely difficult to build "Native" Windows dll's
            (that use Entry Points) in either flavour of Visual Basic.
            >
            /Where/ are you putting the .Net Dll for your VB6 application find it?
            >
            When trying to load assemblies, the Framework /will/ look in the
            application directory.
            >
            HTH,
            Phill W.
            >

            Comment

            Working...