Passing a type to a dll
BlitzMax Forums/BlitzMax Programming/Passing a type to a dll
| ||
Has anyone succeeded in getting Type data passed to a dll. I am having issues getting the pointer to the type and passing that to the function. I get errors like : - Unable to convert from "iNet" to Long Ptr. Module Info: Extern "WIN32" Function tnetscore:Int(g:Long Ptr) EndExtern Type Structure Type iNet Field Server:String Field Script:String Field Extip:String Field Port:String Field GameName:String Field GameServer:String End Type |
| ||
Did you try Byte Ptr? They are normally used to "export" data from BM to C / C++ functions |
| ||
Yeah that stopped the errors but all that is being sent is a load of trash. Every single Field contains the same trash :- €µH |
| ||
Should your Fields maybe be String Ptr's ? |
| ||
try $z instead of :String |
| ||
that did not work either, infact the fields are now empty. |
| ||
well it's a step up from€µH :) $z is a c-style string so I would imagine you *have* to do that (either that or use Byte Ptr). Local f:Byte Ptr f = "test" Print "".fromCString(f) |
| ||
from memory each max type has a small header try passing a byte ptr to the first field... |