Dean - I'm interested in statically linking xerces as well. Could you keep us apprised of your efforts along these lines? After you get the changes in, a brief tech note dealing how to do it under VC++ would be very helpful...
Ed -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 05, 2000 1:21 PM To: [EMAIL PROTECTED] Subject: Re: Xerces as a static library for Win32 Actually, the who finding of the library path will likely go away soon because changes in ICU will no longer require that do have such a thing. For the other thing with the export keywords, we could certainly wrap that with an XML_NOEXPORT or something like that I guess, so that you could force the EXPORT/IMPORT keywords to define to nothing if you needed them to. ---------------------------------------- Dean Roddey Software Weenie IBM Center for Java Technology - Silicon Valley [EMAIL PROTECTED] "Jean Georges PERRIN" <[EMAIL PROTECTED]> on 01/05/2000 06:24:25 AM Please respond to [EMAIL PROTECTED] To: <[EMAIL PROTECTED]> cc: Subject: Xerces as a static library for Win32 1/ In some cases, we do not want DLLs, so I modified the code of Xerces in order to use it statically. As I think this could be useful to others, here is what I changed (Using Visual C++ 6 on NT 4)... 1.1/ in Win32PlatformUtils.cpp void XMLPlatformUtils::platformInit() { // 1.80.014 2000/01/05 jgp Added the test around XML_SINGLEDLL #if defined(XML_SINGLEDLL) // // Lets get our own DLL path and store it. The fgLibLocation static // member must be filled in with the path to the shared Lib or DLL // so that other code can find any files relative to it. // HINSTANCE hmod = ::GetModuleHandleA(XML4C_DLLName); if (!hmod) { // // If we didn't find it, its probably because its a development // build which is built as separate DLLs, so lets look for the DLL // that we are part of. // static const char* const privDLLName = "IXUTIL"; hmod = ::GetModuleHandle(privDLLName); // If neither exists, then we give up if (!hmod) panic(Panic_CantFindLib); } // // Get the path to our module. We explicitly get the ASCII version here // since its stored as ASCII (or the local code page to be more specific, // so it might be EBCDIC on some platforms.) // char tmpBuf[MAX_PATH + 1]; if (!::GetModuleFileNameA(hmod, tmpBuf, MAX_PATH)) panic(Panic_CantFindLib); // Find the last separator in the list and put a null in the next char char* sepPtr = 0; sepPtr = strrchr(tmpBuf, '\\'); if (sepPtr) *(sepPtr+1)= 0; const unsigned int pathLen = strlen(tmpBuf); // Allocate a buffer and copy the text into it. Then store it in the static char* actualBuf = new char[pathLen + 1]; strcpy(actualBuf, tmpBuf); fgLibLocation = actualBuf; #else fgLibLocation = NULL; #endif // XML_SINGLEDLL ... 1.2/ in VCPPDefs.hpp replace #define PLATFORM_EXPORT __declspec(dllexport) #define PLATFORM_IMPORT __declspec(dllimport) by #if defined(XML_SINGLEDLL) #define PLATFORM_EXPORT __declspec(dllexport) #define PLATFORM_IMPORT __declspec(dllimport) #else #define PLATFORM_EXPORT #define PLATFORM_IMPORT #endif Note : I have used XML_SINGLEDLL as it did not seem to be used elsewhere and was already defined. The whole library is very nice indeed, commented, clear and really easy to follow up. Nice work ! Hope my humble contribution could help... 2/ How can I subscribe to this mailing list ? 3/ Any URL to point to a nice DOM tutorial (I could buy a book, but I need it desesperatly quickly...) TIA Jean Georges PERRIN -- Four J's Development Tools (www.4js.com) [EMAIL PROTECTED] - Tel +33 (0)3 88 18 61 20 - Fax +33 (0)3 88 18 61 21 -- CAUTION: import com.fourjs.StandardDisclaimer;