VERIFY and TRACE, how to implement for debug/release, unicode-aware, no warnings at lvl 4

Hi group and apologize because this isn't a pure MFC-question. I have to 
finish a raw win32 app written in C++. I really miss the macros TRACE 
and VERIFY, which I tend to use when writing MFC programs. I googled for 
"win32 verify macro" and the very first hit is for a codeproject.com 
project with implementations to be used in a win32 program, however. The 
project contains a single header file, debug.h, but it doesn't compile 
without warnings (using warning level 4), doesn't seem to be unicode 
aware and doesn't compile at all in release mode. I was just wondering 
if anyone have a modern way of doing this in C++ that I can use in a raw 
win32 program, perhaps using secure c++ template overloads I see 
mentioned in msdn but I don't understand how to use. Sorry, I don't have 
any code of my own to post at this time. Maybe someone already have an 
implementation available that he or she would like to share. I hope this 
is the last raw win32 program I have to code, btw. ;)

I'm using MSVC++ 8 and it doesn't have to work for an earlier version 
than that, but it has to work on both xp and vista.

- Eric (WP)
0
invalid (293)
8/2/2008 3:42:58 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
1170 Views

Similar Articles

[PageSpeed] 46

I would suggest ATLTRACE and ATLVERIFY.
They are from ATL, and so you can use them in pure Win32 (non-MFC) apps.

HTH,
Giovanni


"WP" <invalid@invalid.invalid> ha scritto nel messaggio 
news:6fjdk3Fbme4uU1@mid.individual.net...
> Hi group and apologize because this isn't a pure MFC-question. I have to 
> finish a raw win32 app written in C++. I really miss the macros TRACE and 
> VERIFY, which I tend to use when writing MFC programs. I googled for 
> "win32 verify macro" and the very first hit is for a codeproject.com 
> project with implementations to be used in a win32 program, however. The 
> project contains a single header file, debug.h, but it doesn't compile 
> without warnings (using warning level 4), doesn't seem to be unicode aware 
> and doesn't compile at all in release mode. I was just wondering if anyone 
> have a modern way of doing this in C++ that I can use in a raw win32 
> program, perhaps using secure c++ template overloads I see mentioned in 
> msdn but I don't understand how to use. Sorry, I don't have any code of my 
> own to post at this time. Maybe someone already have an implementation 
> available that he or she would like to share. I hope this is the last raw 
> win32 program I have to code, btw. ;)
>
> I'm using MSVC++ 8 and it doesn't have to work for an earlier version than 
> that, but it has to work on both xp and vista.
>
> - Eric (WP) 


0
Giovanni
8/2/2008 3:48:50 PM
Giovanni Dicanio wrote:
> I would suggest ATLTRACE and ATLVERIFY.
> They are from ATL, and so you can use them in pure Win32 (non-MFC) apps.

Oh, very nice, that's even better than adding a home-brewn 
implementation. I will look at them as soon as I pick up something to 
eat and post back if I have any problems. Thanks!

- Eric (WP)

> 
> HTH,
> Giovanni
> 
> 
> "WP" <invalid@invalid.invalid> ha scritto nel messaggio 
> news:6fjdk3Fbme4uU1@mid.individual.net...
>> Hi group and apologize because this isn't a pure MFC-question. I have to 
>> finish a raw win32 app written in C++. I really miss the macros TRACE and 
>> VERIFY, which I tend to use when writing MFC programs. I googled for 
>> "win32 verify macro" and the very first hit is for a codeproject.com 
>> project with implementations to be used in a win32 program, however. The 
>> project contains a single header file, debug.h, but it doesn't compile 
>> without warnings (using warning level 4), doesn't seem to be unicode aware 
>> and doesn't compile at all in release mode. I was just wondering if anyone 
>> have a modern way of doing this in C++ that I can use in a raw win32 
>> program, perhaps using secure c++ template overloads I see mentioned in 
>> msdn but I don't understand how to use. Sorry, I don't have any code of my 
>> own to post at this time. Maybe someone already have an implementation 
>> available that he or she would like to share. I hope this is the last raw 
>> win32 program I have to code, btw. ;)
>>
>> I'm using MSVC++ 8 and it doesn't have to work for an earlier version than 
>> that, but it has to work on both xp and vista.
>>
>> - Eric (WP) 
> 
> 
0
invalid (293)
8/2/2008 4:01:05 PM
"WP" <invalid@invalid.invalid> ha scritto nel messaggio 
news:6fjem2FbvcchU1@mid.individual.net...
> Giovanni Dicanio wrote:
>> I would suggest ATLTRACE and ATLVERIFY.
>> They are from ATL, and so you can use them in pure Win32 (non-MFC) apps.
>
> Oh, very nice, that's even better than adding a home-brewn implementation. 
> I will look at them as soon as I pick up something to eat and post back if 
> I have any problems. Thanks!

