Click here to Skip to main content
12,998,363 members (61,715 online)
Click here to Skip to main content
Articles » Languages » XML » XSLT » Downloads


31 bookmarked
Posted 10 Sep 2001

Using XSLT to render XML data returned by a COM object

, 12 Sep 2001
This is a 3-tier application. A COM component returns SQL data in XML format, then using XSLT to transform to HTML at client side. By using XML, all the data can be sort, split into pages locally, that will give users a quick response!
// xmlrs.cpp : Implementation of DLL Exports.

// Note: Proxy/Stub Information
//      To merge the proxy/stub code into the object DLL, add the file 
//      dlldatax.c to the project.  Make sure precompiled headers 
//      are turned off for this file, and add _MERGE_PROXYSTUB to the 
//      defines for the project.  
//      If you are not running WinNT4.0 or Win95 with DCOM, then you
//      need to remove the following define from dlldatax.c
//      #define _WIN32_WINNT 0x0400
//      Further, if you are running MIDL without /Oicf switch, you also 
//      need to remove the following define from dlldatax.c.
//      #define USE_STUBLESS_PROXY
//      Modify the custom build rule for xmlrs.idl by adding the following 
//      files to the Outputs.
//          xmlrs_p.c
//          dlldata.c
//      To build a separate proxy/stub DLL, 
//      run nmake -f in the project directory.

#include "stdafx.h"
#include "resource.h"
#include <initguid.h>
#include "xmlrs.h"
#include "dlldatax.h"

#include "xmlrs_i.c"
#include "xmlrsobj.h"

extern "C" HINSTANCE hProxyDll;

CComModule _Module;

OBJECT_ENTRY(CLSID_xmlrsobj, Cxmlrsobj)

// DLL Entry Point

extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
    if (!PrxDllMain(hInstance, dwReason, lpReserved))
        return FALSE;
    if (dwReason == DLL_PROCESS_ATTACH)
        _Module.Init(ObjectMap, hInstance, &LIBID_XMLRSLib);
    else if (dwReason == DLL_PROCESS_DETACH)
    return TRUE;    // ok

// Used to determine whether the DLL can be unloaded by OLE

STDAPI DllCanUnloadNow(void)
    if (PrxDllCanUnloadNow() != S_OK)
        return S_FALSE;
    return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;

// Returns a class factory to create an object of the requested type

STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
    if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK)
        return S_OK;
    return _Module.GetClassObject(rclsid, riid, ppv);

// DllRegisterServer - Adds entries to the system registry

STDAPI DllRegisterServer(void)
    HRESULT hRes = PrxDllRegisterServer();
    if (FAILED(hRes))
        return hRes;
    // registers object, typelib and all interfaces in typelib
    return _Module.RegisterServer(TRUE);

// DllUnregisterServer - Removes entries from the system registry

STDAPI DllUnregisterServer(void)
    return _Module.UnregisterServer(TRUE);

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Alan Wen
Web Developer
China China
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170622.1 | Last Updated 13 Sep 2001
Article Copyright 2001 by Alan Wen
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid