Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Parsing issue?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ajtruckle
Ketchup Master

81 Posts

Posted - Jul 11 2010 :  11:14:12 AM  Show Profile  Reply with Quote
Hi

I have this code:

				CATCH(CArchiveException, arEx)
				{
					if(arEx->m_cause != CArchiveException::endOfFile)
					{
						// problem reading in from log file into variables
						arEx->GetErrorMessage(szError, _MAX_PATH);
						AfxMessageBox(szError, MB_OK|MB_ICONERROR);

						bOK = FALSE;
					}
					bContinue = FALSE;
				}
				END_CATCH


The arEx->m_cause and all other bits inside show with the ~~~~ underneath. Why?

I am using the latest build.

Andrew




Edited by - ajtruckle on Jul 11 2010 11:14:47 AM

Luke1410
Senior Member

32 Posts

Posted - Jul 12 2010 :  05:17:52 AM  Show Profile  Reply with Quote
If I had to guess, VAX would get confused by the CATCH-macro.
Did u try whether it works if u replace the CATHC-macro with a simple catch-statement like:
catch(CArchiveException arEx)
{
}
?
Go to Top of Page

ajtruckle
Ketchup Master

81 Posts

Posted - Jul 12 2010 :  05:23:32 AM  Show Profile  Reply with Quote
Hello!

Yes, changing to try/catch does work but it is not really a viable option for me to go and change all of the code though my project where this is affected.

I would appreciate VAX being adjusted to accomodate this fairly common coding practice. I continued to use the TRY/CATCH approach because you don't need to delete the exception.

Andrew
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jul 12 2010 :  1:09:44 PM  Show Profile  Reply with Quote
Can you please provide the source for the MACRO "CATCH"?
As Luke1410 said, it is possibly caused by this macro. Once I have the macro, I can look into the problem.
Go to Top of Page

ajtruckle
Ketchup Master

81 Posts

Posted - Jul 12 2010 :  1:52:40 PM  Show Profile  Reply with Quote
Hello

This is standard C++ code:

TRY
{

}
CATCH(....)
{

}
END_CATCH

within the VC++ editor. You should already have this, no? It is nothing personally written.

Andrew
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jul 12 2010 :  3:27:26 PM  Show Profile  Reply with Quote
Yes, sorry, I do have this macro

I am seeing the same effect here and put in a bug report for this:

case=47143

Now, I can offer 2 workarounds:
1. Turn off VA Options -> Advanced -> Refactoring -> Automatically highlight references to symbol under cursor
2. You don't need to turn off highlight refs. if you make this change:
Open VA's stdafx.h as described here:
http://docs.wholetomato.com?W302
then find CATCH macro and replace with this one:
#define CATCH(q, e) }q*e;{

Edited by - accord on Jul 12 2010 3:31:22 PM
Go to Top of Page

ajtruckle
Ketchup Master

81 Posts

Posted - Jul 12 2010 :  3:36:55 PM  Show Profile  Reply with Quote
Thanks. I have put that into my version of the stdafx.h file.

You might like to consider do the others too. I think:

AND_CATCH
http://msdn.microsoft.com/en-us/library/azc4yha6.aspx

Andrew
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000