36 lines
3.2 KiB
Plaintext
36 lines
3.2 KiB
Plaintext
{\rtf1\ansi\ansicpg1252\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\froman Times New Roman;}{\f3\froman Times New Roman;}}
|
||
{\colortbl\red0\green0\blue0;\red0\green0\blue255;\red0\green128\blue0;}
|
||
\deflang4105\pard\plain\f2\fs48\cf1\b OXAdvancedAssert MACRO
|
||
\par \plain\f2\fs48\b
|
||
\par \plain\f2\fs24 The assertion messages provided in Visual C++ are far from complete. They do not provide your Beta testers the ability to directly notify you of any assertion failures that occur. With the new Assertion dialog provided in the Ultimate Toolbox a dialog will now appear to your testers allowing them to email the notice to you directly from your application.
|
||
\par You simply need to include the header file in your project and the old dialog will be replaced with the new one. You can customize the emailing actions through some very simple code (in fact you should to get the email address right). This will allow accurate reporting of bugs in your projects while still in the beta testing process
|
||
\par You are also able to customize the dialog box appearance that your users will see.
|
||
\par
|
||
\par \plain\f2\fs24\b Place the following line in your stdafx.h file to include this functionality:
|
||
\par #include "OXAdvancedAssert.h" // Advanced assertion\plain\f2\fs24
|
||
\par \plain\f2\fs24\i void CAssertDialog::OnCustomize\{\plain\f2\fs24
|
||
\par \plain\f2\fs24\i CString message_holder;
|
||
\par \plain\f2\fs24\cf2\i
|
||
\par // retrieve the global Assertion Note1 text\plain\f2\fs24\i
|
||
\par message_holder=\plain\f2\fs24\b\i AppGetAssertNote1() ;\plain\f2\fs24
|
||
\par \plain\f2\fs24\cf2\i // Now we add some string to the end and reset the global message\plain\f2\fs24\i
|
||
\par messge_holder += "Modifications made by Jeff Scott";
|
||
\par \plain\f2\fs24\b\i AppSetAssertNote1(message_holder);\plain\f2\fs24
|
||
\par \plain\f2\fs24\cf2\i // retrieve the global Assertion Note2 text\plain\f2\fs24\i
|
||
\par message_holder=\plain\f2\fs24\b\i AppGetAssertNote2() ;\plain\f2\fs24
|
||
\par \plain\f2\fs24\cf2\i // Now we add some string to the end and reset the global message\plain\f2\fs24\i
|
||
\par messge_holder += "Modifications made by Jeff Scott";
|
||
\par \plain\f2\fs24\b\i AppSetAssertNote2(message_holder);\plain\f2\fs24
|
||
\par \plain\f2\fs24\cf2\i //What is the email address that is currently receiving the assertion messages
|
||
\par \plain\f2\fs24\i CString email;\plain\f2\fs24\cf2\i
|
||
\par \plain\f2\fs24\cf0\i email = \plain\f2\fs24\b\i AppGetAssertEmailAddress()\plain\f2\fs24\i ;\plain\f2\fs24
|
||
\par \plain\f2\fs24\cf2\i // Now lets change the email address so it goes directly to the programmer not tech support\plain\f2\fs24 \tab \tab
|
||
\par \plain\f2\fs24\cf1\i if\plain\f2\fs24\i (email == \plain\f2\fs24\cf1\i\ul "utb@dundas.com"\plain\f2\fs24\i )\{\plain\f2\fs24 \tab \tab
|
||
\par \tab \plain\f2\fs24\i email = \plain\f2\fs24\cf1\i\ul "jeffs@dundas.com"\plain\f2\fs24\i ;\plain\f2\fs24 \tab
|
||
\par \plain\f2\fs24\i \}\plain\f2\fs24 \tab \tab
|
||
\par \plain\f2\fs24\cf2\i // We now need to change the global email address\plain\f2\fs24 \tab \tab
|
||
\par \plain\f2\fs24\b\i AppSetAssertEmailAddress(email) ;\plain\f2\fs24 \tab \tab
|
||
\par \pard\qc\plain\f2\fs24\i \}\plain\f2\fs24
|
||
\par \pard\plain\lang1033\f3\fs20
|
||
\par }
|
||
|