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 / Cant use a CALL DLL when calling functions

Author
Message
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 13th Nov 2002 00:17
For example, you can't do :



Unfortunately.

The CALL DLL needs to be a seperate statement. I think the problem is due to the fact is that the CALL DLL doesn't know the value to return, in which case it would help if there was an automatic promotion to, say a default return of integers.
Yes, I really am THAT good...
The One Ring
21
Years of Service
User Offline
Joined: 15th Sep 2002
Location: United States
Posted: 13th Nov 2002 02:46
It appears that DarkBasic Pro doesn't evaluate the CALL DLL function as an expression, perhaps (like in C++)?

In C++, if you use GetProcAddress, and you use a function pointer in an express, you do have to cast it... Don't suppose DBP supports casting?

AMD Athlon 900 768MB DDR
ATI Radeon 64MB DDR All-In-Wonder 7500, ATI XPert 128 16MB
Sound Blaster Audigy Gamer w/FireWire Support
swdave
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United States
Posted: 13th Nov 2002 03:07
Try wrapping your call dll in a function.

putCharIntoBitmap(1,TITLE_BITMAP,32, _
PeekString(ptr), _
GAME_FONT)

function PeekString(ptr as integer)
Rtn = call dll (DLL_POINTER,"__peekString",ptr,4)
endfunction Rtn

MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 13th Nov 2002 10:26
DBPro doesn't support casting (unfortunatly - that can be very useful at times).

Certainly might be worth putting a wrapper around the dll

Yes, I really am THAT good...
ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 13th Nov 2002 19:26
well...some casting is supported:

print str$(21)
print val("19")
wait key

-= i only do what my rice krispies tell me to do =-
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Nov 2002 20:40
That's 'overloading' ChipOne, not casting. Casting is conversion (automatic or not) between types - integer to float for example.

The command 'print' is actually several different commands. The one that is required is automatically selected according to the type of the argument following.

Back onto topic though - why not convert the dll to use the 3rd party command SDK and build it into the language.
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 13th Nov 2002 21:40
I would if someone would give me the SDK...

Yes, I really am THAT good...
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 15th Nov 2002 01:24
Sorry. I'm reliably informed that the SDK is available only for DBDN members at the moment - something I wasn't aware of when I mentioned it.
MrTAToad
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 15th Nov 2002 01:50
Any change of when us mere mortals will get it ?

Yes, I really am THAT good...

Login to post a reply

Server time is: 2024-04-23 11:19:09
Your offset time is: 2024-04-23 11:19:09