I use Delphi to create .DLL's. Since Pascal is more like Basic, I find it far more easy to work with it than C++.
I tried the following thing:
(1) In Visual Studio goto File->New->Projects->Win32 Dynamic Link Library
(2) Enter project name "test2" and press "Ok"
(3) Select "An empty DLL project" and press "Finish"
(4) File -> New -> Files -> C++ Source File
(5) Enter a file name and press "Ok"
(6) Paste this:
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define BBDECL extern "C" _declspec(dllexport)
#define BBCALL _stdcall
BBDECL float BBCALL Formula( float ax,float bx,float cx,float dx,float e ){
return (ax*ax*ax*ax+bx*bx*bx+cx*cx+dx+e);
}
(7) Press Build (F7)
(8) Copy the compiled .DLL in the userlibs directory
(9) Make an empty text file in the userlibs directory, and paste this:
.lib "test2.dll"
Formula#(ax#, bx#, cx#, dx#, e#):"_Formula@20"
--> And save it/rename it to "test2.decls"
(10) **Notice that the .dll name in the decls should be the same as the compiled dll
(11) **The @20 equals the number of bytes passed to the function. In this case, 5 floats x 4 bytes. Integers are 4 bytes, too.
(12) Test the function in Blitz using this:
Print Formula(1,1,1,1,1)
WaitKey()
End
These links show examples of DLL's in C++:
On this page is the original documentation:
http://www.blitzbasic.com/sdkspecs/sdkspecs.phpThese are just random links containing DLL's:
http://www.blitzbasic.com/Community/posts.php?topic=51944http://www.blitzbasic.com/codearcs/codearcs.php?code=1639http://www.google.nl/search?hl=nl&safe=active&q=bbcall+blitz3d&meta=
http://www.blitzforum.de/forum/viewtopic.php?t=254&sid=1434dc251f0bca47fc770a1175c994b2