Page 1 of 1

DLL Hurts Brain

Posted: Sun Jan 30, 2011 6:52 pm
by JesseGuarascia
Holy sweet mother of God in heaven, what the hell is wrong with this? XD

I have NO idea what in the HELL I'm getting an error for doing this in my DLL. It's not an "error" persay, it only occurs when I call this function:

Code: Select all

int RenderSys::LoadImage(std::string loc){
	// Add the sprite to the array
	// sprite.push_back(new Sprite("image.jpg", 0));

	// Set the index of the sprite
	return -1;
}
I commented out literally everything except for return -1 to make sure that returning an arbitrary value wasn't the problem. The DLL is just a base engine I'm working on called Sheepish, and this is part of the Render System's Image Component System. Returning -1 is the problem when I run it in debug. You shouldn't need to see any other code, because return -1 is the only problem, lol. Of course I may be wrong (lemme know if I am).

Thanks for any help :).

Re: DLL Hurts Brain

Posted: Sun Jan 30, 2011 7:34 pm
by JesseGuarascia
Alright then, nvm. It seems the problem is the argument std::string loc. I'm not totally sure why std::string doesn't work though :/ Works ANYWHERE else, except for with that function. But yeah, a simple char* works fine :).

Re: DLL Hurts Brain

Posted: Sun Jan 30, 2011 9:42 pm
by ajtgarber
Did you have string included?

Re: DLL Hurts Brain

Posted: Sun Jan 30, 2011 9:44 pm
by JesseGuarascia
ajtgarber wrote:Did you have string included?
Yeah I had string included; I'd notice a mistake like that pretty quickly :P. Running it through debug in VS2008, I was told that there was a buffer overload or something of that sort. I don't know how that makes any sense, since I can still call "std::string("image.bmp")" for the sprite constructor :/