2 registered members (TedMar, AndrewAMD),
1,344
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: A stable free IDE
[Re: TWO]
#203533
04/22/08 16:55
04/22/08 16:55
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Thanks, now it works!!!
There is only one last small question until this thread can be closed: How can I setup my dll so that it gets a version and an informationtext? In Dev-Cpp this was under Projectsettings, but in VC++ I can't find anything like that...
Dark_Samurai
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: A stable free IDE
[Re: TWO]
#203723
04/23/08 17:04
04/23/08 17:04
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
It seems like this is not supported with the express version...
Thanks for your help!
Dark_Samurai
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: A stable free IDE
[Re: Dark_samurai]
#205415
05/06/08 14:16
05/06/08 14:16
|
Joined: Apr 2006
Posts: 136 San Francisco
Tor
Member
|
Member
Joined: Apr 2006
Posts: 136
San Francisco
|
Yep, that was the problem. Thanks!
DLLFUNC void string_test() { char buffer[50]; short reseiver;
sprintf_s(buffer,50,"%d",10); sscanf_s(buffer,"%d",&reseiver); }
But if I use this function in GS i get this runtime error: Debug Error!
Run-Time Check Failure #2 - Stack around the variable 'reseiver' was corrupted.
What am I doing wrong?
Dark_Samurai Probably because the function is expecting a double which is 4bytes and you gave it a short which is 1-2bytes depending on compiler/Os. Stick with ints/floats, they're faster in almost all cases. 2Byte data types don't help unless you're using them inside classes to save space. Things are optimized more efficiently if all the data you're using is 32bits for the most part. Can I recommend you try out the STD::STRING stuff? char*'s and the stdlib cstring manipulators are very very dangerous, I can't tell you how many times I've blown up the heap/stack with them .
"Towlie, you're the worst character ever."
I know...
|
|
|
Re: A stable free IDE
[Re: Tor]
#205427
05/06/08 15:39
05/06/08 15:39
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
Can I recommend you try out the STD::STRING stuff? char*'s and the stdlib cstring manipulators are very very dangerous, I can't tell you how many times I've blown up the heap/stack with them \:D . Do you mean using an index that doesn't exit? Because of that I use for example sprintf_s (all with _s) which is save in this case (because of an parameter that holds the size). Probably because the function is expecting a double which is 4bytes and you gave it a short which is 1-2bytes depending on compiler/Os.
Stick with ints/floats, they're faster in almost all cases. 2Byte data types don't help unless you're using them inside classes to save space. Things are optimized more efficiently if all the data you're using is 32bits for the most part.
In school they told us not to use int because it's size depends on the compiler. But with int every thing works, because of that I will use int in the future. Dark_Samurai
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
Re: A stable free IDE
[Re: Dark_samurai]
#205550
05/07/08 08:36
05/07/08 08:36
|
Joined: Apr 2006
Posts: 136 San Francisco
Tor
Member
|
Member
Joined: Apr 2006
Posts: 136
San Francisco
|
Unfortunately, yes, int can vary in size depending on compiler, but if you're using a comiler on at LEAST a 32bit platform that was made in the last 10 years or so, you can assume int is 4bytes. I know for a fact you can in VS/Borlandbuilder 6+.
What the heck do they tell you to use besides an int? long?
It's not crashing on sprint_f, I believe it's wigging out on the accessing of sscanf_s.
"Towlie, you're the worst character ever."
I know...
|
|
|
|