Results 1 to 14 of 14

Thread: [RESOLVED] How To Compile code as DLL

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2017
    Posts
    236

    Resolved [RESOLVED] How To Compile code as DLL

    hi ~ all

    How To Compile code as DLL ( VB.NET )

    and the dll can be used in vb6

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

    Re: How To Compile code as DLL

    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
    Fanatic Member Peter Porter's Avatar
    Join Date
    Jul 2013
    Location
    Germany
    Posts
    538

    Re: How To Compile code as DLL

    Within the Visual Basic .NET's Solution Explorer, click on My Project. If you don't see My Project because the name was changed, click whatever is two down from Solution 'application name' (1 project).

    In the Application tab under Application type, select Class Library from it's drop-down menu.

    Now rebuild and save the project, and get the dll from the project's debug folder.

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

    Re: How To Compile code as DLL

    It takes a little more than that. He asks about using the DLL from a VB6 application.
    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
    Jun 2017
    Posts
    236

    Re: How To Compile code as DLL

    Quote Originally Posted by Niya View Post
    Can VB.Net compile to Standard DLL ???

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

    Re: How To Compile code as DLL

    Quote Originally Posted by quickbbbb View Post
    Can VB.Net compile to Standard DLL ???
    No. Use C++ for that.
    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
    Jun 2017
    Posts
    236

    Re: How To Compile code as DLL

    Quote Originally Posted by Niya View Post
    No. Use C++ for that.
    OK
    thank you

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

    Re: [RESOLVED] How To Compile code as DLL

    You know your question piqued my interest so I decided to look into it before I dismiss it as completely impossible and I found some who claim it can be done. You can check out those claims to see if they hold water. You can start here.
    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

  9. #9
    Fanatic Member Peter Porter's Avatar
    Join Date
    Jul 2013
    Location
    Germany
    Posts
    538

    Re: How To Compile code as DLL

    Quote Originally Posted by Niya View Post
    Quote Originally Posted by Peter Porter View Post
    Quote Originally Posted by quickbbbb View Post
    hi ~ all

    How To Compile code as DLL ( VB.NET )

    and the dll can be used in vb6
    Within the Visual Basic .NET's Solution Explorer, click on My Project. If you don't see My Project because the name was changed, click whatever is two down from Solution 'application name' (1 project).

    In the Application tab under Application type, select Class Library from it's drop-down menu.

    Now rebuild and save the project, and get the dll from the project's debug folder.
    It takes a little more than that. He asks about using the DLL from a VB6 application.
    Niya, I didn't see his question as a two-parter, plus the last part reads like he knows what to do with a dll, just needs to know how to create it. It also reads like he started the VB.NET project in winforms, or found the project as so, which is why he needed to know how to convert it to a dll.


    Quote Originally Posted by quickbbbb View Post
    Can VB.Net compile to Standard DLL ???
    Seems like that's all he's asking for, which I answered above in my first reply.



    Quote Originally Posted by Niya View Post
    Quote Originally Posted by quickbbbb View Post
    Can VB.Net compile to Standard DLL ???
    No. Use C++ for that.
    C++? What am I missing here?


    Anyway, before VB.Net is converted to a dll, it's code needs to be configured to work with 32bit applications in order to work with VB6. In the Configuration Manager, under Active Solution platform, if it's not showing x86, open it's drop-down menu and click <New...>, and in the pop-up under Type..., select x86 from it's drop-down menu, and click OK. Now in the Configuration Manager under Platform, if it's not showing x86, open it's drop-down menu and click <New...>, and in the pop-up under Type... select x86 from it's drop-down menu and click OK. Now close the Configuration Manager, rebuild the project, and follow the steps in my first post.

    I'm still using Visual Basic 2010, so there might be more hoops to do all of the above in my instructions if you have a newer version of VB.

    quickbbbb, if Niya helped you out, just ignore my crazy self.
    Last edited by Peter Porter; Nov 27th, 2021 at 01:23 PM.

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

    Re: How To Compile code as DLL

    Quote Originally Posted by Peter Porter View Post
    C++? What am I missing here?
    He wants to export WINAPI/Extern "C" styled functions from the DLL. The C++ compiler has the most straightforward way of doing 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

  11. #11
    Fanatic Member Peter Porter's Avatar
    Join Date
    Jul 2013
    Location
    Germany
    Posts
    538

    Re: How To Compile code as DLL

    Quote Originally Posted by Niya View Post
    He wants to export WINAPI/Extern "C" styled functions from the DLL. The C++ compiler has the most straightforward way of doing this.
    Oh, I missed this from another thread, or did you have a private chat with him?

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

    Re: How To Compile code as DLL

    Quote Originally Posted by Peter Porter View Post
    Oh, I missed this from another thread, or did you have a private chat with him?
    No. He said "Standard DLL". Typically what people mean by this is the most common type of DLL which is one that exports WINAPI styled functions like Windows DLLs such as GDI32.Dll or User32.Dll
    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

  13. #13
    Fanatic Member Peter Porter's Avatar
    Join Date
    Jul 2013
    Location
    Germany
    Posts
    538

    Re: How To Compile code as DLL

    Quote Originally Posted by Niya View Post
    No. He said "Standard DLL". Typically what people mean by this is the most common type of DLL which is one that exports WINAPI styled functions like Windows DLLs such as GDI32.Dll or User32.Dll
    That one flew over my head! Guess I just stick to programming and posting music videos.

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

    Re: How To Compile code as DLL

    Quote Originally Posted by Peter Porter View Post
    That one flew over my head! Guess I just stick to programming and posting music videos.
    No one knows everything my man.

    DLLs just happens to be something I'm very familiar with. I've written all kinds of DLLs over the years so I kind of have a sense for what's what when a topic like this comes up.
    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

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