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. TROUBLE Passing BYTE Array from Client to COM OUTPROC Server [modified]

TROUBLE Passing BYTE Array from Client to COM OUTPROC Server [modified]

Scheduled Pinned Locked Moved COM
questioncomsysadmindata-structures
25 Posts 2 Posters 8 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.
  • S Stephen Hewitt

    Ok. Open the registry editor and search for the following key: {A12EAEC2-2B64-470B-93AF-EFE0855DD3AC} If you find if right click on it and select "Export". Post the contents of the file this generates.

    Steve

    K Offline
    K Offline
    K ARUN KUMAR
    wrote on last edited by
    #21

    Hi Steve, i found two registry entries.. 1st Entry

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}]
    @="IDataProvider"

    [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\NumMethods]
    @="12"

    [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\ProxyStubClsid]
    @="{00020424-0000-0000-C000-000000000046}"

    [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\ProxyStubClsid32]
    @="{00020424-0000-0000-C000-000000000046}"

    [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\TypeLib]
    @="{0381FBF3-32C1-4AF1-B6DD-EFB51815DD72}"
    "Version"="1.0"

    2nd Registry Entry:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\CLSID\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}]
    @="PSFactoryBuffer"

    [HKEY_CLASSES_ROOT\CLSID\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\InProcServer32]
    @="D:\\VC++\\Sample Applications\\BytComp\\DebugPS\\BytCompPS.dll"
    "ThreadingModel"="Both"

    S 1 Reply Last reply
    0
    • K K ARUN KUMAR

      Hi Steve, i found two registry entries.. 1st Entry

      Windows Registry Editor Version 5.00

      [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}]
      @="IDataProvider"

      [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\NumMethods]
      @="12"

      [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\ProxyStubClsid]
      @="{00020424-0000-0000-C000-000000000046}"

      [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\ProxyStubClsid32]
      @="{00020424-0000-0000-C000-000000000046}"

      [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\TypeLib]
      @="{0381FBF3-32C1-4AF1-B6DD-EFB51815DD72}"
      "Version"="1.0"

      2nd Registry Entry:

      Windows Registry Editor Version 5.00

      [HKEY_CLASSES_ROOT\CLSID\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}]
      @="PSFactoryBuffer"

      [HKEY_CLASSES_ROOT\CLSID\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\InProcServer32]
      @="D:\\VC++\\Sample Applications\\BytComp\\DebugPS\\BytCompPS.dll"
      "ThreadingModel"="Both"

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #22

      First note that the proxy-stub you built is creatable:

      K ARUN KUMAR wrote:

      [HKEY_CLASSES_ROOT\CLSID\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\InProcServer32] @="D:\\VC++\\Sample Applications\\BytComp\\DebugPS\\BytCompPS.dll" "ThreadingModel"="Both"

      But your interface isn't using it:

      K ARUN KUMAR wrote:

      [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\ProxyStubClsid32] @="{00020424-0000-0000-C000-000000000046}"

      {00020424-0000-0000-C000-000000000046} is the universal marshaller, not your proxy-stub ({A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}). Also I notice your interface is marked with [dual]. This means the interface has to be automation compatible and should only use a limited number of types (which doesn't include BYTE arrays). Do you get warnings when you compile the IDL file? Did you ignore them? Since you exported these keys you're free to tinker with them as they can easily be restored using the exported files. Change this key:

      [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\ProxyStubClsid32]
      @="{00020424-0000-0000-C000-000000000046}"

      So that it looks like this:

      [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\ProxyStubClsid32]
      @="{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}"

      NOTE: Don't alter the exported files, make the changes in the registry. Alternatively copy the exported file, make the change in the copy, then double click the copy.

      Steve

      K 1 Reply Last reply
      0
      • S Stephen Hewitt

        First note that the proxy-stub you built is creatable:

        K ARUN KUMAR wrote:

        [HKEY_CLASSES_ROOT\CLSID\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\InProcServer32] @="D:\\VC++\\Sample Applications\\BytComp\\DebugPS\\BytCompPS.dll" "ThreadingModel"="Both"

        But your interface isn't using it:

        K ARUN KUMAR wrote:

        [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\ProxyStubClsid32] @="{00020424-0000-0000-C000-000000000046}"

        {00020424-0000-0000-C000-000000000046} is the universal marshaller, not your proxy-stub ({A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}). Also I notice your interface is marked with [dual]. This means the interface has to be automation compatible and should only use a limited number of types (which doesn't include BYTE arrays). Do you get warnings when you compile the IDL file? Did you ignore them? Since you exported these keys you're free to tinker with them as they can easily be restored using the exported files. Change this key:

        [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\ProxyStubClsid32]
        @="{00020424-0000-0000-C000-000000000046}"

        So that it looks like this:

        [HKEY_CLASSES_ROOT\Interface\{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}\ProxyStubClsid32]
        @="{A12EAEC2-2B64-470B-93AF-EFE0855DD3AC}"

        NOTE: Don't alter the exported files, make the changes in the registry. Alternatively copy the exported file, make the change in the copy, then double click the copy.

        Steve

        K Offline
        K Offline
        K ARUN KUMAR
        wrote on last edited by
        #23

        Hi Steve, You are amazing. The change worked. But when iam building the server, it again modifying the registry setting to default Marshaller GUID. How to set my ProxtStub GUID as default?

        S 1 Reply Last reply
        0
        • K K ARUN KUMAR

          Hi Steve, You are amazing. The change worked. But when iam building the server, it again modifying the registry setting to default Marshaller GUID. How to set my ProxtStub GUID as default?

          S Offline
          S Offline
          Stephen Hewitt
          wrote on last edited by
          #24

          The problem is your interface is marked as an automation interface but it uses types that are not automation compatible. As I said, I'm sure the MIDL compiler would have warned you about this, and you should always investigate compiler warnings. The are a number of ways to fix this:

          1. Don't use an automation compatible interface. Remove the dual and all the [id] attributes, and derive from IUnknown instead of IDispatch. You will not need the IDispatchImp base class in you server implementation either.
          2. Add another interface to the object (which isn't dual and derives from IUnknown, as described above) to contain the non-automation compatible methods.
          3. Manually make the changes I described after RegisterTypeLib[^] makes the "wrong" ones. This is a hack though: why use an automation-compatible interface that automation clients will not be able to call?
          4. Give my posts good marks ;)

          Steve

          K 1 Reply Last reply
          0
          • S Stephen Hewitt

            The problem is your interface is marked as an automation interface but it uses types that are not automation compatible. As I said, I'm sure the MIDL compiler would have warned you about this, and you should always investigate compiler warnings. The are a number of ways to fix this:

            1. Don't use an automation compatible interface. Remove the dual and all the [id] attributes, and derive from IUnknown instead of IDispatch. You will not need the IDispatchImp base class in you server implementation either.
            2. Add another interface to the object (which isn't dual and derives from IUnknown, as described above) to contain the non-automation compatible methods.
            3. Manually make the changes I described after RegisterTypeLib[^] makes the "wrong" ones. This is a hack though: why use an automation-compatible interface that automation clients will not be able to call?
            4. Give my posts good marks ;)

            Steve

            K Offline
            K Offline
            K ARUN KUMAR
            wrote on last edited by
            #25

            Thanks a lot buddy. Sure.. Arun

            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