DLL Hurts Brain

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
JesseGuarascia
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 70
Joined: Mon Dec 13, 2010 10:55 pm

DLL Hurts Brain

Post 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 :).
-- Jesse Guarascia

I like C/++, SDL, SFML, OpenGL and Lua. If you don't like those, then gtfo my sig pl0x (jk trollololololol)
JesseGuarascia
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 70
Joined: Mon Dec 13, 2010 10:55 pm

Re: DLL Hurts Brain

Post 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 :).
-- Jesse Guarascia

I like C/++, SDL, SFML, OpenGL and Lua. If you don't like those, then gtfo my sig pl0x (jk trollololololol)
ajtgarber
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 97
Joined: Wed Jun 10, 2009 8:56 am

Re: DLL Hurts Brain

Post by ajtgarber »

Did you have string included?
JesseGuarascia
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 70
Joined: Mon Dec 13, 2010 10:55 pm

Re: DLL Hurts Brain

Post 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 :/
-- Jesse Guarascia

I like C/++, SDL, SFML, OpenGL and Lua. If you don't like those, then gtfo my sig pl0x (jk trollololololol)
Post Reply