Was trying to code up a new DLL today, simply because..
ran into a slight snafoo though.
#ifdef _MANAGED
#pragma managed(push, off)
#endif
#define Function __declspec ( dllexport )
extern "C"
{
Function int TestDirect3D( void );
}
// Include Core (optional)
#include "globstruct.h"
GlobStruct* DarkBasic = NULL;
// Constructors
void Constructor ( void ) { }
void Destructor ( void ) { }
void ReceiveCoreDataPtr ( LPVOID pCore ) { DarkBasic = (GlobStruct*)pCore; }
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
int TestDirect3D( void )
{
IDirect3D9* Direct3D = NULL;
IDirect3DDevice9* Device = NULL;
IDirect3DTexture9* Texture = DarkBasic->pCurrentBitmapTexture;
Texture->GetDevice(&Device); // Grab the Direct3D Device
Device->GetDirect3D(&Direct3D); // Grab the Direct3D Instance
// GC
if(Direct3D)
Direct3D->Release();
if(Device)
Device->Release();
return S_OK;
}
for some reason that just silently quits DBP.
I'm using Visual C++ 2005 Professional Beta 2, Platform SDK 2003 Service Pack 1, DirectX 9.0c (9.06)
Using DBP 5.3 Trial, because anoyone says 'update it'.
Two reasons, can't find my CD.. and I want to support the Trial version too.