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

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

Happy Sammy(Posted 2005) [#1]
Hi all,

How to use Dev c++ to create dll for Blitz3D?
Is the process very different from VC++?

Thanks in advance.
Sammy


lo-tekk(Posted 2005) [#2]
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


Happy Sammy(Posted 2005) [#3]
Thank you very much.

Sammy


slenkar(Posted 2007) [#4]
I created a decls file to go witb this:

magic.decls
.lib "magic.dll"

mymagicfunction(zahl1%,zahl2%)

If i try to use the function by itself it compiles
but when I try to put c=mymagicfunction(a,b) it says 'wrong return type'
Also the command is not highlighted blue

EDIT - fixed
.lib "magic.dll"

mymagicfunction%(zahl1%,zahl2%)

it was missing a %