How to use Dev c++ to create dll for Blitz3D?

Blitz3D Forums/Blitz3D Userlibs/How to use Dev c++ to create dll for Blitz3D?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi SAMMY,

yes it's another story, i just found this in the german blitzforum and guess what: it works !
Create a new dll project with c++ as language and
overwrite the 2 new files with this code. For me it works
with dev-c++ 4.9.9.2 and mingw 3.1.0

Here's the header file code:
// dll.h
#ifdef __cplusplus
#define EXPORT extern "C" __declspec (dllexport)
#else
#define EXPORT __declspec (dllexport)
#endif

EXPORT int CALLBACK mymagicfunction(int zahl1,int zahl2);


Here's the cpp code:
//dllmain.cpp
#include <windows.h>
#include "dll.h"

EXPORT int CALLBACK mymagicfunction(int zahl1,int zahl2)
{
       return (zahl1+zahl2);
}


Good luck !

--------------------------
www.moonworx.de