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;