You're welcome!

Giovanni



0
Giovanni
8/2/2008 9:56:06 PM
Reply:

Similar Artilces:

Linked workbooks #4
Hi, I have a report template that I have just developed which is populated from 5 other spreadsheets that are emailed to me. I save these to a folder and the report template is linked to them so that when I open it it is update via the links. I then use SaveAs to save the template as a XLS report with the date appended. I then email the report out to intended recipients. The question I have is; I no longer need the links in the sved report once the report is completed and would like to delete them prior to emailing. I obviously need to maintain the links in the template (held in a ...

Problem Changing/verifying Type of Account in Money 2004
After converting from Money 1999 to 2004 I have been unable to include dividend and other data relating to a particular brokerage account in reports. I decided to verify that the account is correctly set up. I have been unable to locate the "change type" option referred to in the help section, either within the set-up window or on the left hand panel. What is the problem here? 'change type' refers to, I think, cash, bank, loan, etc and not investment accounts. <anonymous@discussions.microsoft.com> wrote in message news:010201c3c74c$fec4ad10$a501280a@phx.gbl......

misc: 4 Millions Domains data with Category
Successfull Internet and Direct Marketing products on www.promotionsite.net * NEW * DOMUS Domains Toolkit Fall 2004 - Unique on the Net 4 Millions "Whois" Domains data with Expiration Date and Category*. Ultimate Version (October 2004) - Our best rate starts from US *$149*. A wonderful tool for Internet and Direct Marketing. Available in Basic, Advanced and Full Editions. It contains a domain database with 4 millions *FRESH* October 2004 New records .com, .net, .org. 4 Gigabytes MS Excel data zipped on CD-Roms/Dvd. Compression 3:1. MS Excel or Text tab del...

SPA keeps rejecting my login with Beta release Outlook 2010
My POP3/SMTP is rejecting my login credentials now that I installed Outlook 2010 Beta on my test machine, SPA keeps denying me. Whats the problem here? -- "The Director is no longer interested in taking over the world; The amateurs can have it. He will simply be taking over a modest corner of the solar system..." heard at a tradeshow in Chicago, 2006 Have you verified your account settings (including port settings) to be correct? Do you have a virus scanner installed which integrates itself with Outlook? Uninstall this integration part of your virus scanner and t...

resizing pictures for email gets "Not implemented" popup
When I right click on a picture and select send to mail recipient I get the window that asks if I would like to resize the picture to be smaller. I say yes, and in a few seconds get a popup saying "Not implemented". I'm running Office 2003 ...

Printing a Report 2" X 4"
I am using a DB where you select members that have signed up for and art event and print labels using a Dymo printer. The label contains member info, art info, and calculations for sales tax and totals. My problem is that if I make a Label report the calculations do not work the same a making a report. How do I size a report for a 2" X 4" report, which is the Dymo label I want to use, or how do I make calculations work on a label report? Thanks for any help you can provide. -- Doug Small The Dymo printer should have software that creates the 2"x4" label s...

How to open newer XLS files in Excel Version 4.0
I'm using Excel version 4. Can someone point me to an add-in or extension or something to let me open newer files ... at least Excel 95 or Excel 97? Thanks, Nick "Nicholas Fitzpatrick" <nfitz@sentex.ca> wrote... >I'm using Excel version 4. Can someone point me to an add-in or extension >or something to let me open newer files ... at least Excel 95 or Excel 97? You must have a very unconventional view of how Microsoft operates. You need to use a newer version of Excel or some other spreadsheet that opens newer Excel files. There are some inexpensive alternati...

ASSERT and VERIFY
Hi, Just wondering if it is good to wrap literally all your mfc statements in assert or verify? Is this common practise? Every mfc function seems to return a BOOL, which is tempting me to use lots of verify statements. What's the advice of the experts? ASSERT is only compiled and executed in the DEBUG mode. The RELEASE version simply ignores it. "Peter" <peter@peter.com> wrote in message news:ry5gr1v8wiw7.eto2wnoqdj1e$.dlg@40tude.net... > Hi, > > Just wondering if it is good to wrap literally all your mfc statements in > assert or verify? Is this co...

Win CE 6.0 R3
Experts, How to implement Single SSID feature to my existing, working, USB WiFi connection. Is it the registry that need to be dealth with or is it the WZC app that needs to be modified ? Also dont want any popup WZC when system starts. It should directly connect to the SSID we pre-designate using Single SSID. Any tips will help regards, GS-ICN I don't know what "Single SSID" is. You could write a program that runs on startup to check the preferred list of SSIDs associated with your wireless adapter and, if there are none, add one that you describe...

Publisher to PDF #4
How do I take a publisher newsletter and convert it to a PDF file? please respond to my email spanishspringssound@yahoo.com Thank you kelly What version Publisher? Do you have a PDF conversion program? There are free PDF converters around. http://www.google.com/search?hl=en&q=free+pdf+converter If you are using 2007 Microsoft has a *save as PDF* add-in. https://www.microsoft.com/downloads/details.aspx?FamilyId=4D951911-3E7E-4AE6-B059-A2E79ED87041&displaylang=en -- Mary Sauer http://msauer.mvps.org/ "kelly" <kelly@discussions.microsoft.com> wrote in message news:DEF...

DoModal Broken in Debug Mode in VS2005 SP1
A new test was added to dlgcore.cpp in SP1 that breaks the DoModal call in debugging mode. In the function CreateDlgIndirect() line 239: #ifdef _DEBUG if ( AfxGetApp()->IsKindOf( RUNTIME_CLASS( COleControlModule ) ) ) { TRACE(traceAppMsg, 0, "Warning: Creating dialog from within a COleControlModule application is not a supported scenario.\n"); } #endif AfxGetApp() returns NULL since there is no parent hence...boom. Release version works fine since this check is not made. Is there a way around this to fake a parent or...? I'd be more concerned that the...

Cannot verify email
I'm trying to retrieve a "reset password" link for another forum. However, the address the reset link was sent to is for some reason demanding I verify my username and password, which means that until I do I cannot recieve the reset link. However I do not know the username or password, and all my guesses were rejected. To test I tried to make a new account where I knew both username and password, but it rejected those as well even though they were correct. Whatever I put in, the window automatically pops back up. Now for some reason I can't even test the new acc...

Can Outlook Verify an Address?
Hello, Can Outlook verify a mailing address? Thanks no "Talal Itani" <titani@verizon.net> wrote in message news:IpmTh.33754$AS6.1504@trnddc04... > Hello, > > Can Outlook verify a mailing address? > > Thanks > > "Talal Itani" wrote in message news:IpmTh.33754$AS6.1504@trnddc04... > > Can Outlook verify a mailing address? Only by sending an e-mail to find out if your mail *server* can successfully connect to the specified domain in the e-mail address, that there is a mail server that will accept e-mails from your domain's mai...

releasing memory after attacing a CComVariant to a CComSafeArray ...
Hi, I have a question about memory releasing in the following code. When both v and data go out of scope, their destructors will call VariantClear() and Destroy(), respectively. Will the array in v be released twice and cause any site effect? Should I uncomment the last line to avoid double releasing? Any help is much needed because I didn't find a document mentioning this matter. Thanks for your time. CComVariant v; ..... if (V_VT(&v) != (VT_ARRAY | VT_R8)) return; CComSafeArray<double> data; data.Attach(v.parray); .... //data.Detach(); JD >I have a ques...

ANN: DBForms from MS Access to ASP.NET + MS SQL v 1.0 released.
We are glad to announce the releases of our new product DBForms from MS Access to ASP.NET+MS SQL v.1.0.0. This tool allows you to convert mdb (Microsoft Access forms) to .aspx web pages + MS SQL back-end with AJAX support. Convert forms and their elements (Label, Image, OptionGroup, TextBox, ListBox, ComboBox, CommandBox and others) to Web page including element position, color pallet and fields type. Advanced customization options: - Rename caption forms - partial selection for database objects that will be converted. - detection of possible conversion errors at customization stage. Session...

Help #4
I have a column with values yes no as mentioned below i want 1 if value is yes 0 if value is no in next column yes no yes yes no no yes yes Hi kiran In B1 use this formula and copy down =IF(A1="yes",1,0) -- Regards Ron de Bruin http://www.rondebruin.nl "kiran" <kiran@discussions.microsoft.com> wrote in message news:F3785964-28CB-4D7B-843B-6F684C00370B@microsoft.com... >I have a column with values yes no as mentioned below i want 1 if value is > yes 0 if value is no in next column > yes > no > yes > yes > no > no > yes > yes > ...

Custom heap implementation
I need to implement custom single threaded heap on static buffer. Does anyone know any source code of custom heap implementation? "Sasha" <Sasha@discussions.microsoft.com> wrote in message news:6B0C68E7-BEDA-4F14-B212-93CCF3660733@microsoft.com... >I need to implement custom single threaded heap on static buffer. Does >anyone > know any source code of custom heap implementation? You could use the Windows HeapAlloc() API, etc. -- David What is "custom" about it? If it is only the single-threading you need, to avoid lock conflict, then using HeapCreat...

Can not see CString's value when debugging
I'm very sure I'm in the CString's life scope, but I can not see its value but only some "???". Any other type of variables are ok. But some days ago, in the same project, I can see CString's value when debugging. So, what's wrong of CString in debug mode? Now I nearly can't do the debugging job! >So, what's wrong of CString in debug mode? It's a limitation of the debugger. Newer versions of CString have optimisations for the storage of small/long strings that the debugger doesn't cater for :( Dave ...

Question #4
How can I tell if my server is an Exchange bridgehead server? We only have 1 exchange 2003 server and no routing groups created. Thanks for any response! Strickly speaking, a bridgehead is a connection point between two routing groups, so no. But a bridgehead is also a connection point between two systems, so in a generic sense, maybe yes. :) On 15 Nov 2004 16:55:41 -0800, account4google@yahoo.com (Nand) wrote: >How can I tell if my server is an Exchange bridgehead server? We only >have 1 exchange 2003 server and no routing groups created. > >Thanks for any response! ...

