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. C# console application to dll and register.....

C# console application to dll and register.....

Scheduled Pinned Locked Moved C#
csharp
7 Posts 3 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.
  • G Offline
    G Offline
    greendragons
    wrote on last edited by
    #1

    Hello everyone... Im a bit new to c#.... I have written simple program which produces beeps in every 10min i want it to be converted to dll and i wanna use it on my system so that it beeps in every 10min..... I know it can be easily done with exe file of that project but i wanna use dll and register in system32 and make a part of windows..... all i know that it's done with csc compiler but what have to be written in /t:library...... ex.... csc /t:library simpledll.cs it says missing reference or assemblies..... Thnx....

    D 1 Reply Last reply
    0
    • G greendragons

      Hello everyone... Im a bit new to c#.... I have written simple program which produces beeps in every 10min i want it to be converted to dll and i wanna use it on my system so that it beeps in every 10min..... I know it can be easily done with exe file of that project but i wanna use dll and register in system32 and make a part of windows..... all i know that it's done with csc compiler but what have to be written in /t:library...... ex.... csc /t:library simpledll.cs it says missing reference or assemblies..... Thnx....

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      You appear to be under the mistake belief that just because you register the .DLL that the code automatically runs. Such is not the case. .DLL's have to be loaded by another process and explicitly execute the code contained within. You can make this a .DLL all you want - nothing is going to happen. And it does NOT "become part of Windows" when you register something. You have to leave this as an .EXE, or at least an .EXE that loads and runs the code in the .DLL.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008
      But no longer in 2009...

      G 1 Reply Last reply
      0
      • D Dave Kreskowiak

        You appear to be under the mistake belief that just because you register the .DLL that the code automatically runs. Such is not the case. .DLL's have to be loaded by another process and explicitly execute the code contained within. You can make this a .DLL all you want - nothing is going to happen. And it does NOT "become part of Windows" when you register something. You have to leave this as an .EXE, or at least an .EXE that loads and runs the code in the .DLL.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008
        But no longer in 2009...

        G Offline
        G Offline
        greendragons
        wrote on last edited by
        #3

        i know it can't run on own.....i tried to register with regsvr32...................... what is the exact procedure can u please tell...in google im quite messed up....

        D 1 Reply Last reply
        0
        • G greendragons

          i know it can't run on own.....i tried to register with regsvr32...................... what is the exact procedure can u please tell...in google im quite messed up....

          D Offline
          D Offline
          DaveyM69
          wrote on last edited by
          #4

          No it can't. An exe somewhere has to call the code contained in the dll. This could be a scheduled task, a service or whatever but a dll is incapable of running 'standalone'.

          Dave
          Generic BackgroundWorker - My latest article!
          BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
          Why are you using VB6? Do you hate yourself? (Christian Graus)

          G 1 Reply Last reply
          0
          • D DaveyM69

            No it can't. An exe somewhere has to call the code contained in the dll. This could be a scheduled task, a service or whatever but a dll is incapable of running 'standalone'.

            Dave
            Generic BackgroundWorker - My latest article!
            BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
            Why are you using VB6? Do you hate yourself? (Christian Graus)

            G Offline
            G Offline
            greendragons
            wrote on last edited by
            #5

            Hmmmm i got it thnx!....but then why we register dll to system32 using regsvr32 i was in notion that to use as a part of window(i was so wrong!).....

            D 1 Reply Last reply
            0
            • G greendragons

              Hmmmm i got it thnx!....but then why we register dll to system32 using regsvr32 i was in notion that to use as a part of window(i was so wrong!).....

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              So an application that uses the objects in that .DLL can instantiate them without knowing the filename and path of the .DLL hosting it. Regsitration only works for COM-based .DLL's. Library and resource .DLL's don't use registration at all.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008
              But no longer in 2009...

              G 1 Reply Last reply
              0
              • D Dave Kreskowiak

                So an application that uses the objects in that .DLL can instantiate them without knowing the filename and path of the .DLL hosting it. Regsitration only works for COM-based .DLL's. Library and resource .DLL's don't use registration at all.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008
                But no longer in 2009...

                G Offline
                G Offline
                greendragons
                wrote on last edited by
                #7

                cool i got it..in short u meant for reusability to avoid long messy procedures........... Thnx alot :thumbsup:

                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