AngelScript 1.10.1b STABLE (2004/12/01)

Started by
15 comments, last by WitchLord 19 years, 4 months ago
r = engine->RegisterGlobalFunction("int AddImage( int Im, bstr caption, int x, int y, int width, int height )",
asFUNCTION(AddImage), asCALL_CDECL); assert( r >= 0);

This seems to cause the problem, basically whichever functions have a bstr in them, i would like to change it to stdstring if it's an easy step, if you can tell me how exactly to use them, cos i have used bstr only in the function prototypes. i would still prefer keeping to date rather than using a depracated method
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.
Advertisement
Dumb me, forgot to call Registerbstr!!!, tell more the new string anyway.
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.
Ahh, that explains it. [wink]

Well, if you want to use std::string instead of string, the first thing you'll have to do is to call RegisterStdString() instead of RegisterBStr(). It will register the 'string' type (not 'bstr'), so you'll have to change all your uses of 'bstr' to 'string'. Then you'll have to change all your registered application functions to receive std::string, instead of bstr. When using std::string you'll not have to worry about deallocating the memory in the application functions as C++ will do it for you, this is why I recommend using it instead of bstr.

Also, I haven't prepared any formatting functions like bstrFormat(), so if you're using them you'll have to write them yourself. That shouldn't be too much work, just use the bstr functions as a base and change them to return a std::string instead.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I dont use any of those Formatting functions so it wouldnt matter, Is there any other thing i need to keep in mind before i change to string?
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.
I can't think of any right now. Have you checked out the upgrade instructions available in the documentation for AngelScript?

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Everything seems to work fine and the new version works great! Yippee!!! Massive Performance gains, i have'nt officially tested the changes though! will get back with results!
Jayanth.KRaptor Entertainment Pvt. Ltd.http://www.raptorentertainment.com---------------------------------------------------------Why Mr. Anderson? Why? ...Why keep fighting? Do you think you're fighting for something - for more than your survival? Can you tell me what it is? Do you even know? Is it freedom, or truth, perhaps peace, could it be for love? Illusions Mr. Anderson, vagaries of perception. Temporary constructs of a feeble human intellect trying desperately to justify an existence without meaning or purpose.
That's great to hear :D

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement