SAMPLE: Marshaling Code for Connection Point Interfaces

Last reviewed: December 11, 1996
Article ID: Q149231
The information in this article applies to:
  • Microsoft OLE libraries included with:

        - Microsoft Windows NT version 3.51
        - Microsoft Windows 95
    

SUMMARY

CXPRX provides 32-bit marshaling code for the IConnectionPoint, IConnectionPointContainer, IEnumConnections, and IEnumConnectionPoints interfaces. The next version of Windows and Windows NT will provide marshaling code for these interfaces, so be sure to follow the installation instructions specified below to prevent accidental overwriting of the system provided marshaling code.

You can find CXPRX.EXE (size: 108514 bytes) 
                      , a self-extracting file, on these services:

  • Microsoft's World Wide Web site on the Internet

          On the www.microsoft.com home page, click the Support icon
          Click Knowledge Base, and select the product
    
          Enter kbfile CXPRX.EXE (size: 108514 bytes) 
                                , and click GO!
          Open the article, and click the button to download the file
    
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the Softlib/Mslfiles folder
          Get CXPRX.EXE (size: 108514 bytes) 
    
  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download CXPRX.EXE (size: 108514 bytes) 
    

    For additional information about downloading, please see the following article in the Microsoft Knowledge Base:

       ARTICLE-ID: Q119591
       TITLE     : How to Obtain Microsoft Support Files from Online Services
    
    
    After downloading the file, run it in an empty directory with the -d switch to set up the directory structure:

       CXPRX.EXE -d
    
    
    NOTE: The x86 directory contains a build of CXPRX.DLL that will work on Windows 95 and the Intel x86 version of Windows NT 3.51. The MIPS and Alpha directories contain builds of CXPRX.DLL for use on the MIPS and Alpha versions of Windows NT 3.51. This code will not work with 16-bit applications. Please do not modify the code or the version number. Change the CPU variable in the makefile to build for different platforms.

    MORE INFORMATION

    The connection point interfaces (IConnectionPoint, IConnectionPointContainer, IEnumConnections, and IEnumConnectionPoints) are used by components to implement event handling. These interfaces are documented in the OLE Controls documentation. Windows 95 and Windows NT 3.51 did not provide marshaling code for these interfaces. Consequently these interfaces could only be used with inproc objects on these platforms. The marshaling code provided here allows these interfaces to be used by out- of-process objects on the Windows NT 3.51 and Windows 95 platforms.

    The next version of Windows and Windows NT will provide marshaling code for the connection point interfaces. To prevent the overwriting of this system provided marshaling code, it is important that you follow the following installation instructions when you install the marshaling code provided here:

    Installation Instructions

    An installation program that installs the marshaling code should follow these steps:

    1. The installation program should check the system directory (determined at installation time by using the GetSystemDirectory() Win32 API) for the existence of CXPRX.DLL. If it exists and if the standard version- checking APIs indicate that it is a later version than the CXPRX.DLL provided by the installation program, it should not be overwritten and installation is complete. The version of CXPRX.DLL provided here is 1,0,0,3 (See CXPRX.RC). If CXPRX.DLL exists in the system directory but if it is an earlier version, overwrite it and installation is complete. If CXPRX.DLL does not exist in the system directory, go to step 2.

    2. The installation program should check for the existence of the following registry key to determine whether to continue installation or not:

      if (ERROR_SUCCESS != RegQueryValueEx( HKEY_CLASSES_ROOT, "Interface\\{B196B285-BAB4-101A-B69C-00AA00341D07}\\ProxyStubClsid32", NULL, REG_SZ, NULL, NULL)) {

          ... go to step 3 ...
      
      }
         // else installation is complete;
      
         This check prevents accidental overwriting of the system's installed
         marshaling code when the system does provide marshaling of these
         interfaces in the future. So if this key is present, marshaling code for
         these interfaces exists and the installation is complete.
      
      

    3. If installation gets past step 2, CXPRX.DLL should be copied to the system directory. Then the marshaling code must be registered in the registry by running REGSVR32.EXE CXPRX.DLL. REGSVR32.EXE will call the exported DllRegisterServer function in CXPRX.DLL to register the marshaling code. Installation is now complete.


  • Additional reference words: 4.00
    KBCategory: kbother kbfile
    KBSubcategory: LeTwoArc


    THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

    Last reviewed: December 11, 1996
    © 1998 Microsoft Corporation. All rights reserved. Terms of Use.