I'm trying to convert this bit of C into PB to return a floating point number to DarkBasic from my dll but I can't seem to make it work. I don't understand what's actually happening in the C function. Would someone explain this to me?
Maybe you'd need to declare float as static so that it didn't fall out of scope when the proc exited
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
I see, kind of like type spoofing so that you can return 4 bytes as a dword but actually there's a 4 byte float in there.
Wonder what the point of doing that is?
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Okay, searching around on the net it seems to be a darkbasic workaround where by their DLL can't return floats so they need to sort of encpsulate it to get around a limitation of the language
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Well, my name is four letters so I could set a longs bytes to asc(P) asc(a) asc(u) asc(l) and return it as a long.
Or I could return it as a string since that's what it is...
But noooo, I will not make it that easy for them
Why publish a simple API when you can publish a difficult one with just a little extra effort
Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein