What's new

Why AutomationHook::Initialize crash ?

gbaudin

New Member
Why AutomationHook::Initialize crash ?

hi,
in the next c++ sample, i don't understand why the Initialize method call crash. ( I use VC++ 6 )
May someone could help me ?
thanks.

Code:
void ModelerSession::start
(
)
{
	try
	{
		stop();
		HRESULT hResult = mHook.GetActiveObject( _T( \"AlibreX.AutomationHook\" ) );
		mUserControl = true;
		if ( hResult != S_OK )
		{
			hResult = mHook.CreateInstance( _T( \"AlibreX.AutomationHook\" ) );
			mUserControl = false;
			if ( hResult != S_OK )
			{
				ASSERT( FALSE );
				TR_THROW
				(
					TrSysErrorInfos,
					TrSysObjectErrorInfos
					(
						hResult,
						_T( \"AlibreX.AutomationHook\" ),
						TRERRORINFOS_SOURCE( _T( \"start\" ) )
					)
				);
			}

			mHook->Initialize(   static_cast<LPCTSTR>(getAlibreServer()), _T(\"\"), _T(\"\"), false, 0 );

		}
		
		mEngine = mHook->Root;
		if ( isStarted() == false )
		{
			ASSERT( FALSE );
			TR_THROW
			(
				TrSysErrorInfos,
				TrSysObjectErrorInfos
				(
					hResult,
					_T( \"Root object is NULL\" ),
					TRERRORINFOS_SOURCE( _T( \"start\" ) )
				)
			);
		}

		setup();
	}

	TR_CATCH_ALL( _T( \"start\" ) );
}

getAlibreServer() method return the following HKey value:
HKCU\\Software\\Alibre, Inc.\\Alibre Design\\ServerAddress

Initialize call produce the following debug output:

Loaded 'C:\\Program Files\\Alibre Design\\Program\\ACISUtils.dll', no matching symbolic information found.
Loaded 'C:\\Program Files\\Alibre Design\\Program\\SpaAWarp.dll', no matching symbolic information found.
Loaded 'C:\\Program Files\\Alibre Design\\Program\\SpaBase.dll', no matching symbolic information found.
Loaded 'C:\\Program Files\\Alibre Design\\Program\\SpaACIS.dll', no matching symbolic information found.
Loaded 'C:\\Program Files\\Alibre Design\\Program\\SpaABlend.dll', no matching symbolic information found.
Loaded 'C:\\Program Files\\Alibre Design\\Program\\SpaAVis.dll', no matching symbolic information found.
Loaded 'C:\\Program Files\\Alibre Design\\Program\\SpaALops.dll', no matching symbolic information found.
Loaded 'C:\\Program Files\\Alibre Design\\Program\\SpaAPart.dll', no matching symbolic information found.
Loaded 'C:\\Program Files\\Alibre Design\\Program\\SpaASurf.dll', no matching symbolic information found.
Loaded 'C:\\Program Files\\Alibre Design\\Program\\SMACISContextServer.dll', no matching symbolic information found.
HEAP[TraceParts.exe]: Invalid Address specified to RtlFreeHeap( 00320000, 1A27FA60 )
First-chance exception in TraceParts.exe (MSADOX.DLL): 0xC0000005: Access Violation.
 
Top