outlook crashes very when CRM 4.0 is installed
Hey I have a pc with outlook 2007 that crashes all the time after installation of crm 4.0 desktop version. I have read that I can get hotfix from microsoft but it is not on the microsoft homepage right ? The problem is when a mail is send or replied on or just randomly like every 5 minutes it can crash. do you have a solution...then please help me thanks On Sep 30, 5:37=A0am, mrsteam <mrst...@discussions.microsoft.com> wrote: > Hey I have a pc with outlook 2007 that crashes all the time after > installation of crm 4.0 desktop version. I have read that I can get hotfi= x > ...

verifying microsoft email accound
how do I get into my microsoft email account to verify it ...

rollback/uninstall service pack 4
Hello, I have installed service pack 4 for great plains 10 and would like to know if there is any rollback/uninstall for this service pack only. I would prefer not to uninstall great plains in re-install it. Thanks I answered this question a few days ago in the partner forum. Restore your databases on SQL Server and your client in the GP folder. Then go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Business Solutions\Great Plains\1033\DEFAULT\SETUP, locate the Version entry and change back to the actual build number for the current product installed. Best regards, -- MG.- Mariano Gomez, ...

Cross-Verifying Data in EXCEL #2
Two issues: My data is not in the same order, and cannot be filtered so that it i in the same order. One worksheet has more rows than the other, fo example. And also, I need it to cross-verify two columns. So if in worksheet A the data is, employee1 manager mandy employee2 manager carol employee3 manager andy employee4 manager andrew and in worksheet B the data is, employee1 manager mandy employee3 manager andy employee2 manager alex employee4 manager andrew i want it to cross-verify this type of data. and pinpoint that the dat has discrepencies with employee2 -- Pre ----------------...

Money 2004 Canadian Edition #4
I don't know if the developers read this newsgroup or not, but if they are, the following statement should be noted. A Canadian edition of the program should include listings of financial institutions available in Canada. Money should at the very least have listings for the major Canadian banks. Just a suggestion. Other than this, I find that this piece of software is quite useful. In microsoft.public.money, Chris wrote: >I don't know if the developers read this newsgroup or not, >but if they are, the following statement should be noted. > >A Canadian edition of...

4 chart lines
Hi,I'm stuck.Would someone please tell me how to add 4 chart lines from 4 data series with different scale values to a chart? XL.2003. Xlq.Qmatix .Thankyou. ...