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
1015 Views

Similar Articles

[PageSpeed] 54

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:

When is a Unicode LPTSTR Not a wchar_t**?
I'm getting the following compile error: error C2664: 'CSingleInstance::PassArguments' : cannot convert parameter 1 from 'wchar_t ** ' to 'LPCTSTR * ' I'm doing a Unicode build. Shouldn't wchar_t** be the same as LPCTSTR* with the exception of the constant? And shouldn't a non-constant be an acceptable argument for one that takes a constant? I don't understand why I'm getting this error. -- Jonathan Wood SoftCircuits http://www.softcircuits.com Available for consulting: http://www.softcircuits.com/jwood/resume.htm wchar_t** is not eq...

Spell Checking #4
I am running Outlook 2003 but cannot find a way of stopping the spell check from checking all of the text when replying to e-mails. I have checked the settings under Tools-Options-Spelling and the 'Ignore original message text in reply or forward' is ticked. I have tried unticking and re-applying but this has had no effect. Also, although the dictionary is set to English (U.K.), when the spell check dialogue box comes up it is bannered English (U.S.)! Any ideas? Thanks. if you have outlook set to add > or other prefix, it will always spell check - about half the time ...

multiple accounts #4
I have three accounts at t row price; a 401K an IRA and a non-ira account I am new to money and just setting this up today. I went to the 'add account' feature and added the 401K, but when I try to add another account, it just renames the 401k. it seems to only let me have one account. I went the help and didn't find anything. Is there a way to have three or more accounts at the same facility? In microsoft.public.money, skidog@juno.com wrote: >I have three accounts at t row price; >a 401K >an IRA >and a non-ira account > >I am new to money and just setting...

SQL Server Error when going offline MS CRM 4.0
Hi We have quite a few problems with the MS CRM 4.0 Offline Client. When our customer tries to go offline he gets always an SQL Server Error. When we execute the diag tool it shows us that something is wrong with the sync. After executing the repair it works fine and we can go offline without any troubles. The strange thing is, that it does not work on the next day. Then we get the same error again. The only solution is to execute the repair.... We are working for quite a long time together with ms support, but unfortunately they couldn't help us so far. We also have installed several ...

Verify Password
Just download Money 2006 Delux trial version and would like to setup my account and connect to my bank (Hang Seng Bank) which is listed on the directory.. however, it keep saying my "verified password" is not correct and don't proceed to connect..what's wrong? I am 100% sure the password and verify passward are the same (no caps lock).. Please help. In microsoft.public.money, Casper wrote: >Just download Money 2006 Delux trial version and would like to setup my >account and connect to my bank (Hang Seng Bank) which is listed on the >directory.. > >ho...

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...

Trace emails with no headers
How do I trace emails with no headers that are in my inbox. I suspect someone wiped out the sender's information and message contents before I could see it. Could these be viruses disguised as emails? On Fri, 4 Jun 2010 15:08:02 -0700, cgd1947 <cgd1947@discussions.microsoft.com> wrote: >How do I trace emails with no headers that are in my inbox. I suspect >someone wiped out the sender's information and message contents before I >could see it. Could these be viruses disguised as emails? Every e-mail has headers. If you look at the FULL headers, what d...

XmlSerializer produces different results in debug and release buil
A few weeks ago, I upgraded an XML server of ours to .NET 2.0. All went fine. Then last week, I decided to remove all obsolete calls from the app and sign each project in the solution in the .NET 2 way so that the app compiled with no warnings. This built fine but we noticed that server was deserializing one of our XML messages incorrectly. I confirmed via source control that neither the schemas themselves nor the classes representing the messages had been altered but the problem continued. After some investigation, I found I could I could actively switch this bug on and off in debug mod...

When will CRM 4.0 Stand-Alone Online Help be available?
---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=38cec6ea-d992-4147-a685-61cbbdedf7ac&dg=microsoft.public.crm ...

Exchange 4.0 Binaries
Hello all, I would like to bild the transition scenario for exchange. I would like to start by exchange 4.0. Unfortunatly I don't have the binaries for this version. Could someone provide it to me? THX in ADV Cheers Igor Does anyone in the world still use Exchange 4.0. I don't even remember an SMTP connector for it? "Igor" <i-koslov@muenster.de> wrote in message news:139CED78-E895-44D1-A4BA-91E1B05AD747@microsoft.com... > Hello all, > > I would like to bild the transition scenario for exchange. I would like to > start by exc...

