Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Bringing DCOM remoting functionality to Windows CE and .NET CF2.0

, 17 Apr 2006
This article shows how to use DCOM on Windows CE 5.0. We will add full DCOM rich error information, and implement a DCOM interface between a Windows XP .NET 2.0 client and Windows CE DCOM server. With this code, it is possible to code .NET remoting alike functionality through DCOM interop.
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//

//Microsoft Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#if ! defined (UNDER_CE)
#include "afxres.h"
#else
#include <windows.h>
#define IDC_STATIC -1
#endif

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#if ! defined (UNDER_CE)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#endif
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_MAIN DIALOG DISCARDABLE  0, 0, 160, 109
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "DCOM Configuration Utility"
FONT 8, "MS Sans Serif"
BEGIN
    PUSHBUTTON      "Exit",IDCANCEL,106,89,38,14
    PUSHBUTTON      "Class",IDC_CLASS,16,89,38,14
    LISTBOX         IDC_CLSIDS,16,4,128,85,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | 
                    WS_TABSTOP
    PUSHBUTTON      "Default",IDC_DEFAULT,61,89,38,14
END

IDD_PERMISSIONS DIALOG DISCARDABLE  0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Security - PERMISSIONS"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
    LISTBOX         IDC_PERMISSIONS,7,7,116,83,LBS_NOINTEGRALHEIGHT | 
                    WS_VSCROLL | WS_TABSTOP
    DEFPUSHBUTTON   "Delete",IDC_DELETE,129,59,50,14
    DEFPUSHBUTTON   "Add...",IDC_ADD,129,41,50,14
END

IDD_DEFAULTSECURITY DIALOG DISCARDABLE  0, 0, 159, 102
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Default Security"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,102,60,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,102,81,50,14
    PUSHBUTTON      "Access",IDC_ACCESS,7,60,50,14
    PUSHBUTTON      "Launch",IDC_LAUNCH,7,81,50,14
    COMBOBOX        IDC_AUTH,79,7,73,41,CBS_DROPDOWNLIST | WS_VSCROLL | 
                    WS_TABSTOP
    COMBOBOX        IDC_IMPERS,79,24,73,39,CBS_DROPDOWNLIST | WS_VSCROLL | 
                    WS_TABSTOP
    LTEXT           "Authentication:",IDC_STATIC,7,7,68,12
    LTEXT           "Impersonation:",IDC_STATIC,7,25,68,10
    CONTROL         "Enable DCOM",IDC_ENABLEDCOM,"Button",BS_AUTOCHECKBOX | 
                    WS_TABSTOP,7,46,61,10
    CONTROL         "Secure references",IDC_SECUREREFS,"Button",
                    BS_AUTOCHECKBOX | WS_TABSTOP,73,46,74,10
END

IDD_CLASSSECURITY DIALOG DISCARDABLE  0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Class Security"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
    DEFPUSHBUTTON   "Access...",IDC_ACCESS,129,60,50,14
    DEFPUSHBUTTON   "Launch...",IDC_LAUNCH,129,42,50,14
    LTEXT           "Launch:",IDC_STATIC,7,7,34,13
    LTEXT           "Static",IDC_LAUNCH_TXT,7,20,117,29
    LTEXT           "Access",IDC_STATIC,7,52,29,12
    LTEXT           "Static",IDC_ACCESS_TXT,7,63,116,25
END

IDD_CLASSSUMMARY DIALOG DISCARDABLE  0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Class Summary"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
    EDITTEXT        IDC_SUMMARY,7,7,114,81,ES_MULTILINE | ES_AUTOHSCROLL | 
                    ES_READONLY | WS_VSCROLL | WS_HSCROLL
    PUSHBUTTON      "Security...",IDC_SECURITY,129,42,50,14
    PUSHBUTTON      "Activation...",IDC_ACTIVATION,129,59,50,14
END

IDD_ADDPERMISSIONS DIALOG DISCARDABLE  0, 0, 186, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Add Permissions"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
    LTEXT           "Principal:",IDC_STATIC,7,7,32,12
    EDITTEXT        IDC_PRINCIPALNAME,42,7,81,12,ES_AUTOHSCROLL
    CONTROL         "Group",IDC_GROUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
                    70,24,35,10
    COMBOBOX        IDC_GRANTORDENY,7,22,48,33,CBS_DROPDOWNLIST | WS_VSCROLL | 
                    WS_TABSTOP
END

IDD_CLASSACTIVATION DIALOG DISCARDABLE  0, 0, 186, 58
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Class Activation"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,129,7,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,129,24,50,14
    CONTROL         "Run remotely",IDC_RUNREMOTELY,"Button",BS_AUTOCHECKBOX | 
                    WS_TABSTOP,7,23,57,10
    EDITTEXT        IDC_REMOTESERVERNAME,40,33,78,12,ES_AUTOHSCROLL
    LTEXT           "Server:",IDC_STATIC,7,34,27,13
    CONTROL         "Run Locally",IDC_RUNLOCALLY,"Button",BS_AUTOCHECKBOX | 
                    WS_TABSTOP,7,7,53,10
END


#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE DISCARDABLE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE DISCARDABLE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE DISCARDABLE 
BEGIN
    "\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE 
BEGIN
    IDD_MAIN, DIALOG
    BEGIN
        VERTGUIDE, 16
        VERTGUIDE, 144
        HORZGUIDE, 89
    END

    IDD_PERMISSIONS, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 179
        TOPMARGIN, 7
        BOTTOMMARGIN, 90
    END

    IDD_DEFAULTSECURITY, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 152
        TOPMARGIN, 7
        BOTTOMMARGIN, 95
    END

    IDD_CLASSSECURITY, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 179
        TOPMARGIN, 7
        BOTTOMMARGIN, 88
    END

    IDD_CLASSSUMMARY, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 179
        TOPMARGIN, 7
        BOTTOMMARGIN, 88
    END

    IDD_ADDPERMISSIONS, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 179
        TOPMARGIN, 7
        BOTTOMMARGIN, 48
    END

    IDD_CLASSACTIVATION, DIALOG
    BEGIN
        LEFTMARGIN, 7
        RIGHTMARGIN, 179
        TOPMARGIN, 7
        BOTTOMMARGIN, 51
    END
END
#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1               ICON    DISCARDABLE     "icon1.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Dialog Info
//

IDD_ADDPERMISSIONS DLGINIT
BEGIN
    IDC_GRANTORDENY, 0x403, 7, 0
0x6341, 0x6563, 0x7373, "\000" 
    0
END

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Werner Willemsens
Team Leader
Belgium Belgium
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.140926.1 | Last Updated 17 Apr 2006
Article Copyright 2006 by Werner Willemsens
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid