You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by DUMOUCHEL David <Da...@sidel.com> on 2001/06/20 17:35:27 UTC

Access violation with a personal DLL i try to write...

I try to set up a simple DLL which code follows bellow. The building
succeeds, but i can t have access to it. Each time I try i obtain an
exception error:
"First chance exception in Project1.exe (MSVCRT.DLL) : 0xC0000005: Access
Violation" (Project1 is my Exe file to reach my DLL)
Thanks to answer if you have any idea...


//---------------------------------------------------------------------- My
C++ DLL
------------------------------------------------------------------------
// Test2.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "Test2.h"

//*************************  My includes for Xalan/Xerces
#include <Include/PlatformDefinitions.hpp>

#if defined(XALAN_OLD_STREAM_HEADERS)
#include <iostream.h>
#include <strstream.h>
#include <fstream.h>
#else
#include <iostream>
#include <strstream>
#include <fstream>
#endif

#include <util/PlatformUtils.hpp>
#include <Include/XalanAutoPtr.hpp>
#include <PlatformSupport/DOMStringHelper.hpp>
#include <XPath/XObjectFactoryDefault.hpp>
#include <XPath/XPathFactoryDefault.hpp>
#include <XSLT/StylesheetConstructionContextDefault.hpp>
#include <XSLT/StylesheetExecutionContextDefault.hpp>
#include <XSLT/XSLTEngineImpl.hpp>
#include <XSLT/XSLTInit.hpp>
#include <XSLT/XSLTInputSource.hpp>
#include <XSLT/XSLTProcessorEnvSupportDefault.hpp>
#include <XSLT/XSLTResultTarget.hpp>
#include <XalanSourceTree/XalanSourceTreeDOMSupport.hpp>
#include <XalanSourceTree/XalanSourceTreeParserLiaison.hpp>
//**************************

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    switch (ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		case DLL_PROCESS_DETACH:
			break;
    }
    return TRUE;
}


//********************* This is my exported function
TEST2_API int Fusion(void)
{
#if !defined(XALAN_NO_NAMESPACES)
	using std::cerr;
	using std::cout;
	using std::endl;
	using std::istrstream;
	using std::ofstream;
	using std::ostrstream;
#endif


XMLPlatformUtils::Initialize();
XSLTInit	theInit;

// Create some support objects that are necessary for running the
processor...
XalanSourceTreeDOMSupport		theDOMSupport;
XalanSourceTreeParserLiaison	theParserLiaison(theDOMSupport);

XMLPlatformUtils::Terminate();

return 555;
}


// This is the constructor of a class that has been exported.
// see Test2.h for the class definition
CTest2::CTest2()
{ 
	return; 
}



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org