Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Pro & .dll help-- Raven or another qualifying person

Author
Message
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 15th Apr 2003 17:41
All the single bytes passes work but "word" and "Dword" passes exit the DBPro .exe. Can someone make this work?

Thanks
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 15th Apr 2003 19:18
Oh, I forgot, the dll is here [href]realgametools.net/forums/attachments/io.zip[/href]
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 16th Apr 2003 00:31
well i think Toad or IanM would be better suited to answer this...
i dont' recognise the io.dll - and i had a look in it but the functions arn't decorated in C++ mannor. They're not even decorated in standard C mannor.

one possibility could be that the data being passed is unable to be interpreted by DarkBasic Pro ... perhaps they're using _int64 rather than _int32

if this is the case then you'll have to change the word to a dword and the dword to a double integer.
if you've set this DLL up yourself change all of the values out into DWORD and the values in to int or DWORD ... it may solve the problem. other than that, i'm not entirely sure

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Apr 2003 01:14
All the indications make me believe that it's written in Delphi.

You should try setting your 'port' variable to the correct type first - it should be a word, not a byte. Give it a go, and let us know how you get on
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 16th Apr 2003 04:13
Ok, thanks, I'll work on it some more. I'll post back with what I get.
swdave
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United States
Posted: 16th Apr 2003 08:55
Hi,

`So the void functions dont return a value and should be used like this.
call dll 1,"PortWordOut",port,value

`If that crashes then hardcode the values.

`If IO.DLL is working this shouldnt crash.
call dll 1,"PortWordOut",0x378,1

`Functions that return values should go like this.

portwordin as WORD
portwordin=call dll (1,"PortWordIn",port)

Also dont use Port=1

rem LPT1
Port=0x378
rem COM1
Port=0x3f8

I think you will need a wrapper dll that calls the LoadIODLL()function on loading and exports all the functions as a standard c dll

PortWordOut = (PORTWORDOUT)GetProcAddress(hio, "PortWordOut");

Dave...

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Apr 2003 10:35
No - I've located the web site that provides this DLL, and that information is for connecting to a DLL that does not have a '.lib' file provided - it's basically just a way of getting the function into C++.

The same functionality is automatically provided by the DLL calls you are already making.

Your calls are still not quit correct. If instead of calling the DLL directly, you should wrap them in functions that use the correct arguments:

function PortWordOut(Port as word, Out as word)
call dll 1, "PortWordOut", Port, Out
endfunction
function PortWordIn(Port as word)
local In as word
In=call dll(1, "PortWordIn", Port)
endfunction In

This way the parameters are passed into the DLL correctly - this is something I discovered when I wrote the IP DLL snippit
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 16th Apr 2003 17:00
Ok, I'll try that, thanks Ian

Login to post a reply

Server time is: 2026-07-11 09:30:24
Your offset time is: 2026-07-11 09:30:24