Results 1 to 33 of 33

Thread: Reference a .NET DLL in VB5

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Reference a .NET DLL in VB5

    We need to do some REST communications in our VB5 program to a credit card processing web app. We decided to use VS 2008 to create a DLL that would do the communicating and have one of the pieces of or VB5 program reference that DLL.
    So far we have created a test DLL in VS2008 and tested it using a VS2008 Windows Form. It does work. When we try to add a Reference to the DLL in VB5, we get the message "Can't add a reference to the specified file."
    I have found numerous threads about using .NET Dll's with VB6 but I have not been successful in getting any of the solutions to work. I'm now wondering if VB5 just will not reference a .NET DLL.
    I'm wondering if we can use a "late bind", but I don't know the syntax to try it.

    This is the very simple code from VS2008. It's purpose is just to see that we can use the add, mult and hello functions in VB5.

    Namespace TstDLL
    Public Class MathStuff
    Public Function addXY(ByVal x As Integer, ByVal y As Integer) As Integer
    Return x + y
    End Function

    Public Function multXY(ByVal x As Integer, ByVal y As Integer) As Integer
    Return x * y
    End Function

    Public Function Hello()
    Return "Hello World 12345"
    End Function
    End Class
    End Namespace

  2. #2
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by GRichG View Post
    I have found numerous threads about using .NET Dll's with VB6 but I have not been successful in getting any of the solutions to work.
    Have you seen this one?

    Also, if you're going to be working in .Net, I strongly recommend you use a more up to date version of Visual Studio. VS2019 and VS2022 are both available and 100% free to download and use.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,989

    Re: Reference a .NET DLL in VB5

    They are not 100% free to download for ANYBODY. Enterprises have a strict definition, and strong limitations on how they are allowed to use VS. It is entirely likely, based on the question, that the OP is not allowed to get a free download.
    My usual boring signature: Nothing

  4. #4
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Reference a .NET DLL in VB5

    The community edition is free and is a complete product in and of itself. It is more than sufficient for the majority of users.

    Quote Originally Posted by Shaggy Hiker View Post
    It is entirely likely, based on the question, that the OP is not allowed to get a free download.
    What gave you that impression?
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by Niya View Post
    Have you seen this one?

    Also, if you're going to be working in .Net, I strongly recommend you use a more up to date version of Visual Studio. VS2019 and VS2022 are both available and 100% free to download and use.
    Hi Shaggy, yes, I saw a couple of examples you gave to make it happen. This was one of them. I also looked at another example which had a link within the link above. I followed the instructions, used VS2019 and couldn't get either of them to work.

    Also, I backed off to VS2008 because it was closer to VB5.

    Another wrinkle that may be the killer. The VB5 development system is XP SP3. I found VS2005 in the XP system and I'm going to see if that helps. Unfortunately the program is massive, about 1/2 million lines and includes a few add-on tools from the late 90's. We looked at converting to .NET several years ago but the program would not convert as there were way too many changes in code and syntax. I'm hoping this is doable.

    I've been beating my head against this for about 20 hours and I'm cooked. I have to pull off for tonight but will be back on in the AM.

    edit: one more thing....the VS2008 and VS2019 computer is a Win10 computer, so the VB5 program tried to register across a UNC, then we moved the DLL to the XP and tried again. Nada....
    Last edited by GRichG; Nov 21st, 2021 at 06:09 PM.

  6. #6
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Reference a .NET DLL in VB5

    You mentioned VB5, do you also happen to have a copy of VB6? Try it with VB6. The idea here is to confirm or eliminate the possibility that whatever differences exists between VB5 and VB6 are not the cause of your issues. All of the COM interop stuff I ever did was always with VB6, not VB5 so I don't know if it will work in VB5. I would assume it would but I actually do not know for sure.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by Niya View Post
    You mentioned VB5, do you also happen to have a copy of VB6? Try it with VB6. The idea here is to confirm or eliminate the possibility that whatever differences exists between VB5 and VB6 are not the cause of your issues. All of the COM interop stuff I ever did was always with VB6, not VB5 so I don't know if it will work in VB5. I would assume it would but I actually do not know for sure.
    No, we don't have VB6. I'm going to just buy a copy. If nothing else, I can use it as a wrapper.

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by Niya View Post
    The community edition is free and is a complete product in and of itself. It is more than sufficient for the majority of users.
    That's true, but it depends where it is going to be used. If you're using it commercially, I believe that you can only do so in an organisation where a maximum of 5 people are doing so. Any more than 5 and you are legally required to buy Professional or Enterprise licenses. If you're a lone developer or part of a small team then you're good to go with Community.

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by GRichG View Post
    No, we don't have VB6. I'm going to just buy a copy.
    I don't think that you can actually do so legally these days. You can probably do so illegally and that may not be a problem for you, but if you work for a company that is concerned about legal licenses for software, I don't think you'll be able to do it through them.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by jmcilhinney View Post
    That's true, but it depends where it is going to be used. If you're using it commercially, I believe that you can only do so in an organisation where a maximum of 5 people are doing so. Any more than 5 and you are legally required to buy Professional or Enterprise licenses. If you're a lone developer or part of a small team then you're good to go with Community.
    I'm the only developer. I have part time people sometimes and I farm out some work sometimes.
    I've even used India twice.
    Last edited by GRichG; Nov 22nd, 2021 at 01:06 AM.

  11. #11
    Addicted Member gilman's Avatar
    Join Date
    Jan 2017
    Location
    Bilbao
    Posts
    176

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by Niya View Post
    You mentioned VB5, do you also happen to have a copy of VB6? Try it with VB6. The idea here is to confirm or eliminate the possibility that whatever differences exists between VB5 and VB6 are not the cause of your issues. All of the COM interop stuff I ever did was always with VB6, not VB5 so I don't know if it will work in VB5. I would assume it would but I actually do not know for sure.
    There is no problems in use VBNet 2005 or 2008 dlls via interop with VB5, it works like with VB6

  12. #12
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by GRichG View Post
    I'm the only developer. I have part time people sometimes and I farm out some work sometimes.
    I've even used India twice.
    In that case, you certainly can use the Community edition of VS, which, if I'm not mistaken has been available since 2012. Unless you have a specific reason to do otherwise, I would suggest using at least VS 2019. VS 2022 is the latest but is still quite new so may have more bugs than 2019 and is also missing some extensions that support 2019.

  13. #13
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    Re: Reference a .NET DLL in VB5

    And you followed all steps mentioned?
    https://web.archive.org/web/20120210....com/kb/817248
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  14. #14
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by GRichG View Post
    No, we don't have VB6. I'm going to just buy a copy. If nothing else, I can use it as a wrapper.
    Trying to figure out what you mean by use it as a wrapper? VB6 can load and compile VB5 projects without issue. I had lots of VB5 projects when I moved to 6 and did not have to do anything to any of them to move to 6. 6 works with everything 5 did and adds a good bit more plus the 6 service packs that came out later. The only reason to use 5 over 6 is if you have 5 and do not have 6.

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by DataMiser View Post
    Trying to figure out what you mean by use it as a wrapper? VB6 can load and compile VB5 projects without issue. I had lots of VB5 projects when I moved to 6 and did not have to do anything to any of them to move to 6. 6 works with everything 5 did and adds a good bit more plus the 6 service packs that came out later. The only reason to use 5 over 6 is if you have 5 and do not have 6.
    By "wrapper" I mean "interface". Using a VB6 DLL to interface between the VB5.EXE and the .NET DLL.
    A layer of complexity that I'd rather not use.

  16. #16

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by Zvoni View Post
    And you followed all steps mentioned?
    https://web.archive.org/web/20120210....com/kb/817248
    Quote Originally Posted by gilman View Post
    There is no problems in use VBNet 2005 or 2008 dlls via interop with VB5, it works like with VB6
    I'm not having a lot of success in getting the little test VB5 program to register or CreateObject while using a DLL created in VB2005 on the XP SP3 computer. If VB5 should register just like VB6 then getting a copy of VB6 will not help.

    Unfortunately the article kb/817248 is mostly Greek to me. I did recognize a few things in it and rebuilt the DLL with a strong name and box "Register for COM Interop" checked (it wasn't)

    I'm not sure what "interop" means but it looks like another level of complexity.

    This is how I'm trying to do a late bind with it. Is this the correct syntax?
    Private Sub btnTestAdd_Click()
    Dim tDLL As Object

    Set tDLL = CreateObject("TestVBDLL.dll")

    Dim tstDLL As Object

    Set tstDLL = tDLL.tstDLL

    Text3.Text = tstDLL.addXY(Text1.Text, Text2.Text)
    End Sub

    It fails on CreateObject. "ActiveX component can't create object"
    Last edited by GRichG; Nov 22nd, 2021 at 01:52 PM.

  17. #17
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by GRichG View Post
    This is how I'm trying to do a late bind with it. Is this the correct syntax?
    Code:
    Private Sub btnTestAdd_Click()
        Dim tDLL As Object
      
        Set tDLL = CreateObject("TestVBDLL.dll")
      
        Dim tstDLL As Object
      
        Set tstDLL = tDLL.tstDLL
      
        Text3.Text = tstDLL.addXY(Text1.Text, Text2.Text)
    End Sub
    It fails on CreateObject. "ActiveX component can't create object"
    I don't think that is how you use CreateObject. The name of the class you're trying to instantiate is supposed to be in CreateObject's first parameter.

    Also, I've never tested COM Interop with CreateObject. I'm not entirely sure if it will work the same way. Why are you trying to use late binding anyway, is there a specific reason for this?
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  18. #18
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by GRichG View Post
    By "wrapper" I mean "interface". Using a VB6 DLL to interface between the VB5.EXE and the .NET DLL.
    A layer of complexity that I'd rather not use.
    But you could just build the exe using VB6 and place whatever code needed directly into your main program. No need to add a layer of complexity.

  19. #19

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by Niya View Post
    I don't think that is how you use CreateObject. The name of the class you're trying to instantiate is supposed to be in CreateObject's first parameter.

    Why are you trying to use late binding anyway, is there a specific reason for this?
    I'm hoping, maybe foolishly, that a late bind might work where the early referencing doesn't.

    Quote Originally Posted by Niya View Post
    I don't think that is how you use CreateObject. The name of the class you're trying to instantiate is supposed to be in CreateObject's first parameter.
    You're right. It's not the right syntax.

  20. #20
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Reference a .NET DLL in VB5

    Ok I've just tested the use of CreateObject in my CodeBank sample referenced in the second post and it works fine.

    I was able to show the GridForm object like this:-
    Code:
        Dim gd As GridForm
        
        Set gd = CreateObject("GridDisplay.GridForm")
        
        gd.Show
    So with that I'm going to guess that you are indeed not using CreateObject correctly. You must include the project name and the name of the object you're trying to create. If you're not sure about the project name, you can use the object browser(press F2) to find out the name of the project that contains the .Net COM class you want to instantiate.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  21. #21
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Reference a .NET DLL in VB5

    Also, there is one other very important thing I forgot to ask. Are you sure you're registering the .Net DLL? This is a very important step and it won't work without being registered just like any other COM server.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  22. #22

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by Niya View Post
    Also, there is one other very important thing I forgot to ask. Are you sure you're registering the .Net DLL? This is a very important step and it won't work without being registered just like any other COM server.
    On the XP computer;
    When I use regsvr32, I get TestVBDLL.dll was loaded, but the entry point was not found. When I use RegAsm and Register.bat (without the /codebase, because it complained about that), shown before the pause, I get,

    Types registered successfully
    Assembly exported to 'C:\VBPrograms\TestVBs\Test REST DLLs\TestVBDLL.tlb', and the type library was registered successfully

    I got RegAsm and Register.bat from your examples posted on this forum.

    How about this "entry point" how do I define that when I make the DLL. I've made about 20 DLL's in VB5 to use with the program and I've never had to deal with any of this except to register them on the target computers.

  23. #23
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by GRichG View Post
    (without the /codebase, because it complained about that)
    What was the error? I remember when I was first exploring COM Interop, I didn't get RegAsm to work without /codebase.

    Quote Originally Posted by GRichG View Post
    How about this "entry point" how do I define that when I make the DLL. I've made about 20 DLL's in VB5 to use with the program and I've never had to deal with any of this except to register them on the target computers.
    Regsvr32 doesn't actually do anything that complicated. All it does is load the DLL and tries to call a function named DllRegisterServer. However, .Net compilers do not create this entry point in .Net COM interop DLLs which is why we use RegAsm.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  24. #24

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by Niya View Post
    What was the error? I remember when I was first exploring COM Interop, I didn't get RegAsm to work without /codebase.

    From the .BAT when ran with /codebase on XP

    C:\temp\temp>regasm TestVBDLL.dll /tlb:TestVBDLL.tlb /codebase
    Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.5483
    Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

    RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re-register it.
    Types registered successfully
    Assembly exported to 'C:\temp\temp\TestVBDLL.tlb', and the type library was registered successfully

    C:\temp\temp>pause
    Press any key to continue . . .

    I feel like my problem is that I'm not doing something right when creating the .DLL

  25. #25
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    Re: Reference a .NET DLL in VB5

    In the VB5-IDE go to references and look for your objects from that dll.
    they should appear there
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  26. #26
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by GRichG View Post
    From the .BAT when ran with /codebase on XP

    C:\temp\temp>regasm TestVBDLL.dll /tlb:TestVBDLL.tlb /codebase
    Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.5483
    Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

    RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re-register it.
    Types registered successfully
    Assembly exported to 'C:\temp\temp\TestVBDLL.tlb', and the type library was registered successfully

    C:\temp\temp>pause
    Press any key to continue . . .

    I feel like my problem is that I'm not doing something right when creating the .DLL
    Well according to that it worked. I wouldn't worry too much about that warning. For your purposes I think you can safely ignore that warning. Strongly named assemblies are a throwback to a bygone era where the GAC was a big deal.

    Also, Zvoni is correct. After RegAsm registers the DLL, it should show up in the VB5/6 IDE under references. Does it show up in the references for you?
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  27. #27

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by Niya View Post
    After RegAsm registers the DLL, it should show up in the VB5/6 IDE under references. Does it show up in the references for you?
    YES!!! It did!!!
    It worked................. :-)
    I need a drink.....I'm buying!

    Now to tackle REST and responding to events in some DLL.
    Thank you very much Niya, Angel of Code

  28. #28
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Reference a .NET DLL in VB5

    Glad we could be of service
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  29. #29

  30. #30
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by wqweto View Post
    LOL

    Both you and the angel?

    cheers,
    </wqw>
    Lol I was actually referring to the other posters in the thread but looking at it now I see what you saying....
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  31. #31

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Re: Reference a .NET DLL in VB5

    I thought this may help if someone opens this post looking for how-to-do-it. I just happened to stumble on this. This article is referenced elsewhere on this forum. It does a pretty good job of explaining why Niya's solution worked. It's pretty involved but is a good read for a .NET novice like me.

    Calling a .NET Component from a COM Component
    https://docs.microsoft.com/en-us/pre...ectedfrom=MSDN

  32. #32
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,598

    Re: Reference a .NET DLL in VB5

    Yea, that is a good article. It's gets into the theory behind it. I just focused on how to do it in my post.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  33. #33

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Location
    Atlanta, Georgia
    Posts
    139

    Re: Reference a .NET DLL in VB5

    Quote Originally Posted by Niya View Post
    Yea, that is a good article. It's gets into the theory behind it. I just focused on how to do it in my post.
    Yes....and I'm glad you did. I was able to understand more of what the article was saying because of using the tools you specified.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width