Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Macro'd structure members unknown to VAX

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
foxmuldr Posted - Mar 03 2016 : 06:09:23 AM
Consider:



#define _WINDOWS 1

#if defiend(_LINUX)
    #define extra_members int32_t handle1; int32_t handle2;
#elif defined(_WINDOWS)
    #define extra_members HANDLE c; HANDLE d;
#endif

struct SExample
{
    // Common members
    int a;
    int b;

    extra_members;
};

int main(int argc, char* argv[])
{
    SExample ex;

#if defined(_WINDOWS)
    ex.c = 0;
    ex.d = 0;
#endif
}


The members "ex.c" and "ex.d" are not known to VAX.

Best regards,
Rick C. Hodgin
10   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Mar 21 2016 : 1:57:14 PM
When you have updated, the option to set has moved to:

VA Options -> Enhanced Listboxes -> Source of C/C++ content: Default Intellisense

hopefully this will help for you.
foxmuldr Posted - Mar 18 2016 : 3:37:45 PM
quote:
Originally posted by feline

Apologies, I should have listed the setting more clearly. You already have this turned On, turning Off:

VA Options -> Listboxes -> Get content from default Intellisense

will give you the listbox content from VA.

I am puzzled though, your about info says VA 2089, and our options dialog has been reorganised, making this setting clearer, in VA 2089.

Do you have this set the same in both IDE's where you are getting the wrong listbox content with? I tested VS2008 with the zip file of your project that I downloaded.

What effect, if any, does changing the option have on your listboxes and these macro items?



Correct. This machine was not updated apparently. It's running 2048.

I have three computers I use and a half dozen virtual machines. I switch between them based on the project I'm working on. The work I've been doing on that console application, and posting to here on the forum, is from the VM on my laptop. But, I thought I had updated everything everywhere. I don't do development on that project from this computer. But, I'll update it anyway.

Best regards,
Rick C. Hodgin
feline Posted - Mar 18 2016 : 3:32:14 PM
Apologies, I should have listed the setting more clearly. You already have this turned On, turning Off:

VA Options -> Listboxes -> Get content from default Intellisense

will give you the listbox content from VA.

I am puzzled though, your about info says VA 2089, and our options dialog has been reorganised, making this setting clearer, in VA 2089.

Do you have this set the same in both IDE's where you are getting the wrong listbox content with? I tested VS2008 with the zip file of your project that I downloaded.

What effect, if any, does changing the option have on your listboxes and these macro items?
foxmuldr Posted - Mar 18 2016 : 1:52:00 PM
quote:
Originally posted by feline
While testing this, I found that setting:
VA Options -> Enhanced Listboxes -> Source of C/C++ content: Default Intellisense

fixes the listboxes, both in my test case and in your solution. Can you try this, and see if it generally works? The alternative is to add the macros you need VA to know about to the va_stdafx.h file.



Where do I enable it? I'm using VS2010 and VS2008. These are the options I see:





Best regards,
Rick C. Hodgin
feline Posted - Mar 18 2016 : 1:29:05 PM
I have made a simplified test case, from your project, thank you for the code, and put in a bug report for this:

case=95890

While testing this, I found that setting:

VA Options -> Enhanced Listboxes -> Source of C/C++ content: Default Intellisense

fixes the listboxes, both in my test case and in your solution. Can you try this, and see if it generally works? The alternative is to add the macros you need VA to know about to the va_stdafx.h file.
foxmuldr Posted - Mar 08 2016 : 08:45:01 AM
quote:
Originally posted by feline

Do you have a lot of code with this sort of problem?



Here is the current code I have (beginning around line 175) where you can see that I have more structure variables defined now:
https://github.com/RickCHodgin/libsf/blob/master/utils/common/cpp/console/win/console_win.h

You can see that the file is growing as features are added, though I won't have many more than this as my project is approaching the extent to which I desire to develop it at the present time :-). However, it will be a common #include file and scheme/theme I use for writing code which works across multiple platforms in the various project I'm authoring. Presently I am planning:

