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. C#
  4. how to link dll with exe

how to link dll with exe

Scheduled Pinned Locked Moved C#
csharphelptutoriallearning
13 Posts 4 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.
  • Y Yashwanth C b

    hi , i am a beginner.i want to make a dll file and link it with an exe.the dll files should have functions and exe file should call and run those functions.but i dont know how.this may help me a lot.please correct me if i am going in wrong way.i am using visual c# express 2010

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #2

    Unless you have a good reason for having a DLL, it is much easier just to create an executable, in order to get used to the structure of a program and how it fits together. Once you have all your code working then you can always separate parts out into a DLL if necessary. However, remember that a DLL is only any use if it is likely to be shared by multiple applications.

    Use the best guess

    OriginalGriffO Y 2 Replies Last reply
    0
    • L Lost User

      Unless you have a good reason for having a DLL, it is much easier just to create an executable, in order to get used to the structure of a program and how it fits together. Once you have all your code working then you can always separate parts out into a DLL if necessary. However, remember that a DLL is only any use if it is likely to be shared by multiple applications.

      Use the best guess

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #3

      Richard MacCutchan wrote:

      However, remember that a DLL is only any use if it is likely to be shared by multiple applications.

      I'd be prepared to argue against that point! :laugh: I often use a single EXE and separate DLLs to hold the different assemblies of a project: DL and BL for example, or to separate logical segments to reduce any "accidental" interactions. The EXE is just the final PL as far as I am concerned, with even the user controls that make up the UI separated out into a different DLL (and assembly)

      The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      L 1 Reply Last reply
      0
      • Y Yashwanth C b

        hi , i am a beginner.i want to make a dll file and link it with an exe.the dll files should have functions and exe file should call and run those functions.but i dont know how.this may help me a lot.please correct me if i am going in wrong way.i am using visual c# express 2010

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #4

        It's pretty easy - or at least it is in the Pro version of VS210, I don't have the Express version. So if any of this doesn't work, let me know... :laugh: Open your solution, and look at the Solution Explorer pane. Right click your solution name, and select "Add...New Project..." from the drop down list. In the dialog, Select "Class Library" from the middle panel, and give it a sensible Name. Press OK. Build your solution. Now, open your EXE project in the Solution Explorer pane, and right click the "References" branch. Select the "Add Reference..." option. In the dialog the appears, select the "Projects" tab from the list on the left, then select your new DLL project on the right. Press the "Add" button. Done! You can now use classes in the DLL project in your EXE project. (You may want to add the appropriate using statement to your code files)

        The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        L 3 Replies Last reply
        0
        • OriginalGriffO OriginalGriff

          Richard MacCutchan wrote:

          However, remember that a DLL is only any use if it is likely to be shared by multiple applications.

          I'd be prepared to argue against that point! :laugh: I often use a single EXE and separate DLLs to hold the different assemblies of a project: DL and BL for example, or to separate logical segments to reduce any "accidental" interactions. The EXE is just the final PL as far as I am concerned, with even the user controls that make up the UI separated out into a different DLL (and assembly)

          The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #5

          And I would agree with you. But OP is a beginner so it is probably not useful to get into DLLs until he/she has a good understanding and skill level with the basics.

          Use the best guess

          1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            It's pretty easy - or at least it is in the Pro version of VS210, I don't have the Express version. So if any of this doesn't work, let me know... :laugh: Open your solution, and look at the Solution Explorer pane. Right click your solution name, and select "Add...New Project..." from the drop down list. In the dialog, Select "Class Library" from the middle panel, and give it a sensible Name. Press OK. Build your solution. Now, open your EXE project in the Solution Explorer pane, and right click the "References" branch. Select the "Add Reference..." option. In the dialog the appears, select the "Projects" tab from the list on the left, then select your new DLL project on the right. Press the "Add" button. Done! You can now use classes in the DLL project in your EXE project. (You may want to add the appropriate using statement to your code files)

            The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #6

            Works in Express also.

            Use the best guess

            1 Reply Last reply
            0
            • OriginalGriffO OriginalGriff

              It's pretty easy - or at least it is in the Pro version of VS210, I don't have the Express version. So if any of this doesn't work, let me know... :laugh: Open your solution, and look at the Solution Explorer pane. Right click your solution name, and select "Add...New Project..." from the drop down list. In the dialog, Select "Class Library" from the middle panel, and give it a sensible Name. Press OK. Build your solution. Now, open your EXE project in the Solution Explorer pane, and right click the "References" branch. Select the "Add Reference..." option. In the dialog the appears, select the "Projects" tab from the list on the left, then select your new DLL project on the right. Press the "Add" button. Done! You can now use classes in the DLL project in your EXE project. (You may want to add the appropriate using statement to your code files)

              The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #7

              Looking at these messages[^], OP is either a very fast learner or just going through every language until he/she finds one that he/she can understand.

              Use the best guess

              OriginalGriffO 1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                It's pretty easy - or at least it is in the Pro version of VS210, I don't have the Express version. So if any of this doesn't work, let me know... :laugh: Open your solution, and look at the Solution Explorer pane. Right click your solution name, and select "Add...New Project..." from the drop down list. In the dialog, Select "Class Library" from the middle panel, and give it a sensible Name. Press OK. Build your solution. Now, open your EXE project in the Solution Explorer pane, and right click the "References" branch. Select the "Add Reference..." option. In the dialog the appears, select the "Projects" tab from the list on the left, then select your new DLL project on the right. Press the "Add" button. Done! You can now use classes in the DLL project in your EXE project. (You may want to add the appropriate using statement to your code files)

                The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #8

                Why aren't you out in the sunshine frolicking in the meadows with your sheep? Me; I'm just gathering my strength for a cycle ride to Windsor and back this afternoon.

                Use the best guess

                OriginalGriffO 1 Reply Last reply
                0
                • L Lost User

                  Looking at these messages[^], OP is either a very fast learner or just going through every language until he/she finds one that he/she can understand.

                  Use the best guess

                  OriginalGriffO Offline
                  OriginalGriffO Offline
                  OriginalGriff
                  wrote on last edited by
                  #9

                  Gawd! Looks like he did a two week course in C++ in May and then panicked... Interesting choice of project to start with "develop your own language" - they didn't give us that on day one of the first year! (They didn't even get us to write a BASIC interpretter until year 3)

                  The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

                  "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                  "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                  1 Reply Last reply
                  0
                  • L Lost User

                    Why aren't you out in the sunshine frolicking in the meadows with your sheep? Me; I'm just gathering my strength for a cycle ride to Windsor and back this afternoon.

                    Use the best guess

                    OriginalGriffO Offline
                    OriginalGriffO Offline
                    OriginalGriff
                    wrote on last edited by
                    #10

                    Cause I've spent the day hoovering, fixing the hoover, cleaning out the hoover so the damn thing sucks properly, cleaning the bathroom, dumping dead vermin in the river and hoovering up the remains, etc., etc. And I've got to pick Herself up from work in an hour, then wash the car this arvo before cooking supper.

                    The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)

                    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                    1 Reply Last reply
                    0
                    • Y Yashwanth C b

                      hi , i am a beginner.i want to make a dll file and link it with an exe.the dll files should have functions and exe file should call and run those functions.but i dont know how.this may help me a lot.please correct me if i am going in wrong way.i am using visual c# express 2010

                      D Offline
                      D Offline
                      Denis Shemenko
                      wrote on last edited by
                      #11

                      You should go here[^] then proceed there[^] and finally try start Here[^] Good luck :)

                      1 Reply Last reply
                      0
                      • L Lost User

                        Unless you have a good reason for having a DLL, it is much easier just to create an executable, in order to get used to the structure of a program and how it fits together. Once you have all your code working then you can always separate parts out into a DLL if necessary. However, remember that a DLL is only any use if it is likely to be shared by multiple applications.

                        Use the best guess

                        Y Offline
                        Y Offline
                        Yashwanth C b
                        wrote on last edited by
                        #12

                        no not like ur wrong guess.i m

                        L 1 Reply Last reply
                        0
                        • Y Yashwanth C b

                          no not like ur wrong guess.i m

                          L Offline
                          L Offline
                          Lost User
                          wrote on last edited by
                          #13

                          :confused:

                          Use the best guess

                          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