[Fixed] DXGetErrorString9 () problem

Started by
6 comments, last by Muhammad Haggag 18 years, 6 months ago
Hi! I've just implemented this function to remove all my switch () statements that convert each possible error value to string then write it to the log file. But my EXE effectively stores ALL possible error strings in the DXErr9.lib when I just used a few of them!. I believe this issue is related to my Project's configuration settings, but I can't find it yet. Anybody has any idea ? Thanks in advance. V@T [Edited by - Skeleton_V@T on October 30, 2005 6:44:32 PM]
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--
Advertisement
Hi,

I don't think that any linker will rip out the unnecessary branches and string constants from that function for you..
If size is a problem, use an executable packer!

kp
------------------------------------------------------------Neo, the Matrix should be 16-byte aligned for better performance!
If that is the case, then I'll come back to my original approach :(.

You know what ?, my executable size grows up with an enormous size: from ~150KB to > 800KB o_0
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--
1) Are you doing this size measurement on a release build?
2) Tried "Optimize for size"?
3) Tried using UPX (exe packer)?
4) Why does size matter so much anyway?

Umm, EXE size is not my concern. I've just known about this function and thought is is useful. But for now I may just stick with my old code because only a few error codes are used, 700KB more is kind of wasting.

It should be like that, I could've thought about it earlier, DX has no way to determine what error codes will be returned. I may implement it for larger projects though :). I use UPX for release builds but most of my games still stay only in my computer [LOL].
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--
Quote:Original post by Skeleton_V@T
Umm, EXE size is not my concern. I've just known about this function and thought is is useful. But for now I may just stick with my old code because only a few error codes are used, 700KB more is kind of wasting.

It should be like that, I could've thought about it earlier, DX has no way to determine what error codes will be returned. I may implement it for larger projects though :). I use UPX for release builds but most of my games still stay only in my computer [LOL].

700 Kb isn't a waste considering the improvement the function does for you in debugging and error reporting. Think about it, would you rather have log files full of hex HRESULT values or a nice and cozy HRESULT name? [smile]
Plus, this stuff usually compresses well.

Thanks, yeah you're right, I'm thinking about it again.
It is much simpler for an engine in logging too.
Or maybe people look at my executable size and surprise: "Oh, the file is large, it must have been implemented tons of interesting things, I should try it now!". ---> Just a joke [LOL]
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--
Quote:Original post by Skeleton_V@T
Or maybe people look at my executable size and surprise: "Oh, the file is large, it must have been implemented tons of interesting things, I should try it now!". ---> Just a joke [LOL]

If that's the case, I've got a better plan! Stuff some high-resolution bitmap images into your exe as resources. Or better, a couple of raw AVIs [lol]

This topic is closed to new replies.

Advertisement