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

.NET equilavalent for Unmanaged Code

47 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;
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!