VS7 Error Runtime Checking Question

if I have something like

while ( condition )
{
=09Sometype=09Var;
=09if ( firstTimeThruLoop )
=09=09var =3D something;
=09OperationUsing ( var );=09// ******
}

The SECOND time through the loop, VS7 gives an error in debug mode that var=
 is being used without being initialized, whereas VS6 doesn't.

I can see where it's coming from, but it does make programs act differently=
 when built under different compilers.

What is the C++ convention ?

Is var supposed to be persistant thru each iteration of the loop or is it=
 initialized each time ?

ie should var always be declared outside the while block (as I have now done=
 it) ?

I am making an effort to use VS7 (despite the apalling millstone of no=
 ClassWizard), but am really nervous about letting code loose with unknown=
 gotchas in it.

=09

0
isemmel (236)
11/9/2004 8:00:22 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
279 Views

Similar Articles

[PageSpeed] 46

>What is the C++ convention ?
>
>Is var supposed to be persistant thru each iteration of the loop or is it initialized each time ?

It'll be initialised each time round the loop.

>ie should var always be declared outside the while block (as I have now done it) ?

Yes - in this circumstance

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl7375 (2060)
11/9/2004 8:28:36 PM
Reply:

Similar Artilces:

Office XP error message
When i try and open 2 needed folders in outlook i get this following message.. Unable to display the folder. Microsoft Outlook could not access the specified folder location. outlook:8001010118000000E42E1C0097000000FC2E1C0000000000DD C008B2347CA442B4D3B0C91014D6AD828200000000000038A1BB1005E5 101AA1BB08002B2A56C200006D737073742E646C6C00000000004E4954 41F9BFB80100AA0037D96E000000433A5C446F63756D656E747320616E 642053657474696E67735C5 can anyone help me please. All my work documents are in this folder. No changes have been make to outlook xp well not that i know of..Help please How big is yo...

Error -17099
Version: 2004 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Email Client: pop Every email I send is blocked with Error -17099 suspected spam. i have spoken to my ISP and can send email using this account with different program. Happens regardless of address sending to or size of email what can I do? Can I reset the program somehow, I've tried the entering the account details again but no change. > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3355748948_864137 Content-...

New error on opening outlook 2002
I had accidently installed Plaxo, the address book update program. I uninstalled it and immediately after, started getting an error when I open Outlook: "Microsoft Visual C++ Runtime Library" is the window heading. The message is: "Runtime error! Program C:\Program Files\Microsoft Office\Office 10 \outlook.exe The application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information" After shutting down Outlook and opening again, it takes about four times as long to open, but opens succ...

error 0x80004005 and error 8004102A (Error with send/receive)
I have got the following error when synchronizing with my hotmail account, error 80004005 (network operation failed) and error 8004102A (Error with Send/Receive). can someone help me on how to fix this problem. all my other emails accounts linked to the outlook works fine but just the hotmail account that's receiving these two error messages thanks "warakawa" <warakawa@discussions.microsoft.com> wrote in message news:0095BB6F-E1A6-4FC0-BB54-FEF28D9B0143@microsoft.com... >I have got the following error when synchronizing with my hotmail account...

Publisher Question #3
How do you draw a line around a selected area within a text box? I want to draw or out line an area on a picture I inserted to show the area of the landscape that is for sale. thanks Cindy With the image in place, go to the left tool bar and select the rectangle and use it to draw the line. -- Don Vancouver USA "Suziq" <Suziq@discussions.microsoft.com> wrote in message news:A22B4234-EC55-428B-8065-FA7999BD78FE@microsoft.com... > How do you draw a line around a selected area within a text box? I want to > draw or out line an area on a picture I inserted to show...

Budget Questions
Using Money 2005 Standard Quicken has a very robust set-up for budgets. If the category was rateable (newspaper subscription) I could setup the budget for that category as such. If the category was not rateable (auto insurance which I pay once per year), I could setup the budget will the Auto Insurance amount in March. 1) I am not seeing this flexibility in Money's budget. Is it there and I am missing something? I ran some reports to look at the last 13 months of spending and income by category. I creating this report some numbers looked way off so I had to dig some more. I came up w...

