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
 AutoComplete when class decl uses macro w/ten args
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

KirillMueller
Ketchup Master

72 Posts

Posted - Feb 16 2007 :  4:10:15 PM  Show Profile  Reply with Quote
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

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Feb 17 2007 :  07:05:30 AM  Show Profile  Reply with Quote
Unfortunately this is a known problem

case=3105

Are you able to call macro's with fewer parameters? 10 parameters is quite a lot.

zen is the art of being at one with the two'ness
Go to Top of Page

KirillMueller
Ketchup Master

72 Posts

Posted - Feb 18 2007 :  5:59:27 PM  Show Profile  Reply with Quote
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
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Feb 20 2007 :  12:45:35 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

KirillMueller
Ketchup Master

72 Posts

Posted - Feb 22 2007 :  08:46:42 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Feb 22 2007 :  2:31:33 PM  Show Profile  Reply with Quote
*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"

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Feb 23 2007 :  3:50:16 PM  Show Profile  Reply with Quote
case 3105 is fixed in VA 1548

zen is the art of being at one with the two'ness
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