• Advertisement

Archived

This topic is now archived and is closed to further replies.

msvc + autoexp

This topic is 5190 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just thought I''d throw this at the board seeing as I''ve just found out about it... In MSVS you can customise the debugger through the autoexp.dat file (search for it in your installation - it exists in vers 5, 6 & .net certainly & possibly others). You can specify how it formats variables (there are already some examples...) and you can also specify what it shows for HRESULT return values. As there aren''t any HRESULT values defined I''ve put some of the more commmon ones together (at least for as much as I could be bothered so it isn''t exactly complete...). To use these, find your autoexp.dat file & paste these at the end (or add the key values to the [hresult] section if you already have one)
; This section lets you define your own errors for the HRESULT display.
; You need to list the error code in unsigned decimal, followed by the message.
; Changes will take effect the next time you redisplay the variable.
[hresult]
;1234=my custom error code
;
; general hresult values
;
0=Operation Successful (S_OK)
2147549183=Unexpected Failure (E_UNEXPECTED)
2147500033=Not Implemented (E_NOTIMPL)
2147942414=Failed to Allocate Necessary Memory (E_OUTOFMEMORY)
2147942487=One or More Arguments are Invalid (E_INVALIDARG)
2147500034=No Such Interface Supported (E_NOINTERFACE)
2147500035=Invalid Pointer (E_POINTER)
2147942406=Invalid Handle (E_HANDLE)
2147500036=Operation Aborted (E_ABORT)
2147500037=Unspecified Failure (E_FAIL)
2147942405=General Access Denied Error (E_ACCESSDENIED)
2147483658=Data is not yet available (E_PENDING)
;
; d3d errors taken from d3d8.h of dx9 sdk
;
2289436696=D3DERR_WRONGTEXTUREFORMAT
2289436697=D3DERR_UNSUPPORTEDCOLOROPERATION
2289436698=D3DERR_UNSUPPORTEDCOLORARG
2289436699=D3DERR_UNSUPPORTEDALPHAOPERATION
2289436700=D3DERR_UNSUPPORTEDALPHAARG
2289436701=D3DERR_TOOMANYOPERATIONS
2289436702=D3DERR_CONFLICTINGTEXTUREFILTER
2289436703=D3DERR_UNSUPPORTEDFACTORVALUE
2289436705=D3DERR_CONFLICTINGRENDERSTATE
2289436706=D3DERR_UNSUPPORTEDTEXTUREFILTER
2289436710=D3DERR_CONFLICTINGTEXTUREPALETTE
2289436711=D3DERR_DRIVERINTERNALERROR
2289436774=D3DERR_NOTFOUND
2289436775=D3DERR_MOREDATA
2289436776=D3DERR_DEVICELOST
2289436777=D3DERR_DEVICENOTRESET
2289436778=D3DERR_NOTAVAILABLE
2289435004=D3DERR_OUTOFVIDEOMEMORY
2289436779=D3DERR_INVALIDDEVICE
2289436780=D3DERR_INVALIDCALL
2289436781=D3DERR_DRIVERINVALIDCALL
;
; dinput errors taken from dinput.h of dx9 sdk
;
2147746304=Insufficent Privileges to Change Joystick Configuration (DIERR_INSUFFICIENTPRIVS)
2147746305=The device is full (DIERR_DEVICEFULL)
2147746306=Not all the requested information fit into the buffer (DIERR_MOREDATA)
2147746307=The effect is not downloaded (DIERR_NOTDOWNLOADED)
2147746308=The device cannot be reinitialized because there are still effects attached to it (DIERR_HASEFFECTS)
2147746309=The operation cannot be performed unless the device is acquired in DISCL_EXCLUSIVE mode (DIERR_NOTEXCLUSIVEACQUIRED)
2147746310=The effect could not be downloaded because essential information is missing (DIERR_INCOMPLETEEFFECT)
2147746311=Attempted to read buffered device data from a device that is not buffered (DIERR_NOTBUFFERED)
2147746312=An attempt was made to modify parameters of an effect while it is (DIERR_EFFECTPLAYING)
2147746313=The operation could not be completed because the device is not plugged in (DIERR_UNPLUGGED)
2147746314=SendDeviceData failed because more information was requested to be sent than can be sent to the device (DIERR_REPORTFULL)
2147746315=A mapper file function failed because reading or writing the user or IHV settings file failed (DIERR_MAPFILEFAIL)

Share this post


Link to post
Share on other sites
Advertisement
Hm, I don''t know if this is what you''re referring to, but if you go to the watch window during debugging (press Alt-3), you can type ",wm" or ",hr" after a variable name to make MSVC6 translate the number into a message name instead of just a number. The HRESULT values are only standard, though, so they won''t work for say Direct3D return codes.

Share this post


Link to post
Share on other sites
To extend psykr''s remark:
Just add @err,hr to the watch pane and the result of GetLastError() turned into a string (FormatMessage()) is automatically displayed.

Share this post


Link to post
Share on other sites

  • Advertisement