error PRJ0019: A tool returned an error code from "Performing Post-Build Event..."
Hi, I am getting this error error PRJ0019: A tool returned an error code from "Performing Post- Build Event..." Not sure how to get rid of it. Can anyone please help? I am not sure what more info you will need to help me? Please let me know Thanks TS On Aug 12, 10:33=A0pm, Trups <Samant.Tru...@gmail.com> wrote: > Hi, > > =A0 I am getting this error > =A0error PRJ0019: A tool returned an error code from "Performing Post- > Build Event..." > Not sure how to get rid of it. =A0 Can anyone please help? =A0I am not > sure what more info you will...

Export report running under runtime
I have an application developed in Access 2000, to be distributed as an MDE. For those folks without Access, they install the free Access 2007 runtime. For the most part, this seems to be working well. However, when viewing a report in Preview mode, if you right-click and select the "Export" option (I have defined a custom menu which includes the standard "export" option), when using the runtime you immediately get an error, which says, "you tried to perform an operation involving a function or feature that was not installed in this version". Now, I know from som...

Special Upgrade error
I was running the "Special Upgrade" in Great Plains Utilities for 8.0 and service pack 4a. On a couple of the companies, I am given a couple of errors, they are: "the following sql statement produced an error: #208 aagUpdateGLAllocEntry" and then "Error, Invalid column name 'aaChangeDate'" These are Analtyical Accounting errors, but haven't been able to find a way to resolve them. Any help or insight would be appreciated. Thanks, KJ ...

Error message when replying to email
I connect remotely via dial-up VPN connection and able to receive emails, so the server connection is OK. I was able to send emails to both an inside and outside email, however when I reply to certain emails, I receive an error message "Network Problems are preventing connection to the microsoft exchange server". I am running W2k and Outlook 2000 and the server is Exchange 5.5. Any help would be appreciated. ...

Change Drop Down List Based on Check Boxes
I have two check boxes, Status and Type, that I want to use as criteria to change the drop down box of a combo box on the same form. There are three different scenarios: Status = True And Type = True - drop down shows only part list 1 Status = False And Type = True - drop down shows only part list 2 Type = False - drop down shows only part list 3 How would I set this up? Thanks in Advance. Put your lists in a table, with an ID for each list you want to be able to show. Pick an applicable event ( click should work ) for the checkboxes, then 3 if statements checking your conditions. W...

Newb in trouble
Hi again, several days ago I asked you for help and the reply was more than overwhelming: Thanks again! By now I'm having a problem again: This is my Code: if(pAPObj && pDavidObj) return TRUE; if(! pAPObj) { pAPObj = new CWrapAP(); } if(! pDavidObj) { pDavidObj = new CWrapDavid(); } These are the errors I get: c:\Public\ISEC.cpp(57): error C2582: Function'operator =' is not available in 'CWrapAP' c:\Public\ISEC.cpp(61): error C2582: Function 'operator =' is not available in 'CWrapDavid' c:\P...

Error Bars #5
How do you make each data point have a different standard deviation value for its error bar? Hi, On the Error Bars tab of the format dialog you can use the Custom +/- ref-edit controls to reference cell ranges. Cheers Andy Erin wrote: > How do you make each data point have a different standard deviation value for > its error bar? -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info ...

error 424 Object required
when I run this code in Access vba97 there is no error; However when i run the exact same cose in ACCESS2000 I get the run-time error of object Required (424); does any one have an Idea as to what is wrong? Private Sub Form_Current() Dim recClone As Recordset Dim intNewRecord As Integer Set recClone = Me.RecordsetClone intNewRecord = IsNull(Me.PersonID) If intNewRecord Then cmdFirst.Enabled = True cmdNext.Enabled = False cmdPrev.Enabled = True cmdLast.Enabled = True cmdNew.Enabled = False Exit Sub End If cmdNew.Enabled = True '...

Outlook Epxress Error Personal Address Error Msg
Until recently I used Outlook as my primary email. I installed and beganned to use Outlook Express instead..I just happened to like its features. After converting over I how receive an error message that reads "Your personal address book could not be opened. The file is either not accessible or is not a personal address book. Choose retry to use your personal address book, or choose cancel to not use your personal address book wit this application." The program crashes if I choose the option to cancel or to retry. I can not launch Outlook Epress. I have tried to locat...

Question Regarding Milestones Going Back to 0%
Hello, Does anybody know why this is happening or if there is a fix I can use? I’ve got a master project with several sub-projects in it. When I accept status updates from resources via PWA, all milestones that were 100% change to 0%. Does anybody know why this is happening or if there is a fix I can use? Thank you in advance! Tim ...

