Yes, but it takes a bit from several columns...
1. Define function pointer types:
typedef (CALLBACK* LPDBPROVOIDVOID)();
typedef (CALLBACK* LPDBPROVOIDDWORDINT)(DWORD,INT);
typedef (CALLBACK* LPDBPROVOIDINT)(INT);
typedef (CALLBACK* LPDBPROVOIDINTINT)(INT,INT);
typedef (CALLBACK* LPDBPROVOIDINTINTINT)(INT,INT,INT);
typedef (CALLBACK* LPDBPROVOIDINTINTFLOATFLOATFLOAT)(INT,INT,FLOAT,FLOAT,FLOAT);
typedef (CALLBACK* LPDBPROVOIDINTINTDWORD)(INT,INT,DWORD);
typedef int(CALLBACK* LPDBPROINTVOID)();
typedef int(CALLBACK* LPDBPROINTINT)(INT);
typedef DWORD(CALLBACK* LPDBPRODWORDINT)(INT);
typedef DWORD(CALLBACK* LPDBPROSTRINTINT)(DWORD,INT,INT);
That's a few of them...
2. Declare pointers and some handles...
GlobStruct* ptrCore = NULL;
// DBProSystemDebug.dll
HANDLE hDBProSystemDebug = NULL;
LPDBPROVOIDVOID dbEmptyChecklist = NULL;
LPDBPROINTVOID dbChecklistQuantity = NULL;
// DBProBasic3DDebug.dll
HANDLE hDBProBasic3DDebug = NULL;
LPDBPROVOIDVOID dbUnlockVertexData = NULL;
LPDBPROVOIDDWORDINT dbLoadObject = NULL;
LPDBPROINTINT dbObjectExist = NULL;
LPDBPROVOIDINT dbPerformChecklistForObjectLimbs = NULL;
LPDBPROSTRINTINT dbLimbName = NULL;
LPDBPROSTRINTINT dbLimbTextureName = NULL;
LPDBPROVOIDINTINTINT dbTextureLimb = NULL;
LPDBPROVOIDINTINTINT dbAddLimb = NULL;
LPDBPROVOIDINTINTINT dbLinkLimb = NULL;
LPDBPROVOIDINTINTFLOATFLOATFLOAT dbOffsetLimb = NULL;
LPDBPROVOIDINTINT dbLockVertexDataForLimb = NULL;
LPDBPROINTVOID dbGetVertexDataVertexCount = NULL;
LPDBPROINTVOID dbGetVertexDataIndexCount = NULL;
LPDBPRODWORDINT dbGetVertexDataPositionX = NULL;
LPDBPRODWORDINT dbGetVertexDataPositionY = NULL;
LPDBPRODWORDINT dbGetVertexDataPositionZ = NULL;
LPDBPRODWORDINT dbGetVertexDataNormalX = NULL;
LPDBPRODWORDINT dbGetVertexDataNormalY = NULL;
LPDBPRODWORDINT dbGetVertexDataNormalZ = NULL;
LPDBPRODWORDINT dbGetVertexDataU = NULL;
LPDBPRODWORDINT dbGetVertexDataV = NULL;
LPDBPROINTINT dbGetIndexData = NULL;
LPDBPRODWORDINT dbGetVertexDataDiffuse = NULL;
LPDBPRODWORDINT dbGetObjectDataPtr = NULL;
LPDBPROINTINT dbMeshExist = NULL;
LPDBPROVOIDINTINTINT dbMakeObject = NULL;
LPDBPROVOIDINT dbDeleteMesh = NULL;
// DBProLightDebug.dll
HANDLE hDBProLightDebug = NULL;
LPDBPROINTINT dbLightExist = NULL;
LPDBPROINTINT dbGetLightVisible = NULL;
LPDBPROINTINT dbGetLightType = NULL;
LPDBPRODWORDINT dbGetLightRange = NULL;
LPDBPRODWORDINT dbGetLightPositionX = NULL;
LPDBPRODWORDINT dbGetLightPositionY = NULL;
LPDBPRODWORDINT dbGetLightPositionZ = NULL;
LPDBPRODWORDINT dbGetLightDirectionX = NULL;
LPDBPRODWORDINT dbGetLightDirectionY = NULL;
LPDBPRODWORDINT dbGetLightDirectionZ = NULL;
LPDBPROINTINT dbSetVector3ToLightRotation = NULL;
// DBProCameraDebug.dll
HANDLE hDBProCameraDebug = NULL;
LPDBPROINTINT dbCameraExist = NULL;
LPDBPRODWORDINT dbGetCameraPositionX = NULL;
LPDBPRODWORDINT dbGetCameraPositionY = NULL;
LPDBPRODWORDINT dbGetCameraPositionZ = NULL;
LPDBPRODWORDINT dbGetCameraAngleX = NULL;
LPDBPRODWORDINT dbGetCameraAngleY = NULL;
LPDBPRODWORDINT dbGetCameraAngleZ = NULL;
// DBProVectorsDebug.dll
HANDLE hDBProVectorsDebug = NULL;
LPDBPROINTINT dbMakeVector3 = NULL;
LPDBPROINTINT dbDeleteVector3 = NULL;
LPDBPRODWORDINT dbGetXVector3 = NULL;
LPDBPRODWORDINT dbGetYVector3 = NULL;
LPDBPRODWORDINT dbGetZVector3 = NULL;
LPDBPRODWORDINT dbGetLengthVector3 = NULL;
//DBProMemblocksDebug.dll
HANDLE hDBProMemblocksDebug = NULL;
LPDBPROINTINT dbMemblockExist = NULL;
LPDBPROVOIDINTINT dbMakeMemblock = NULL;
LPDBPROVOIDINT dbDeleteMemblock = NULL;
LPDBPRODWORDINT dbGetMemblockPtr = NULL;
LPDBPROVOIDINTINT dbMakeMeshFromMemblock = NULL;
3. Make the linkage based on the DLL you want to use. First. you need to get and save the globstruct pointer, of course...
JZCOLLADA_API void ReceiveCoreDataPtr(LPVOID pCore)
{
HRESULT hr;
ptrCore = (GlobStruct*)pCore;
if (ptrCore->g_Systemmade) // system commands
{
hDBProSystemDebug = ptrCore->g_System;
dbChecklistQuantity = (LPDBPROINTVOID)
GetProcAddress((HMODULE)hDBProSystemDebug,
"?ChecklistQuantity@@YAHXZ");
dbEmptyChecklist = (LPDBPROVOIDVOID)
GetProcAddress((HMODULE)hDBProSystemDebug,
"?EmptyChecklist@@YAXXZ");
//
}
if (ptrCore->g_Basic3Dmade) // basic 3D commands
{
hDBProBasic3DDebug = ptrCore->g_Basic3D;
dbUnlockVertexData = (LPDBPROVOIDVOID)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?UnlockVertexData@@YAXXZ");
dbLoadObject = (LPDBPROVOIDDWORDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug, "?Load@@YAXKH@Z");
dbObjectExist = (LPDBPROINTINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetExist@@YAHH@Z");
dbPerformChecklistForObjectLimbs = (LPDBPROVOIDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?PerformCheckListForLimbs@@YAXH@Z");
dbLockVertexDataForLimb = (LPDBPROVOIDINTINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?LockVertexDataForLimb@@YAXHH@Z");
dbGetVertexDataVertexCount = (LPDBPROINTVOID)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetVertexDataVertexCount@@YAHXZ");
dbGetVertexDataIndexCount = (LPDBPROINTVOID)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetVertexDataIndexCount@@YAHXZ");
dbGetVertexDataPositionX = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetVertexDataPositionX@@YAKH@Z");
dbGetVertexDataPositionY = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetVertexDataPositionY@@YAKH@Z");
dbGetVertexDataPositionZ = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetVertexDataPositionZ@@YAKH@Z");
dbGetVertexDataNormalX = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetVertexDataNormalsX@@YAKH@Z");
dbGetVertexDataNormalY = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetVertexDataNormalsY@@YAKH@Z");
dbGetVertexDataNormalZ = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetVertexDataNormalsZ@@YAKH@Z");
dbGetVertexDataU = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetVertexDataU@@YAKH@Z");
dbGetVertexDataV = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetVertexDataV@@YAKH@Z");
dbLimbName = (LPDBPROSTRINTINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetLimbName@@YAKKHH@Z");
dbLimbTextureName = (LPDBPROSTRINTINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetLimbTextureName@@YAKKHH@Z");
dbGetIndexData = (LPDBPROINTINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetIndexData@@YAHH@Z");
dbGetVertexDataDiffuse = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetVertexDataDiffuse@@YAKH@Z");
dbGetObjectDataPtr = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetObjectA@@YAPAUsObject@@H@Z");
dbMeshExist = (LPDBPROINTINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?GetMeshExist@@YAHH@Z");
dbDeleteMesh = (LPDBPROVOIDINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?DeleteMesh@@YAXH@Z");
dbMakeObject = (LPDBPROVOIDINTINTINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?MakeObject@@YAXHHH@Z");
dbTextureLimb = (LPDBPROVOIDINTINTINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?TextureLimb@@YAXHHH@Z");
dbAddLimb = (LPDBPROVOIDINTINTINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?AddLimb@@YAXHHH@Z");
dbLinkLimb = (LPDBPROVOIDINTINTINT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?LinkLimb@@YAXHHH@Z");
dbOffsetLimb = (LPDBPROVOIDINTINTFLOATFLOATFLOAT)
GetProcAddress((HMODULE)hDBProBasic3DDebug,
"?OffsetLimb@@YAXHHMMM@Z");
}
if (ptrCore->g_Light3Dmade) // lights commands
{
hDBProLightDebug = ptrCore->g_Light3D;
dbLightExist = (LPDBPROINTINT)
GetProcAddress((HMODULE)hDBProLightDebug,
"?GetExistEx@@YAHH@Z");
dbGetLightType = (LPDBPROINTINT)
GetProcAddress((HMODULE)hDBProLightDebug,
"?GetTypeEx@@YAHH@Z");
dbGetLightVisible = (LPDBPROINTINT)
GetProcAddress((HMODULE)hDBProLightDebug,
"?GetVisibleEx@@YAHH@Z");
dbGetLightRange = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProLightDebug,
"?GetRangeEx@@YAKH@Z");
dbGetLightPositionX = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProLightDebug,
"?GetXPositionEx@@YAKH@Z");
dbGetLightPositionY = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProLightDebug,
"?GetYPositionEx@@YAKH@Z");
dbGetLightPositionZ = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProLightDebug,
"?GetZPositionEx@@YAKH@Z");
dbGetLightDirectionX = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProLightDebug,
"?GetXDirectionEx@@YAKH@Z");
dbGetLightDirectionY = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProLightDebug,
"?GetYDirectionEx@@YAKH@Z");
dbGetLightDirectionZ = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProLightDebug,
"?GetZDirectionEx@@YAKH@Z");
}
if (ptrCore->g_Camera3Dmade) // camera commands
{
hDBProCameraDebug = ptrCore->g_Camera3D;
dbCameraExist = (LPDBPROINTINT)
GetProcAddress((HMODULE)hDBProCameraDebug,
"?GetExistEx@@YAHH@Z");
dbGetCameraPositionX = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProCameraDebug,
"?GetXPositionEx@@YAKH@Z");
dbGetCameraPositionY = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProCameraDebug,
"?GetYPositionEx@@YAKH@Z");
dbGetCameraPositionZ = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProCameraDebug,
"?GetZPositionEx@@YAKH@Z");
dbGetCameraAngleX = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProCameraDebug,
"?GetXAngleEx@@YAKH@Z");
dbGetCameraAngleY = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProCameraDebug,
"?GetYAngleEx@@YAKH@Z");
dbGetCameraAngleZ = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProCameraDebug,
"?GetZAngleEx@@YAKH@Z");
}
if (ptrCore->g_Vectorsmade) // vectors commands
{
hDBProVectorsDebug = ptrCore->g_Vectors;
dbMakeVector3 = (LPDBPROINTINT)
GetProcAddress((HMODULE)hDBProVectorsDebug,
"?MakeVector3@@YAHH@Z");
dbDeleteVector3 = (LPDBPROINTINT)
GetProcAddress((HMODULE)hDBProVectorsDebug,
"?DeleteVector3@@YAHH@Z");
dbGetXVector3 = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProVectorsDebug,
"?GetXVector3@@YAKH@Z");
dbGetYVector3 = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProVectorsDebug,
"?GetYVector3@@YAKH@Z");
dbGetZVector3 = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProVectorsDebug,
"?GetZVector3@@YAKH@Z");
dbGetLengthVector3 = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProVectorsDebug,
"?GetLengthVector3@@YAKH@Z");
}
if (ptrCore->g_Memblocksmade) // memblocks commands
{
hDBProMemblocksDebug = ptrCore->g_Memblocks;
dbMemblockExist = (LPDBPROINTINT)
GetProcAddress((HMODULE)hDBProMemblocksDebug,
"?MemblockExist@@YAHH@Z");
dbMakeMemblock = (LPDBPROVOIDINTINT)
GetProcAddress((HMODULE)hDBProMemblocksDebug,
"?MakeMemblock@@YAXHH@Z");
dbGetMemblockPtr = (LPDBPRODWORDINT)
GetProcAddress((HMODULE)hDBProMemblocksDebug,
"?GetMemblockPtr@@YAKH@Z");
dbDeleteMemblock = (LPDBPROVOIDINT)
GetProcAddress((HMODULE)hDBProMemblocksDebug,
"?DeleteMemblock@@YAXH@Z");
dbMakeMeshFromMemblock = (LPDBPROVOIDINTINT)
GetProcAddress((HMODULE)hDBProMemblocksDebug,
"?CreateMeshFromMemblock@@YAXHH@Z");
}
Use them like this:
dbMakeMemblock(memblock, mbsize);
pbyte = (LPBYTE)dbGetMemblockPtr(memblock);
dbDeleteMemblock(memblock);