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.

DLL Talk / powerbasic.

Author
Message
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 15th Jan 2005 05:52
Does anybody know if powerbasic can make dll's for dbpro, cause i remember something about VB and dbpro not getting along.

additionally if so can someone tell me if you reccomend it or not

powerbasic.com
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 15th Jan 2005 11:03
well anybody? I know one of you higher up's has it
besides i have 200$ burning a hole in my pocket and into my leg
Mr Underhill
21
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 15th Jan 2005 11:40 Edited at: 15th Jan 2005 11:41
In that case, get Purebasic. I think its about $20 or so (there's a free trial), and it's sure to work with DBP. There are even tutorials on how to make working DLLs (they're in the newsletter).

All teh codez are belong to us!
re faze
20
Years of Service
User Offline
Joined: 24th Sep 2004
Location: The shores of hell.
Posted: 16th Jan 2005 11:09
yeah i heard about this one, but i want a language that uses similar datatypes to dbpro (dword ,byte) and in the same manner. additionally i dont really like radians....
LadyTech
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: In the mountains, but below sea level
Posted: 20th Jan 2005 01:19 Edited at: 20th Jan 2005 02:16
I have PowerBasic. I used it to write DXVerChecker. It can make dll's. However I haven't explored much with writting dll's for use with DPPro for the moment. There may be a problem with string tables and mangled (decorated) functions. Not sure if DBpro would recognize an undecorated functions, or if the string table is mandatory.
If I have time I'll look into it.

" Base 8 is just like base 10 actually... If you're missing 2 fingers! " - Tom Lehrer
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 20th Jan 2005 07:22
ummm well u odnt need a string table to use a dll by using load dll but if u want it to automatically recognize the dll and u can just say my_function() then yes u need a string table and special coded functions

come to my forums http://hck83.darktech.info/forum/ formerly: 404 name not found
"others understand me but i dont understand my own thoughts"
LadyTech
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: In the mountains, but below sea level
Posted: 21st Jan 2005 10:47
If I call this from any other program it works.

I'm calling it in DBPro like this.



This prints 5346104707121152 instead of 2
I think it's from not being decorated (mangled).

" Base 8 is just like base 10 actually... If you're missing 2 fingers! " - Tom Lehrer
deckard
21
Years of Service
User Offline
Joined: 11th Apr 2003
Location:
Posted: 21st Jan 2005 16:16 Edited at: 21st Jan 2005 16:21
Power Basic is perfect for making DLLs. Because they are really
"standalone" (they do not use msvb**.dll or any other kind of
Microsoft or Borland's code). But PB's help is not
very good. For example, Power Basic has a "not good documented"
possibility to use pointers (with symbol @, see examples).
Keep in mind, that PB can create only functions with capital
letter names as in Area51's example. And also you must test
how variables are passed - by values or by pointers.
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 22nd Jan 2005 02:36
LadyTech, trying storing the return value then printing to screen, I've seen this happen before, and I'm pretty sure storing fixed it.

It also doesn't matter how the name is stored, decorated or not, it still points to the same area which is all that is needed.
LadyTech
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: In the mountains, but below sea level
Posted: 22nd Jan 2005 17:28
Tried storing it to a variable first.

b = call dll (1, "JUSTADDONE",a)
print b

It always sets the variable to 0. Even if I initialize the variable to something else first.

" Base 8 is just like base 10 actually... If you're missing 2 fingers! " - Tom Lehrer
LadyTech
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: In the mountains, but below sea level
Posted: 22nd Jan 2005 19:14 Edited at: 22nd Jan 2005 19:18
Here's the code for both DBPro and Powerbasic.
DBPro


Powerbasic


" Base 8 is just like base 10 actually... If you're missing 2 fingers! " - Tom Lehrer
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 22nd Jan 2005 20:07
I'm afraid I don't own PowerBasic so I can't try out your code, but you could try a few things:

1) Pass floats in the DLL Call since you're function expects it, although this shouldn't make any difference.
2) Can you show a message box or similar with the values your function recieves, this way you can make sure you are actually getting the correct values.
3) Have you tested a simple test function that only returns a value? If this works, then is may be something wrong with your calculation even though it looks fine here.
LadyTech
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: In the mountains, but below sea level
Posted: 23rd Jan 2005 07:39
Thanks SilentS
After going back and forth compiling and running way to many times for it to be enjoyable, I have located the problems.

1. The result must be set to a variable before being printed so it will be the proper type. Again thanks SilentS!
2. Real numbers in DBPro are equivalant with SINGLE in Powerbasic. And at the moment it seems that mixing precision types gives unexpected results. ie. I can't catch a real number from DBPro with a double precision type in Powerbasic, nor can I return with a double.

Here is a working example of both codes.

DBPro


Powerbasic


" Base 8 is just like base 10 actually... If you're missing 2 fingers! " - Tom Lehrer
Scilynt
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: .-#-.
Posted: 24th Jan 2005 07:20
Glad you got it kind of working
LadyTech
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: In the mountains, but below sea level
Posted: 24th Jan 2005 08:39
It works out ok. I'll check out strings next.
If Xperiment is reading, this should have answered the original post.

" Base 8 is just like base 10 actually... If you're missing 2 fingers! " - Tom Lehrer
deckard
21
Years of Service
User Offline
Joined: 11th Apr 2003
Location:
Posted: 24th Jan 2005 15:40
Also keep in mind that in many languages (for example in DB classic)
constant 5 in expression is integer, but constant 5.0 (or even 5.
in some languages, try to check) is floating point.
This "by default" translation is used from Fortran's times
and causes errors. So, it is really better to use varuables as you said.

Login to post a reply

Server time is: 2024-11-21 14:35:26
Your offset time is: 2024-11-21 14:35:26