Debug
Hi, How can i debug a lib file that link to my project from my project in debug mode??? (i been told that i need to insert the file of the lib to my project and so.. how to do it???") Thanks. To do it easily you have to have the source for the lib adn have the lib compiled in debug mode as well. Adding the project for the lib to your solution makes this pretty easy to do. Tom "Dave" <dbg@012.net.il> wrote in message news:eR1dbIBoEHA.3684@TK2MSFTNGP10.phx.gbl... > Hi, > How can i debug a lib file that link to my project from my project in debug > mode??? &...

Merging Workbooks #4
Hi Julie This page is excellent! However it assumes that the two lists are nex to each other on the same spreadsheet. I ideally need something that will work for two different sheets an merge them into one Thank -- DB10 ----------------------------------------------------------------------- DB100's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=917 View this thread: http://www.excelforum.com/showthread.php?threadid=27825 That page has lots of stuff on it. I took a little glance and didn't see anything that had to have the two worksheets in the same work...

warning message
Hi all I have a spreadsheet which has numerous hyperlinks to websites etc. I also have a hyperlink to a program on my computer. How do I stop the 'some files can contain viruses' warning from appearing every time I click the link. I have already got the macro security on a low level. MTIA elwyn Hi have a look at http://snurl.com/2uq3 for a registry entry to achieve this. AFAIK there is no build in option to suppress this warning -- Regards Frank Kabel Frankfurt, Germany elwyn wrote: > Hi all > > I have a spreadsheet which has numerous hyperlinks to websites etc. I &g...

Verifone 1000SE Pinpad
When using the Verifone 1000se Pinpad, RMS forces the customer to verify the amount first, and then asking the customer to press the green button. This is confusing for some customers since the text on the display of the pinpad starts scrolling if the amount is larger than $xx.xx. There should be an option for us to have it this way or the way I propose, ie let the customer enter the Pin and then press enter. The amount is on the pole display anyhow. The way that it is set up today is cumbersome and slows down the sales process. ---------------- This post is a suggestion for Microsoft...

IF function #4
I have a problem with IF function. The problem is column 4 has only 2002 entries, column 5 has 2002 and 2003 entries. If column 5 only had 2002 entries then a count by month would suffice. If a cell in column 5 is null then count by the cell in column 4. If column 5 has an entry then count the cell in column 5. I now need an IF statement that checks for year and counts by month for year 2002 and a separate count by month for 2003. this is the IF statement currently used. =IF(ISBLANK(K5),"0",MONTH(K5)) thanks in advance. In adjacent columns add the formulas =YEAR(column...

Verify Sent Mail
Does anyone know how to verify sent mail when sending mail from CRM (the web version)? Thanks, Donnie Sweat Go to the Activities left tab on the contact and then click on History tab. This will show you the past emails, phone calls, etc. for the contact. Alternatively, if you sent a mass email, you can do an Advanced Find (Tools > Advanced Find) and search on Activities where the type equals email, the owner equals current user, and the created date equals today. This will show you all the CRM emails you sent today. HTH -- Matt Wittemann http://icu-mscrm.blogspot.com "Mic...

ANN:PlainSight Desktop Calendar 2.1 Released
Desksware is pleased to annouce the release of PlainSight Desktop Calendar 2.1. It is great looking calendar which can be full integrated with your favorite wallpaper. You can define its position, font, color, size, transparency just by a few clicks. For getting best user experience, it uses anti-aliased font which often used in PDF. PlainSight Desktop Calendar is not only a great looking calendar but also a useful tool. It can get data from Outlook and display them on the desktop. It supports recurrence pattern for appointments and can display different status of tasks. Double click the app...

DPM 2010 release dates
Hi, I was wondering if anyone could define what the current projected release dates for DPM 2010 are? I'm specifically looking for RC and RTM dates. I've heard that the RTM is now expected to ship in early summer and wanted to confirm. Here is an old information I gathered before. I am not sure it is still accurate. So lets wait for the DPM team's answer: http://santhoshsivarajan.blogspot.com/2009/12/dpm-2010-timeline.html -- Santhosh Sivarajan | MCTS, MCSE (W2K3/W2K/NT4), MCSA (W2K3/W2K/MSG), CCNA Houston, TX http://blogs.sivarajan.com/ http://publications...

In outlook how do i enter an appointment at say 4.25pm not 4.30pm
In Outlook calendar I want to enter data at times other than the hour or half hour - say 4.25pm. How do I do that? G'Day Starling, While setting up the appointment, TYPE the start time (or end time) you desire in the appropriate box. -- Regards, Pat Garard Melbourne, Australia _______________________ "Starling" <Starling@discussions.microsoft.com> wrote in message news:5DFD1741-3BD0-441D-B64B-CDB4B7322297@microsoft.com... > In Outlook calendar I want to enter data at times other than the hour or half > hour - say 4.25pm. How do I do that? type 4.25 in the ...

Cross-Verifying Data in EXCEL
Hi there, I'm just looking to use excel to cross-verify data. What I have is to worksheets, both with a large number of data i columns such as as "Name" and "Manager". I wanted to verify that bot spreadsheets have the same information. For rows that do not match, I would like something to occur in exce that would pinpoint this to me. Whether it tell me the list in a ne worksheet or highlight the rows, anything. Does anyone have any suggestions about how I can go about doing this? Thanks very much for your help -- Pre --------------------------------------------...

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...

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...

Several values in one cell. is it possible? #4
I understand. Thanks alot u all. I tough it was nearly impossible, but now it' working perfectly -- EliB ----------------------------------------------------------------------- EliBY's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1649 View this thread: http://www.excelforum.com/showthread.php?threadid=27879 ...