| When 3D World Studio loads this plugin, a notification for "PluginClass" comes up, then the program crashes on the MemCopy line. 
 The current version of 3D World Studio was written in BlitzPlus.
 
 Here is the source:
 
 Framework brl.system
Strict
Const PLUGIN_MESHLOAD=8
Function PluginClass(inbuffer:Byte Ptr,insize:Int,outbuffer:Byte Ptr,outsize:Int) "win32"
	GCEnter()
	Notify "PluginClass"
	MemCopy outbuffer,Int Ptr PLUGIN_MESHLOAD,4
	Notify "OK"
EndFunction
Function PluginDescription(inbuffer:Byte Ptr,insize:Int,outbuffer:Byte Ptr,outsize:Int) "win32"
	GCEnter()
	Notify "PluginDescription"
	Local s$,cs:Byte Ptr
	s="Load Leadwerks models"
	cs=s.tocstring()
	MemCopy outbuffer,Varptr s,s.length+1
	MemFree cs
EndFunction
Function PluginFileExtension(inbuffer:Byte Ptr,insize:Int,outbuffer:Byte Ptr,outsize:Int) "win32"
	GCEnter()
	Notify "PluginFileExtension"
	Local s$,cs:Byte Ptr
	s="mdl"
	cs=s.tocstring()
	MemCopy outbuffer,Varptr s,s.length+1
	MemFree cs
EndFunction
Function PluginMeshLoad(inbuffer:Byte Ptr,insize:Int,outbuffer:Byte Ptr,outsize:Int) "win32"
	GCEnter()
	Notify "PluginMeshLoad"
EndFunction 
 Here is a similar plugin written in PureBasic:
 
 ;Indicate what the plugin does
ProcedureDLL PluginClass(*inbuffer,insize,*outbuffer,outsize)
  PokeL(*outbuffer,#PLUGIN_MESHLOAD)
EndProcedure
;Text to describe plugin
ProcedureDLL PluginDescription(*inbuffer,insize,*outbuffer,outsize)
  PokeS(*outbuffer,"Load Leadwerks meshes.")
EndProcedure
;Extension for program to use
ProcedureDLL PluginFileExtension(*inbuffer,insize,*outbuffer,outsize)
  PokeS(*outbuffer,"mesh")
EndProcedure 
 
 |