I have been having problems again. As soon as you crash DB Pro using that plugin it seems to repeat even if you revert back to working code. The only way to fix it is if you start over with a fresh copy of the MSVC++ 6.0 project.
I have found this to be a problem in Dev C++ as well. I did everything I could to fix it. I used clean so it would delete all the files. Nothing seems get it working with in the project that you have experienced crashes.
Edit:
I played around with it a bit to figure where it was crashing and I found exactly where it was crashing.
// The constructor (called when the plugin is loaded)
DLLCMD void __cdecl Constructor(void)
{
// This MUST be called before anything else, so we put it in the Constructor function.
MessageBox(0,"1","1",MB_OK);
InitPluginSDK();
MessageBox(0,"2","2",MB_OK);
// Get GlobStruct
g_pGlobStruct = getGlobStruct();
MessageBox(0,"3","3",MB_OK);
// If you have anything you need to initialize, independant of any of DBPro's commands,
// do so here.
}
It only displays a message box that displays 1 and crashes. This means the line that isn't working is:
That is far as I can get. You might want to debug this function:
INLINE void __stdcall _DBPPluginSDK_Startup_(void)
{
static u32 sdkInitialized = 0;
if (!sdkInitialized)
{
sdkInitialized = 1;
#if (defined(DBPPSDK_INCLUDE_COMMANDS))
_DBPPluginSDK_InitCommands_(); // We must retrieve all the commands - or else they can't be used!
#endif
#if (defined(DBPPSDK_INCLUDE_EXTRA_DIRECTX))
dbGetDirect3D(); // Initialize the function at start up to keep things clean
dbGetDirect3DDevice(); // Initialize this function, too at start up to keep things clean
#endif
#if (defined(DBPPSDK_INCLUDE_GLOBSTRUCT) && defined(DBPPSDK_INCLUDE_HELP))
getGlobStruct(); // Retrieve the pointer to the GlobStruct
#endif
}
}
You may be able to figure out what is going on and where exactly it crashes by using messages boxes.
I been with the project since the Dev C++ version and I found the same problem in both Dev C++ and MSVC++.
Edit:
That may be because why DirectX commands didn't work. It was during the point that it was crashing a ton. If this can be fixed then you may be able to use DirectX commands!
Edit:
Fixed
I got the crashes resolved by adding a bunch of useless DB Pro commands in a do not call function. Can make it so you don't have to include a command from each dll? Are you able to resolve these crashes by making sure that the dlls loaded? Can you load them somehow?
Get DirectX Version() - Works when I used the text command
Edit: Questions
- Can you make sure that the DBP dlls loaded in the Constructor function?
- I don't understand how you return strings.
Is this how it works:
static sDBProString dbpStr;
dbpStr.set(pszOldString, "MyString");
return reinterpret_cast<char*>(dbpStr.apply());
Right?
Edit: I finally get it!
- You have to include commands from each section or dll. (I think this is done by the compiler) This is how the dll is loaded so you can use the commands. I wish you could find a way around this. I know that other plugins have been able to. How did they do it? I know of a few open source plugins like cloggy's 3d line plugin.
- Clear Screen command works. I have no clue why. I can't find what command it depends on. You a least have to have one other command other then Clear Screen.
- This means the DirectX Device works! Yeah!
Let me know if you find out anything.
Thanks,
Dark Fire
My future self met up with one day to teach me what I know today.