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. COM
  4. New method problem

New method problem

Scheduled Pinned Locked Moved COM
comc++helpquestion
10 Posts 2 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.
  • P Offline
    P Offline
    prasad_som
    wrote on last edited by
    #1

    I'd activex control, having certain set of functions. Recently, I've added a new function to it, which i intend to exposed,

    BEGIN_DISPATCH_MAP(CMyCtrl, COleControl)
    //{{AFX_DISPATCH_MAP(CMyCtrl)
    DISP_FUNCTION(CMyCtrl, "fun1", fun1, VT_EMPTY, VTS_I4 VTS_I4)
    DISP_FUNCTION(CMyCtrl, "newfunction", newfunction, VT_EMPTY, VTS_VARIANT)
    END_DISPATCH_MAP()

    I use this control at client code, using COledispatchDriver. But problem is, now call to new function throws exception. i.e. it doesn't recognizes new function. COledispatchDriver is not able to invoke newly added function. I've registed changed activex. Does anybody faced similar problem?

    Prasad Notifier using ATL | Operator new[],delete[][^]

    R 1 Reply Last reply
    0
    • P prasad_som

      I'd activex control, having certain set of functions. Recently, I've added a new function to it, which i intend to exposed,

      BEGIN_DISPATCH_MAP(CMyCtrl, COleControl)
      //{{AFX_DISPATCH_MAP(CMyCtrl)
      DISP_FUNCTION(CMyCtrl, "fun1", fun1, VT_EMPTY, VTS_I4 VTS_I4)
      DISP_FUNCTION(CMyCtrl, "newfunction", newfunction, VT_EMPTY, VTS_VARIANT)
      END_DISPATCH_MAP()

      I use this control at client code, using COledispatchDriver. But problem is, now call to new function throws exception. i.e. it doesn't recognizes new function. COledispatchDriver is not able to invoke newly added function. I've registed changed activex. Does anybody faced similar problem?

      Prasad Notifier using ATL | Operator new[],delete[][^]

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #2

      You have to re-import the ActiveX. Otherwise the classwizard generated wrapper class for your interface won't contain the new interface function. By registering the component you simply add information to the registry, e.g. where the typelib for the component can be found. The registration procedure does not magically change any code in your client. Of course you can "manually" add the new interface function to your client's interface wrapper class without re-importing the component. Have a look at how "funl" is handled and you should be able to figure it out. Just be careful to get the dispid and the argument list correct. Hope this helps -- Roger


      "It's supposed to be hard, otherwise anybody could do it!" - selfquote

      "No one remembers a coward!" - Jan Elfström 1998
      "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

      P 1 Reply Last reply
      0
      • R Roger Stoltz

        You have to re-import the ActiveX. Otherwise the classwizard generated wrapper class for your interface won't contain the new interface function. By registering the component you simply add information to the registry, e.g. where the typelib for the component can be found. The registration procedure does not magically change any code in your client. Of course you can "manually" add the new interface function to your client's interface wrapper class without re-importing the component. Have a look at how "funl" is handled and you should be able to figure it out. Just be careful to get the dispid and the argument list correct. Hope this helps -- Roger


        "It's supposed to be hard, otherwise anybody could do it!" - selfquote

        "No one remembers a coward!" - Jan Elfström 1998
        "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

        P Offline
        P Offline
        prasad_som
        wrote on last edited by
        #3

        Hi Roger, I'm not importing ocx, as you mentioned. I'm using Coledispatchdriver class instead. By some efforts, I found that, the problem occurs on m/c , having this activex installed previously(old version, without new function). In that case, after registration, new value named InprocServer32 (its not key), is stored under key InprocServer32. Which contains some garbage. If I delete that value, it works fine :confused:. Still cant figure out problem. thanks for your concern.

        Prasad Notifier using ATL | Operator new[],delete[][^]

        R 1 Reply Last reply
        0
        • P prasad_som

          Hi Roger, I'm not importing ocx, as you mentioned. I'm using Coledispatchdriver class instead. By some efforts, I found that, the problem occurs on m/c , having this activex installed previously(old version, without new function). In that case, after registration, new value named InprocServer32 (its not key), is stored under key InprocServer32. Which contains some garbage. If I delete that value, it works fine :confused:. Still cant figure out problem. thanks for your concern.

          Prasad Notifier using ATL | Operator new[],delete[][^]

          R Offline
          R Offline
          Roger Stoltz
          wrote on last edited by
          #4

          Sorry Prasad, I cannot figure that one out. At least not right now. But I must say I don't really get your problem... :~ 1. You have an older version of the ActiveX without the new function that works fine. 2. When you register the newer version it adds the InprocServer32 value below the InprocServer32 key and fills it with "garbage". 3. If you delete the InprocServer32 value, the new version works fine. Is this correctly understood? What happens if you unregister the previous version before registering the new? Is the "garbage" a MULTI_SZ similar to the same value for the "Microsoft ProgressBar Control, version 6.0" (CLSID = {35053A22-8589-11D1-B16A-00C0F0283628})? What happens if you change the contents of the InprocServer32 value instead of deleting it? Error messages when trying to create the server? -- Roger


          "It's supposed to be hard, otherwise anybody could do it!" - selfquote

          "No one remembers a coward!" - Jan Elfström 1998
          "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

          P 1 Reply Last reply
          0
          • R Roger Stoltz

            Sorry Prasad, I cannot figure that one out. At least not right now. But I must say I don't really get your problem... :~ 1. You have an older version of the ActiveX without the new function that works fine. 2. When you register the newer version it adds the InprocServer32 value below the InprocServer32 key and fills it with "garbage". 3. If you delete the InprocServer32 value, the new version works fine. Is this correctly understood? What happens if you unregister the previous version before registering the new? Is the "garbage" a MULTI_SZ similar to the same value for the "Microsoft ProgressBar Control, version 6.0" (CLSID = {35053A22-8589-11D1-B16A-00C0F0283628})? What happens if you change the contents of the InprocServer32 value instead of deleting it? Error messages when trying to create the server? -- Roger


            "It's supposed to be hard, otherwise anybody could do it!" - selfquote

            "No one remembers a coward!" - Jan Elfström 1998
            "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

            P Offline
            P Offline
            prasad_som
            wrote on last edited by
            #5

            Roger Stoltz wrote:

            1. You have an older version of the ActiveX without the new function that works fine. 2. When you register the newer version it adds the InprocServer32 value below the InprocServer32 key and fills it with "garbage". 3. If you delete the InprocServer32 value, the new version works fine. Is this correctly understood?

            exactly.

            Roger Stoltz wrote:

            What happens if you unregister the previous version before registering the new?

            No success.

            Roger Stoltz wrote:

            Is the "garbage" a MULTI_SZ similar to the same value for the "Microsoft ProgressBar Control, version 6.0" (CLSID = {35053A22-8589-11D1-B16A-00C0F0283628})?

            yes, its similar to it.

            Roger Stoltz wrote:

            What happens if you change the contents of the InprocServer32 value instead of deleting it?

            Haven't tried it. But , as mentioned earlier, deleting it was the solution( obviosly, cant ask user to do that :), i.e. to play registry). I tried to access added function from activex control test container. I can see it in list. But again show no effect on pressing invoke. Same thing happen when tried to access new function in vb code. Intellisense shows added function. But in run , error comes, telling 'object doesn't support this property/method'. thanks.

            Prasad Notifier using ATL | Operator new[],delete[][^]

            R 1 Reply Last reply
            0
            • P prasad_som

              Roger Stoltz wrote:

              1. You have an older version of the ActiveX without the new function that works fine. 2. When you register the newer version it adds the InprocServer32 value below the InprocServer32 key and fills it with "garbage". 3. If you delete the InprocServer32 value, the new version works fine. Is this correctly understood?

              exactly.

              Roger Stoltz wrote:

              What happens if you unregister the previous version before registering the new?

              No success.

              Roger Stoltz wrote:

              Is the "garbage" a MULTI_SZ similar to the same value for the "Microsoft ProgressBar Control, version 6.0" (CLSID = {35053A22-8589-11D1-B16A-00C0F0283628})?

              yes, its similar to it.

              Roger Stoltz wrote:

              What happens if you change the contents of the InprocServer32 value instead of deleting it?

              Haven't tried it. But , as mentioned earlier, deleting it was the solution( obviosly, cant ask user to do that :), i.e. to play registry). I tried to access added function from activex control test container. I can see it in list. But again show no effect on pressing invoke. Same thing happen when tried to access new function in vb code. Intellisense shows added function. But in run , error comes, telling 'object doesn't support this property/method'. thanks.

              Prasad Notifier using ATL | Operator new[],delete[][^]

              R Offline
              R Offline
              Roger Stoltz
              wrote on last edited by
              #6

              The InprocServer32 key's default value is always the path to the library containing the server, but I haven't seen the value with the same name before. So: I've google'd around trying to get some information about this mysterious InprocServer32 value. It turns out that the most usual usage of this value is by installing the server with InstallShield and provides some kind of support for update service. I have to dig deeper to get more out of it, but perhaps I don't have to... Now to the obvious question: are you at some point using and/or registering InstallShield, or any external installer...? Or am I barking up the wrong tree? -- Roger


              "It's supposed to be hard, otherwise anybody could do it!" - selfquote

              "No one remembers a coward!" - Jan Elfström 1998
              "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

              P 1 Reply Last reply
              0
              • R Roger Stoltz

                The InprocServer32 key's default value is always the path to the library containing the server, but I haven't seen the value with the same name before. So: I've google'd around trying to get some information about this mysterious InprocServer32 value. It turns out that the most usual usage of this value is by installing the server with InstallShield and provides some kind of support for update service. I have to dig deeper to get more out of it, but perhaps I don't have to... Now to the obvious question: are you at some point using and/or registering InstallShield, or any external installer...? Or am I barking up the wrong tree? -- Roger


                "It's supposed to be hard, otherwise anybody could do it!" - selfquote

                "No one remembers a coward!" - Jan Elfström 1998
                "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

                P Offline
                P Offline
                prasad_som
                wrote on last edited by
                #7

                Roger Stoltz wrote:

                are you at some point using and/or registering InstallShield, or any external installer...?

                No I'm just using regsvr32 commandline.

                Prasad Notifier using ATL | Operator new[],delete[][^]

                R 1 Reply Last reply
                0
                • P prasad_som

                  Roger Stoltz wrote:

                  are you at some point using and/or registering InstallShield, or any external installer...?

                  No I'm just using regsvr32 commandline.

                  Prasad Notifier using ATL | Operator new[],delete[][^]

                  R Offline
                  R Offline
                  Roger Stoltz
                  wrote on last edited by
                  #8

                  I found this[^] KB article at InstallShield's site. It seems like it is the "Microsoft Windows Installer Service" that uses this registry value on "recent" platforms, i.e. w2k and later. Since you're simply registering the server through command line, I suspect you're building the server with a MSVC version greater than 6.0 and the registration of this value is burried somewhere in the framework. Usually I'm working with MSVC6 so I'm not that familiar with later versions. If you put a breakpoint inside the server's DllRegisterServer you should get to the code that registers this value...eventually. Doesn't sound like much fun though. I think it would make sense if you could disable this feature somewhere in the call chain of DllRegisterServer. BTW, are you able to call any other interface function of your server successfully? -- Roger


                  "It's supposed to be hard, otherwise anybody could do it!" - selfquote

                  "No one remembers a coward!" - Jan Elfström 1998
                  "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

                  P 2 Replies Last reply
                  0
                  • R Roger Stoltz

                    I found this[^] KB article at InstallShield's site. It seems like it is the "Microsoft Windows Installer Service" that uses this registry value on "recent" platforms, i.e. w2k and later. Since you're simply registering the server through command line, I suspect you're building the server with a MSVC version greater than 6.0 and the registration of this value is burried somewhere in the framework. Usually I'm working with MSVC6 so I'm not that familiar with later versions. If you put a breakpoint inside the server's DllRegisterServer you should get to the code that registers this value...eventually. Doesn't sound like much fun though. I think it would make sense if you could disable this feature somewhere in the call chain of DllRegisterServer. BTW, are you able to call any other interface function of your server successfully? -- Roger


                    "It's supposed to be hard, otherwise anybody could do it!" - selfquote

                    "No one remembers a coward!" - Jan Elfström 1998
                    "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

                    P Offline
                    P Offline
                    prasad_som
                    wrote on last edited by
                    #9

                    Thanks for information, Roger.

                    Prasad Notifier using ATL | Operator new[],delete[][^]

                    1 Reply Last reply
                    0
                    • R Roger Stoltz

                      I found this[^] KB article at InstallShield's site. It seems like it is the "Microsoft Windows Installer Service" that uses this registry value on "recent" platforms, i.e. w2k and later. Since you're simply registering the server through command line, I suspect you're building the server with a MSVC version greater than 6.0 and the registration of this value is burried somewhere in the framework. Usually I'm working with MSVC6 so I'm not that familiar with later versions. If you put a breakpoint inside the server's DllRegisterServer you should get to the code that registers this value...eventually. Doesn't sound like much fun though. I think it would make sense if you could disable this feature somewhere in the call chain of DllRegisterServer. BTW, are you able to call any other interface function of your server successfully? -- Roger


                      "It's supposed to be hard, otherwise anybody could do it!" - selfquote

                      "No one remembers a coward!" - Jan Elfström 1998
                      "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above

                      P Offline
                      P Offline
                      prasad_som
                      wrote on last edited by
                      #10

                      Roger Stoltz wrote:

                      BTW, are you able to call any other interface function of your server successfully? --

                      Yes, I can call old server functions succesfully.

                      Prasad Notifier using ATL | Operator new[],delete[][^]

                      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