Valued Contributor
Posts: 86
Registered: ‎07-22-2006
Message 1 of 1 (46 Views)

.NET equilavalent for Unmanaged Code

46 Views, 0 Replies
07-26-2006 11:08 PM
Can any body plz give me .NET equalvalent of the below code:-


typedef Acad::ErrorStatus
(AcDbDatabase* pDb, bool bUnused);

Acad::ErrorStatus MakeThumbnail(AcDbDatabase* pDb)
static acdbMakeDrawingPreviewPtr pFunc = NULL;
if( pFunc == NULL )
HMODULE hLib = GetArxModuleHandle("AcBlock.arx");
if( hLib == NULL )
return Acad::eInvalidInput;
void* pv = ::GetProcAddress(hLib,
if( pv == NULL )
return Acad::eInvalidInput;
pFunc = (acdbMakeDrawingPreviewPtr) pv;
if( pDb == NULL )
return Acad::eInvalidInput;
return (*pFunc)(pDb, false);

// moduleName (filename.arx) must be on PATH.

HMODULE GetArxModuleHandle(const char* moduleName)
HMODULE hLib = ::GetModuleHandle(moduleName);
if( hLib == NULL )
acrxLoadModule(moduleName, false, false);
hLib = ::GetModuleHandle(moduleName);
return hLib;
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.