FW: BON interpreter GME2000COM.h

GME GME
Mon Sep 30 17:49:46 CDT 2002



----------
From: 	Sandeep Neema
Sent: 	Monday, September 30, 2002 11:49:45 AM
To: 	GME Group
Subject: 	RE: BON interpreter GME2000COM.h
Auto forwarded by a Rule

I don't know if we ought to be discussing macros in this list, but could not resist an opportunity to correct Miklos :-)

Invoking COMVERIFY with something like:

	COMVERIFY(("some_string", long_val))

would be pretty meaningless, because when you have an expression like

	y = (a, b)

y gets the value of b. So, in this case COMVERIFY is passed long_val, and the "some_string" argument is simply ignored.


Sandeep

-----Original Message-----
From: GME Group 
Sent: Monday, September 30, 2002 11:21 AM
To: GME List
Subject: FW: BON interpreter GME2000COM.h


>
>----------
>From: 	Miklos Maroti
>Sent: 	Monday, September 30, 2002 11:21:24 AM
>To: 	'Peter Volgyesi'; GME Group
>Subject: 	RE: BON interpreter GME2000COM.h
>Auto forwarded by a Rule
>
> > Please refer to the following macro in GME2000COM.h
> > #define COMTHROW(code) { HRESULT e = (code); \
> > if(e != S_OK) { COMVERIFY((##code, e)); throw e; } }
>
> > This macro is being used as follows in ComponentObj.cpp
> > COMTHROW(project->BeginTransaction(terr))
> >
> > When expanded it seems to me that the macro would invoke the function
> > "project->BeginTransaction()" twice, which I don't think is a desirable
> > behavior.
>
> This is "interesting". I do not know, why did we declare COMTHROW this way
> in BON. However, this causes problems only, if a COM methodcall has failed.

That line is mistyped. The ## should be replaced with #, which makes it
a string. It should display "code" in the assertion.

Miklos



More information about the gme-users mailing list