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 / C++ / MFC
  4. Using ShellExecute

Using ShellExecute

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++comlearning
8 Posts 5 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.
  • C Offline
    C Offline
    color Aljechin
    wrote on last edited by
    #1

    I have two questions. 1. How do I use ShellExecute inside my MFC program to register an activex control, say MyControl.ocx located at D:\MyFolder? 2. I do not want it to be in the hard disk, but would like to include the activex control within my program as a resource and then I want to register it. I imported it as a resource. How can I proceed? Regards, Aljechin Alexander :rose:

    N M H D 4 Replies Last reply
    0
    • C color Aljechin

      I have two questions. 1. How do I use ShellExecute inside my MFC program to register an activex control, say MyControl.ocx located at D:\MyFolder? 2. I do not want it to be in the hard disk, but would like to include the activex control within my program as a resource and then I want to register it. I imported it as a resource. How can I proceed? Regards, Aljechin Alexander :rose:

      N Offline
      N Offline
      NiceNaidu fo
      wrote on last edited by
      #2

      Use DllRegisterServer Check this article for some help. http://www.codeproject.com/macro/openvc.asp?df=100&forumid=1254&exp=0&select=809393[^] Appu.. "If you judge people, you have no time to love them."

      D 1 Reply Last reply
      0
      • C color Aljechin

        I have two questions. 1. How do I use ShellExecute inside my MFC program to register an activex control, say MyControl.ocx located at D:\MyFolder? 2. I do not want it to be in the hard disk, but would like to include the activex control within my program as a resource and then I want to register it. I imported it as a resource. How can I proceed? Regards, Aljechin Alexander :rose:

        M Offline
        M Offline
        Milton Karimbekallil
        wrote on last edited by
        #3
        1. u can use ShellExecute(NULL, NULL, "regsvr32.exe", , NULL, SW_HIDE); 2) you cant keep an ocx in the resourse and use it if you are doing static linking. if u are doing only dynamic lnking then, one thing you can do is to store the binaries from reourse into the harddisk and register from there. cheers..milton kb
        1 Reply Last reply
        0
        • C color Aljechin

          I have two questions. 1. How do I use ShellExecute inside my MFC program to register an activex control, say MyControl.ocx located at D:\MyFolder? 2. I do not want it to be in the hard disk, but would like to include the activex control within my program as a resource and then I want to register it. I imported it as a resource. How can I proceed? Regards, Aljechin Alexander :rose:

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          See ShellExecute[^]_**


          **_

          whitesky


          1 Reply Last reply
          0
          • N NiceNaidu fo

            Use DllRegisterServer Check this article for some help. http://www.codeproject.com/macro/openvc.asp?df=100&forumid=1254&exp=0&select=809393[^] Appu.. "If you judge people, you have no time to love them."

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            NiceNaiduUse DllRegisterServer

            Exactly how is this of any help outside of the ActiveX file?


            "The largest fire starts but with the smallest spark." - David Crow

            "Judge not by the eye but by the heart." - Native American Proverb

            1 Reply Last reply
            0
            • C color Aljechin

              I have two questions. 1. How do I use ShellExecute inside my MFC program to register an activex control, say MyControl.ocx located at D:\MyFolder? 2. I do not want it to be in the hard disk, but would like to include the activex control within my program as a resource and then I want to register it. I imported it as a resource. How can I proceed? Regards, Aljechin Alexander :rose:

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              Aljechin wrote:

              1. How do I use ShellExecute inside my MFC program to register an activex control, say MyControl.ocx located at D:\MyFolder?

              While you can use ShellExecute() or CreateProcess() for this, you could also use LoadLibrary() and GetProcAddress() to call the exported DllRegisterServer() function.


              "The largest fire starts but with the smallest spark." - David Crow

              "Judge not by the eye but by the heart." - Native American Proverb

              C 1 Reply Last reply
              0
              • D David Crow

                Aljechin wrote:

                1. How do I use ShellExecute inside my MFC program to register an activex control, say MyControl.ocx located at D:\MyFolder?

                While you can use ShellExecute() or CreateProcess() for this, you could also use LoadLibrary() and GetProcAddress() to call the exported DllRegisterServer() function.


                "The largest fire starts but with the smallest spark." - David Crow

                "Judge not by the eye but by the heart." - Native American Proverb

                C Offline
                C Offline
                color Aljechin
                wrote on last edited by
                #7

                Halo sir, I went through your article which demonstrates the usage of UpdateResource(). Nice one. But from that I am unable to understand how do I do the same when I have imported it as a Binary resource into my MFC app. Its like I have an activeX DLL imported as a binary resource and it is a part of my executable now. I need to register the control to any machine on which the executable is run. I have understood that I could do it with ShellExecute() But I do not know how to use this resource!! Is copying this data to a file on the machine and registering it the only possible way? Can I not register it from within my program itself without copying this binary and creating a replica of the actual file? Thanks for your help. Aljechin. :rose:

                D 1 Reply Last reply
                0
                • C color Aljechin

                  Halo sir, I went through your article which demonstrates the usage of UpdateResource(). Nice one. But from that I am unable to understand how do I do the same when I have imported it as a Binary resource into my MFC app. Its like I have an activeX DLL imported as a binary resource and it is a part of my executable now. I need to register the control to any machine on which the executable is run. I have understood that I could do it with ShellExecute() But I do not know how to use this resource!! Is copying this data to a file on the machine and registering it the only possible way? Can I not register it from within my program itself without copying this binary and creating a replica of the actual file? Thanks for your help. Aljechin. :rose:

                  D Offline
                  D Offline
                  David Crow
                  wrote on last edited by
                  #8

                  Aljechin wrote:

                  Is copying this data to a file on the machine and registering it the only possible way?

                  It's the only way that I am familar with.


                  "The largest fire starts but with the smallest spark." - David Crow

                  "Judge not by the eye but by the heart." - Native American Proverb

                  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