Here is my code.
// Dev C++ main.cpp
// Include the header
#include "header.h"
// Include other headers here.
// Whatever code here.
// Display a messagebox
DLLCMDC void MyMessageBox(LPSTR szMessage, LPSTR szTitle)
{
// Display a message
MessageBoxA(GetGlobStruct()->hWnd,szMessage,szTitle,MB_OK);
}
// header.h
/*
There are several flags which can be defined to help the DBPPluginTemplate
best perform to your needs. They are listed and described below:
INCLUDE_DIRECTX - This will include d3d9.h, and d3dx9.h. This
will help you if you are doing some
Direct3D work.
NO_EXTRADX_FUNCTIONS - This will strip out an automatically created
Direct3D Object, and Direct3D Device, which
would be automatically set to DBP's D3D
object, and device.
NO_GLOBSTRUCT - This will keep GlobStruct from being
included. If GlobStruct isn't used, this
will help keep your output DLL small.
EXTRA_DBPDATA - This will include extra internal structures
of DBP, such as the sObject, sMesh, etc.
This is mainly for very special plugins
which deal with manipulation.
NO_EXTRA_DBPCOMMANDS - This will keep all DBP commands from being
able to be used in the plugin. There are a
series of other flags which will help you
keep certain
NO_HELPER_FUNCTIONS - This will keep functions such as dbpstring,
dbpfloat, GetGlobstruct, etc, out of the
plugin.
The following are alternatives to NO_EXTRA_DBPCOMMANDS:
EXCLUDE_ADVANCEDTERRAIN
EXCLUDE_ANIMATION
EXCLUDE_BASIC2D
EXCLUDE_BASIC3D
EXCLUDE_BITMAP
EXCLUDE_CAMERA
EXCLUDE_CORE
EXCLUDE_FILE
EXCLUDE_FTP
EXCLUDE_GAMEFX
EXCLUDE_IMAGE
EXCLUDE_INPUT
EXCLUDE_LIGHT
EXCLUDE_TERRAIN
EXCLUDE_MATRIX
EXCLUDE_MEMBLOCKS
EXCLUDE_MULTIPLAYER
EXCLUDE_MUSIC
EXCLUDE_PARTICLES
EXCLUDE_SETUP
EXCLUDE_SOUND
EXCLUDE_SPRITES
EXCLUDE_SYSTEM
EXCLUDE_TEXT
EXCLUDE_VECTORS
EXCLUDE_WORLD3D
*/
// Main Include
#include <DBPPlugin/DBPPlugin.h>
// Your includes here
// commands.rc
// Resource Script
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
//#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
#ifdef _WIN32
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
1 "DISPLAY MESSAGEBOX%SS%MyMessageBox"
// Your string table goes here.
// You must have at least ONE command for this to compile correctly.
// Here is an example:
/*
1 "STARTUP%0%StartupFunction" // void StartupFunction(void);
2 "GETVALUE[%L%GetValueFunction" // int GetValueFunction(void);
3 "GETSUM[%LLL%GetSumFunction" // int GetSumFunction(int p0, int p1);
*/
// Extra information about the string tables, for quick lookup.
/* L = Integer ( IN use "int" ) ( OUT use "int" )
F = Float ( IN use "float" ) ( OUT use "DWORD" )
S = String ( IN use "LPSTR" ) ( OUT use "DWORD" )
O = Double Float (capital o) ( IN use "double" ) ( OUT use "double" )
R = Double Integer (capital r) ( IN use "LONGLONG" ) ( OUT use "LONGLONG" )
D = Boolean, BYTE, WORD and DWORD ( IN use "DWORD" ) ( OUT use "DWORD" )
0 = Zero Character (no param) ( IN use "VOID" ) ( n/a )
H = Array ( IN use ? ) ( OUT use ? )
X = Any type ( IN use "const void*" ) ( OUT use "const void*" )
A = Special List Processing ( IN use ? ) ( OUT use ? )
* = Designate a return type */
END
#endif // English resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED