Here's my DECLs:
Code: Select all
.lib "Save_X_Mesh.dll"
SaveXMesh(filename$, entity%) : "Save_X_Mesh"Here's my source:
Code: Select all
#TESTDLL = 0
CompilerIf #TESTDLL = 0
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
; These 4 procedures are Windows specific
;
; This procedure is called once, when the program loads the library
; for the first time. All init stuffs can be done here (but not DirectX init)
;
ProcedureDLL AttachProcess(Instance)
EndProcedure
; Called when the program release (free) the DLL
;
ProcedureDLL DetachProcess(Instance)
EndProcedure
; Both are called when a thread in a program call or release (free) the DLL
;
ProcedureDLL AttachThread(Instance)
EndProcedure
ProcedureDLL DetachThread(Instance)
EndProcedure
CompilerEndIf
Prototype.i ProtoSave_X_Mesh(filename.s, entity.i)
ProcedureDLL Save_X_Mesh(filename.s, entity.i)
MP_SaveMesh(filename.s, entity.i)
EndProcedure
If OpenLibrary(0, "Save_X_Mesh.dll")
SaveXMesh.ProtoSave_X_Mesh = GetFunction(0, "Save_X_Mesh")
Save_X_Mesh(filename.s, entity.i)
EndIf
CompilerElse
Prototype
If OpenLibrary(0, "Save_X_Mesh.dll") Or OpenLibrary(0, "Save_X_Mesh.so")
CallFunction(0, "Save_X_Mesh", @filename.s, @entity.i)
EndIf
CompilerEndIf~Mythros