(1) i80386 and later assembler, called AAlive (no documentation, just a standard assembler using Intel syntax)
(2) A low-level language, called BAlive (incomplete definition, but close https://github.com/RickCHodgin/libsf/blob/master/ideas/balive.txt)
(3) A C-like language, called CAlive (https://github.com/RickCHodgin/libsf/blob/master/utils/common/cpp/console/win/console_win.h)

The other code I develop will be similar, but developed for Linux and Solaris. I will use the Visual Studio project on a network drive, and develop the code in Visual Studio, but will compile it in a command window in the native OS in that directory using make files and GCC. Seems to work well. :-)

Best regards,
Rick C. Hodgin
feline Posted - Mar 08 2016 : 12:28:31 AM
Do you have a lot of code with this sort of problem? I have added the Windows macro declaration to a "va_stdafx.h" file, so the file contains:

#define console_os_struct_variables	HWND hwnd;						RECT rc;


using this file is explained here:

https://wholetomato.fogbugz.com/default.asp?W302

workable if you only have a few of these, but it's not going to scale well if you have lots of code like this.
foxmuldr Posted - Mar 03 2016 : 5:17:33 PM
The sample I provided was corrected with the fixes you suggest, a Rebuild option, and a restart of the IDE. However, my real-world implementation is a little different than the contrived sample, and it's deeper and was not corrected.

You can replicate what I'm doing here by downloading the ZIP file at:
https://github.com/RickCHodgin/libsf

Or clone it here:
C:\> git clone https://github.com/RickCHodgin/libsf.git

If you download the project, installed to c:\libsf\ (some paths are hard-coded), and then open the C:\libsf\utils\common\cpp\console\projects\vs2008\console.sln project in Visual Studio 2008 or later, and go into the iConsole_win_find_byHwnd__callback() function in c:\libsf\utils\common\cpp\console\win\console_win.cpp, which was on line 387 as of the time of this post, you'll see the real reference there to console->hwnd:
if (console->hwnd == (HWND)cb->extra1)


If you Alt+G to the SConsole structure, you'll see the last line of the struct which includes the "console_os_struct_variables" macro. If you Alt+G on that macro it takes you to the c:\libsf\utils\common\cpp\console\win\console_win.h file, which has the definition of the extra members.

That particular file is used because of the macro found in c:\libsf\utils\common\cpp\console\console.h around line 96 thru 102, which is here:


  #if defined(_WINDOWS)
    #include "win\console_win.h"
  #elif defined(_LINUX)
    #include "linux\console_linux.h"
  #elif defined(_SOLARIS)
    #include "solaris\console_solaris.h"
  #endif


It still doesn't find it. I only have VS2008 installed on the virtual machines I use for development. The VAX info is here:


License: ... (1-user license) Support ends 2017.02.05
VA_X.dll file version 10.9.2089.0  built 2016.02.01
DevEnv.exe version 9.0.30729.1 Professional
msenv.dll version 9.0.30729.1
Font: Ubuntu Mono 12 (pixels)
Comctl32.dll version 6.0.3790.5190
Windows Server 2003 5.2 Build 3790 Service Pack 2
Single processor (x86)
Language info: 1252, 0x409

Platform: Win32
Stable Includes:
C:\Program Files\Microsoft Visual Studio 9.0\VC\include;
C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include;
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include;
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include;

Other Includes:

Stable Source Directories:
C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfc;
C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\mfcm;
C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\src\atl;
C:\Program Files\Microsoft Visual Studio 9.0\VC\crt\src;


It's no biggie because I can still get to it. But, it would be nice to have it recognize those members.

Best regards,
Rick C. Hodgin
feline Posted - Mar 03 2016 : 2:30:43 PM
Can you try turning on deeper macro parsing, as explained here:

https://wholetomato.fogbugz.com/default.asp?W363

and re-order the #defines, so they are like this:

#if defined(_WINDOWS)
#define extra_members HANDLE c; HANDLE d;
#elif defiend(_LINUX)
#define extra_members int32_t handle1; int32_t handle2;
#endif


this is fixing the problem for me in VS2015 with VA 2089.
feline Posted - Mar 03 2016 : 12:54:21 PM
Which IDE and version of VA are you using?

Do you have IDE intellisense turned On or Off?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000