T O P I C R E V I E W |
KirillMueller |
Posted - Feb 16 2007 : 4:10:15 PM For the following code, VAX's AutoComplete/AutoSuggest features don't work:
#define TEN()
class CTest {
TEN(a, b, c, d, e, f, g, h, i, j);
int m_iTest;
void testProc() {
this.
}
};
Just paste this into a new C++ file, delete "this." and re-type it. The "this" keyword is underlined with a red zigzag line, the dot doesn't get auto-converted to -> and no suggestions are offered. The problem is triggered by the number of arguments to the "TEN" macro: Just removing ", j" from the argument list makes everything work fine. (The number of parameters the TEN macro is declared with doesn't matter.)
Is this some hard-coded limit I've stumbled upon? By setting it to, say, 40, you would make me a happy VAX user again. I have no idea for a workaround, and I really need those macro beasts employed exactly like in the example above.
I've tested it with all versions between 1539 and 1545.
VA_X.dll file version 10.3.1545.0 built 2007.02.15 VAOpsWin.dll version 1.3.4.3 VATE.dll version 1.0.5.7 DevEnv.exe version 8.0.50727.762 msenv.dll version 8.0.50727.762 Font: Consolas 17(Pixels) Comctl32.dll version 6.0.2900.2982 Windows XP 5.1 Build 2600 Service Pack 2 Single processor |
6 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Feb 23 2007 : 3:50:16 PM case 3105 is fixed in VA 1548 |
feline |
Posted - Feb 22 2007 : 2:31:33 PM *ah* so this is where macro's with so many parameters are coming from. This makes sense now. Without some form of context it just sounds "odd" |
KirillMueller |
Posted - Feb 22 2007 : 08:46:42 AM I need a generic wrapper for all interfaces of a COM library that wraps all invocations of all functions. I used the macro solution because I could do this using search/replace in the header file and didn't need to change all implementations, plus several other advantages I'm too lazy to enumerate. My macro
WRAP_COM_METHOD2(Name, Type1, Arg1, Type2, Arg2)
expands to something like
STDMETHODIMP Name(Type1 Arg1, Type2 Arg2) { Entry(); HRESULT hr = Name_Imp(Arg1, Arg2); Exit(); return hr; }
HRESULT Name_Imp(Type1 Arg1, Type2 Arg2)
Some methods of my interfaces have up to 9 parameters, thus, the corresponding macro WRAP_COM_METHOD9 accepts 20 parameters. -- The solution may look messy, I like it anyway. |
feline |
Posted - Feb 20 2007 : 12:45:35 PM 20 parameters! Personally I would suggest a function taking 20 parameters needs looking at and changing, let alone a macro. Once I get beyond 3 or 4 parameters I tend to wrap things up in a structure, since it just makes my life easier. Still, that is a different discussion, and assumes you are in a position to change all of the effected code.
Your workaround fascinates me, since according to the notes on the case I tried a very similar trick with VA's stdafx.h file, but it did not work.
The good news is that one of the developers is looking into this, but I cannot give a good estimate on when this might be fixed yet. |
KirillMueller |
Posted - Feb 18 2007 : 5:59:27 PM The problem disappears when nine or fewer parameters are used, but I use macros with up to 20 parameters in my code. Does that answer your question?
Anyway, I've found a workaround. The following code (with the same "semantics" as the example above) does not confuse VAX:
#define WRAP(a, b) a b
#define TEN()
class CTest {
WRAP(TEN, (a, b, c, d, e, f, g, h, i, j));
int m_iTest;
void testProc() {
this->
}
};
Employing this workaround makes my code yet more unreadable, but only temporarily I hope |
feline |
Posted - Feb 17 2007 : 07:05:30 AM Unfortunately this is a known problem
case=3105
Are you able to call macro's with fewer parameters? 10 parameters is quite a lot. |
|
|