Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Stupid question

Stupid question

Scheduled Pinned Locked Moved Visual Basic
questionlearningcsharp
17 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    teuneboon
    wrote on last edited by
    #1

    I'm quite a vb.net beginner and I lost my library-card so I have to wait a month before I can get a book about this: How do I load a dll file into my vb.net program?? (I'm only 15 so I'm not very good at vb.net)

    J P A C 4 Replies Last reply
    0
    • T teuneboon

      I'm quite a vb.net beginner and I lost my library-card so I have to wait a month before I can get a book about this: How do I load a dll file into my vb.net program?? (I'm only 15 so I'm not very good at vb.net)

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      It depends what that dll file is! not all .dll files are the same thing, confusing I know! So, if it is another dll written in .NET, then you just add a reference to the dll (are you using Visual Studio?) If it is a COM dll, then you can still add a reference, and if using Visual Studio it will do the "hard work" for you. If it is a windows dll then you often have to call them using pinvoke... this is a little complex if you are a beginner.... i hope its one of the above! Hope that helps buddy, 15 is a good age to start learning to program!

      T 1 Reply Last reply
      0
      • J J4amieC

        It depends what that dll file is! not all .dll files are the same thing, confusing I know! So, if it is another dll written in .NET, then you just add a reference to the dll (are you using Visual Studio?) If it is a COM dll, then you can still add a reference, and if using Visual Studio it will do the "hard work" for you. If it is a windows dll then you often have to call them using pinvoke... this is a little complex if you are a beginner.... i hope its one of the above! Hope that helps buddy, 15 is a good age to start learning to program!

        T Offline
        T Offline
        teuneboon
        wrote on last edited by
        #3

        Here is the link: http://r2.d2.hu/snf/sound\_tools/freeware\_gpl/free\_bladeenc\_encoder\_player\_editor\_wav\_mp3\_ogg\_rip\_convert\_encode\_tracker.html I only know how to use variables, load files, save files and some other basics :P

        J 1 Reply Last reply
        0
        • T teuneboon

          I'm quite a vb.net beginner and I lost my library-card so I have to wait a month before I can get a book about this: How do I load a dll file into my vb.net program?? (I'm only 15 so I'm not very good at vb.net)

          P Offline
          P Offline
          progload
          wrote on last edited by
          #4

          teuneboon, Here's a fairly basic article on CP about P/Invoke. http://www.codeproject.com/dotnet/PInvoke.asp[^] Hope this helps, progload

          T 1 Reply Last reply
          0
          • P progload

            teuneboon, Here's a fairly basic article on CP about P/Invoke. http://www.codeproject.com/dotnet/PInvoke.asp[^] Hope this helps, progload

            T Offline
            T Offline
            teuneboon
            wrote on last edited by
            #5

            that's a great help:-D sorry but not really, none of the codes works -- modified at 16:34 Thursday 23rd February, 2006

            P 1 Reply Last reply
            0
            • T teuneboon

              Here is the link: http://r2.d2.hu/snf/sound\_tools/freeware\_gpl/free\_bladeenc\_encoder\_player\_editor\_wav\_mp3\_ogg\_rip\_convert\_encode\_tracker.html I only know how to use variables, load files, save files and some other basics :P

              J Offline
              J Offline
              J4amieC
              wrote on last edited by
              #6

              OK, so it looks like a COM dll to me, are you using Visual Studio to write your program?

              T 1 Reply Last reply
              0
              • T teuneboon

                I'm quite a vb.net beginner and I lost my library-card so I have to wait a month before I can get a book about this: How do I load a dll file into my vb.net program?? (I'm only 15 so I'm not very good at vb.net)

                A Offline
                A Offline
                Allah On Acid
                wrote on last edited by
                #7

                If you are talking about a Win32 API DLL, you do it like this: Declare Function (or Sub) (FunctionName) Lib (Dllname) Alias (Function Name in DLL) then the arguments. for instance: Declare Function MsgBox Lib "user32.dll" _ Alias "MessageBox" (ByVal hWnd As Integer, _ ByVal txt As String, ByVal caption As String, _ ByVal Type As Integer) As Integer Then you could call it like any other function. There is more info about this here: http://kpdweb.cjb.net/

                1 Reply Last reply
                0
                • T teuneboon

                  that's a great help:-D sorry but not really, none of the codes works -- modified at 16:34 Thursday 23rd February, 2006

                  P Offline
                  P Offline
                  progload
                  wrote on last edited by
                  #8

                  teuneboon, What do you mean by it doesn't work? I works in my vb.net... Declare Auto Function MyMessageBox Lib "user32.dll" Alias _ "MessageBox" (ByVal hWnd As Integer, ByVal msg As String, _ ByVal Caption As String, ByVal Tpe As Integer) As Integer Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click MyMessageBox(0, "Hello World !!!", "Project Title", 0) End Sub progload

                  T 1 Reply Last reply
                  0
                  • J J4amieC

                    OK, so it looks like a COM dll to me, are you using Visual Studio to write your program?

                    T Offline
                    T Offline
                    teuneboon
                    wrote on last edited by
                    #9

                    nope visual express(it's .net by the way)

                    1 Reply Last reply
                    0
                    • P progload

                      teuneboon, What do you mean by it doesn't work? I works in my vb.net... Declare Auto Function MyMessageBox Lib "user32.dll" Alias _ "MessageBox" (ByVal hWnd As Integer, ByVal msg As String, _ ByVal Caption As String, ByVal Tpe As Integer) As Integer Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click MyMessageBox(0, "Hello World !!!", "Project Title", 0) End Sub progload

                      T Offline
                      T Offline
                      teuneboon
                      wrote on last edited by
                      #10

                      nope it doesn't work

                      P 1 Reply Last reply
                      0
                      • T teuneboon

                        nope it doesn't work

                        P Offline
                        P Offline
                        progload
                        wrote on last edited by
                        #11

                        teuneboon, hmmm... I guess i won't be able to help, It works here on mine just fine. sorry, progload

                        T 1 Reply Last reply
                        0
                        • T teuneboon

                          I'm quite a vb.net beginner and I lost my library-card so I have to wait a month before I can get a book about this: How do I load a dll file into my vb.net program?? (I'm only 15 so I'm not very good at vb.net)

                          C Offline
                          C Offline
                          Christian Graus
                          wrote on last edited by
                          #12

                          If you're using PInvoke, you probably want to check out www.pinvoke.net, they may have done the hard yards for you already. I was 13 when I started coding. *sigh* That was in 1982. Christian Graus - Microsoft MVP - C++

                          C 1 Reply Last reply
                          0
                          • C Christian Graus

                            If you're using PInvoke, you probably want to check out www.pinvoke.net, they may have done the hard yards for you already. I was 13 when I started coding. *sigh* That was in 1982. Christian Graus - Microsoft MVP - C++

                            C Offline
                            C Offline
                            Colin Angus Mackay
                            wrote on last edited by
                            #13

                            The early 80s were a good time to start coding. :-D It brings back the memories. My dad borrowed a Commodore Pet from work when I was 6. A friend had a Sinclair ZX81 and then my dad bought a ZX Spectrum in 1983. ColinMackay.net Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

                            C 1 Reply Last reply
                            0
                            • C Colin Angus Mackay

                              The early 80s were a good time to start coding. :-D It brings back the memories. My dad borrowed a Commodore Pet from work when I was 6. A friend had a Sinclair ZX81 and then my dad bought a ZX Spectrum in 1983. ColinMackay.net Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

                              C Offline
                              C Offline
                              Christian Graus
                              wrote on last edited by
                              #14

                              Yeah, I was aware of all those platforms. I learned on an Applle ][, only when I blew it up did I buy a C64, and then a slew of Amigas over the years. I often think if I'd not tried to build an NMI card, I'd be one of 50 people worldwide writing software for the Mac today. Christian Graus - Microsoft MVP - C++

                              1 Reply Last reply
                              0
                              • P progload

                                teuneboon, hmmm... I guess i won't be able to help, It works here on mine just fine. sorry, progload

                                T Offline
                                T Offline
                                teuneboon
                                wrote on last edited by
                                #15

                                I now know how it works (I inserted the code in a form :S) but the call fuction doesn't work in my form when I want to call the class1 file

                                P 1 Reply Last reply
                                0
                                • T teuneboon

                                  I now know how it works (I inserted the code in a form :S) but the call fuction doesn't work in my form when I want to call the class1 file

                                  P Offline
                                  P Offline
                                  progload
                                  wrote on last edited by
                                  #16

                                  teuneboon, If you want to put the Delcare Auto Function... in Class1 and then Call it from Form1, do this: Change the line in your Form1 Button1_Click that reads: MyMessageBox(0, "Hello World !!!", "Project Title", 0) Change it to this: Call Class1.MyMessageBox(0, "Hello World !!!", "Project Title", 0) progload

                                  T 1 Reply Last reply
                                  0
                                  • P progload

                                    teuneboon, If you want to put the Delcare Auto Function... in Class1 and then Call it from Form1, do this: Change the line in your Form1 Button1_Click that reads: MyMessageBox(0, "Hello World !!!", "Project Title", 0) Change it to this: Call Class1.MyMessageBox(0, "Hello World !!!", "Project Title", 0) progload

                                    T Offline
                                    T Offline
                                    teuneboon
                                    wrote on last edited by
                                    #17

                                    ok now I know alot more about class and dll, thanks all

                                    1 Reply Last reply
                                    0
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                    • Login

                                    • Don't have an account? Register

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • World
                                    • Users
                                    • Groups