CallFunction with PB4.40

Just starting out? Need help? Post your questions and find answers here.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

CallFunction with PB4.40

Post by Karbon »

I don't know if this is a bug but it's certainly something that worked before 4.40

---------------------------
PureBasic
---------------------------
Line 6701: Bad parameter type, number expected instead of string.
---------------------------
OK
---------------------------

That's from a CallCFunction() call.

I see this in the changelog : " Changed: Call(C)Function(Fast) parameters have been changed from 'Any' to 'Integer'."\

What does that mean exactly? The documentation is exactly the same as far as I can tell. The function(s) I'm calling needs a string parameter passed in.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: CallFunction with PB4.40

Post by ts-soft »

use @mystring.s or @"bla"
or better, don't use callfunction, use prototypes :wink:
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Re: CallFunction with PB4.40

Post by Karbon »

I try not to fix things that aren't (or weren't) broken ;-)

Guess I'll be switching. Kind of wish this was documented!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Re: CallFunction with PB4.40

Post by SFSxOI »

Did you try pointers with it?
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Re: CallFunction with PB4.40

Post by Karbon »

Pointers it was!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6175
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: CallFunction with PB4.40

Post by blueznl »

Many of us posted this as a bug or a question, myself included :-) It was in the list of changes IIRC though... :oops:
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: CallFunction with PB4.40

Post by ts-soft »

ts-soft wrote:use @mystring.s or @"bla"
this a pointers with the @, i think my english is to bad :wink:
Marco2007
Enthusiast
Enthusiast
Posts: 648
Joined: Tue Jun 12, 2007 10:30 am
Location: not there...

Re: CallFunction with PB4.40

Post by Marco2007 »

ts-soft wrote:use @mystring.s or @"bla"
or better, don't use callfunction, use prototypes :wink:
Thomas, I use the @-thing....why is better to use prototypes? Any problems with the @-thing?
PureBasic for Windows
Seldon
Enthusiast
Enthusiast
Posts: 405
Joined: Fri Aug 22, 2003 7:12 am
Location: Italia

Re: CallFunction with PB4.40

Post by Seldon »

OK, but couldn't our PB compiler make it for us ? I mean when we pass a string to a DLL, it passes the pointer instead (like it has been so far). It's BASIC after all. Maybe, are there any other problems ?
moogle
Enthusiast
Enthusiast
Posts: 372
Joined: Tue Feb 14, 2006 9:27 pm
Location: London, UK

Re: CallFunction with PB4.40

Post by moogle »

Marco2007 wrote:why is better to use prototypes?
Because I think then you can call the function name directly in your code once you set up the prototype correctly, instead of CallFunctionFast() etc, etc.
Image
Post Reply