Message Board


Message Board > Fenix / Bennu / Gemix / DIV > Return a string from a dll

November 13, 2006, 17:01
DTM
Earthling!
821 posts

I've created a string in a DLL and need to pass it to fenix.

I tried using the "string_new" function, but i'm not sure if that's the right function. Or how to use the returned integer.

Has anyone done this?
____________
:o
#
November 13, 2006, 20:10
Eckolin
Quite Whiskered
388 posts

String_new is good.

Can you assign the return value of the function to a string in Fenix?

My other best guess is you need to change type_dword to some type_string and Fenix will recognise the returned string id as such.

[Edited on November 14, 2006 by Eckolin]
____________
Maker of Games...
Wisdom is supreme; therefore get wisdom.
Need help with coding? I probably wrote something similar.
#
November 13, 2006, 21:05
DTM
Earthling!
821 posts

TYPE_STRING worked. Thankyou.
____________
:o
#
November 14, 2006, 00:25
Sandman
F3n!x0r
1194 posts

Don't forget to use string_use(), otherwise Fenix will discard the string immediately after the function returned the string. So:
Code:
static int HELLO_WORLD (INSTANCE * my, int * params)
{
    int r = string_new("HELLO WORLD!");
    string_use(r);
    return r;
}
And:
FENIX_export ("HELLO_WORLD","",TYPE_STRING,HELLO_WORLD) ;
Note that you can also name the function different in Fenix:
FENIX_export ("BLAAT","",TYPE_STRING,HELLO_WORLD) ;

Blaat() will return the same as Hello_World().
____________
BennuWiki
Yes, my avatar has grey borders in IE (so get a decent browser)
ROOFLEZ ROOFLEZ
#

Message Board > Fenix / Bennu / Gemix / DIV > Return a string from a dll

Quick reply


You must log in or register to post.
Copyright © 2005 Booleansoup.com
Questions? Comments? Bug reports? Contact us!