sort question #2
Hi, I have one column called 'ID'. ID is like A1, A2...B10, B11.... each ID has one alphabet + number(s). When I sort this column, I end up data sorted like...A1, A10, A11....A2, A21, A23....A3, A31....B1, B11.... I have to manually move data around because I want see them as A1, A2....A10, A11...A20, A21...B1, B2...B10, B11.... What should I do? Please help. Thank you. I'd insert a couple of columns adjacent to that ID column. Then do data|Text to columns (fixed width) and separate the single letter into its own column (and the numeric portion into its own). Then use th...

Returned error.
The error message is: 551 Command RCPT User not local and relaying not permitted from you The computer with Outlook is going through a Win2K router. Does anyone no if I need to change any settings on the router or is there a setting in Outlook that I need to make. ...

Best way to format errors with raiserror?
What is the best way to format an error when using raiserror? I need to be able to make it easy to unpack the error package on the client so it can get all info needed. Or is the SQLException good enough for catching sql errors on the client? This is with C#/VB 3.0. On Mar 25, 11:13=A0am, "Andy B." <a_bo...@sbcglobal.net> wrote: > What is the best way to format an error when using raiserror? I need to b= e > able to make it easy to unpack the error package on the client so it can = get > all info needed. Or is the SQLException good enough for catching...

Error message"The parameter is incorrect" when try save to CD/DVD
When I try to save a Word Document (Word 2002) to a CD or DVD in a CD or DVD drive, I get the error message "The parament in incorrect." Why won't Word let me save a document to a disk drive? Thank you. First save the document to the hard drive and then burn it to the CD or DVD using appropriate software. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Ourdune" <Ourdune@discussions.microsoft.com&g...

Questions re: new Exchange installation
Hello, I just put up an Exchange server, and I'm having a few problems that I need help with. 1) How do I log in to the System Administrator mailbox? 2) Where do I find mail that may be Missing in Action? 3) One or two users are having problems with OWA. They get the login dialog serveral times, and eventually they get to a page that says "Access denied". 4) Is it possible to create aliases to an address? I've tried adding addresses in the user's property page, but that doesn't work. Thanks in advance! Jeff ...

Printer Error #2
I am trying to use the Casio 360 with RMS? Has anyone used this printer with a desk top computer. It printed a few times then stopped. The cash drawer is also a Casio and has not opened. I get the 425 error. What could be locking the program. THe firewall is turned off. any ideas?? Thanks. Good afternoon The company I work for are Casio resellers, we were unable to get the Casio UP360 printer working with RMS. I would recommend Epson or a similar printer. Regards Joshua Smith "melcort" <melcort@discussions.microsoft.com> wrote in message news:AE9FB316-7945-4F...

Linking errors with Building VC6.0 MFC project on VC8.0(VS2005)
System Env: Windows XP SP2 .NET 2.0 I am trying to build a legacy(VC6) MFC application and have managed to resolve most if not all(you see - #pragma to ignore things don't count ) compile time errors and depricated functions. But now i get linker errors all of them complaining about "AddCopyIntRecords.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CWnd::PostNcDestroy(void)" Here are some project settings that i have used: I am compiling things in Active(Release) mode I am including all the external libraries(just on...

Data Validation Syntax Question
I'd like to restrict a user (me) from entering more than two digits after the decimal point in a cell. I have a checkbook spreadsheet and recently discovered (by accident) that I made a withdrawal entry of 117.122 a couple of years ago, but I can't figure out how to be sure to keep from doing it again. Am I missing something simple? Thanks for any help. Jim One way: =INT(A1*100)=(A1*100) multiply by 100 and see if it's a whole number If A1 is the activecell. Another way: =MOD(A1*100,1)=0 multiply by 100 and divide by 1. Check the remainder to see if it's 0. Jim &...

error box
On my spreadsheet I keep getting a little error box after I insert data which I assume is due to formatting, I just click ignore error and it goes away, is there a way to stop this message appearing in the first place, like somewhere I can switch it off. thanks Hi Scudo, > On my spreadsheet I keep getting a little error box after I insert data > which I assume is due to formatting, I just click ignore error and it goes > away, is there a way to stop this message appearing in the first place, like > somewhere I can switch it off. When it shows up, select "Error checking ...