.NET

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

.NET equilavalent for Unmanaged Code

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


-------------------------

typedef Acad::ErrorStatus
(*acdbMakeDrawingPreviewPtr)
(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,
"acdbMakeDrawingPreview");
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;
}
-------------------
Thanks...
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.