Page 1 of 1
First time DLL user help
Posted: Mon Feb 28, 2011 4:24 pm
by AndyMK
I have a dll and i can list all its function names and addresses. Do i just use callfunction commands or can i use prototypes? If so how? The docs say that prototype is better?
These are the commands listed:
Code: Select all
_ENetCheckEvents@12
_ENetConnect@8
_ENetCreate@24
_ENetDeInitialize@0
_ENetDisconnect@4
_ENetDoEventCheck@4
_ENetGetNumClients@0
_ENetInitialize@0
_ENetSendData@16
Re: First time DLL user help
Posted: Mon Feb 28, 2011 5:18 pm
by skywalk
Re: First time DLL user help
Posted: Mon Feb 28, 2011 5:19 pm
by AndyMK
Thanks

Re: First time DLL user help
Posted: Mon Feb 28, 2011 5:25 pm
by UrgentKettle
If you have the lib file then you can use IMPORT. If you only have the DLL then you can either use PROTOTYPES (which also gives the benefit of detecting the presence of the DLL at runtime) or use the DLL importer utility in the PureBasic SDK (..\purebasic\sdk\dll importer).
I find that the PROTOTYPE method is the best as it gives you parameter hints in the IDE when using the functions. It is slightly more work to write the code for PROTOTYPE but worth it IMHO.
Re: First time DLL user help
Posted: Mon Feb 28, 2011 7:54 pm
by AndyMK
I done it with prototypes in the end and it works nice BUT the lib does not include any functions to get the ip or port for a connected client so its useless

.. I am trying to do some udp holepunching and having reliable udp would have made it much easier.
Re: First time DLL user help
Posted: Mon Feb 28, 2011 8:02 pm
by AndyMK
Is it possible to access structures inside the dll?