Click here to Skip to main content
13,291,690 members (55,766 online)
Click here to Skip to main content


40 bookmarked
Posted 17 Apr 2006

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) 2005 Werner Willemsens

// We can not use DllMain() because this is already used by the Proxy/Stub generated code
// DllMain is normally called by _DllMainCRTStartup(), the default DLL entry point
// Therefore we replace the default entry point by our own version
// Make sure you specify this in the project file (/ENTRY:)

#include <windows.h>
#include "channelhook.h"

extern "C" BOOL WINAPI _DllMainCRTStartup(HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved);

BOOL WINAPI _NewDllMainCRTStartup(HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
	BOOL bRet;
	if (dwReason == DLL_PROCESS_ATTACH)
		// Call original DLL entry point first
		bRet = _DllMainCRTStartup(hDllHandle, dwReason, lpreserved);

		// And then install immediately Rich Error Hook

	if (dwReason == DLL_PROCESS_DETACH)
		// Remove Rich Error Hook

		// Call original DLL (entry)exit point
		bRet = _DllMainCRTStartup(hDllHandle, dwReason, lpreserved);

	return bRet;

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.


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


About the Author

Werner Willemsens
Team Leader
Belgium Belgium
No Biography provided

You may also be interested in...

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