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
 Feature Requests
 Macro'd structure members unknown to VAX
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

foxmuldr
Tomato Guru

USA
316 Posts

Posted - Mar 03 2016 :  06:09:23 AM  Show Profile  Reply with Quote
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

Edited by - foxmuldr on Mar 03 2016 07:56:01 AM

feline
Whole Tomato Software

United Kingdom
17771 Posts

Posted - Mar 03 2016 :  12:54:21 PM  Show Profile  Reply with Quote
Which IDE and version of VA are you using?

Do you have IDE intellisense turned On or Off?

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

feline
Whole Tomato Software

United Kingdom
17771 Posts

Posted - Mar 03 2016 :  2:30:43 PM  Show Profile  Reply with Quote
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.

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

foxmuldr
Tomato Guru

USA
316 Posts

Posted - Mar 03 2016 :  5:17:33 PM  Show Profile  Reply with Quote
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

Edited by - foxmuldr on Mar 03 2016 5:18:44 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17771 Posts

Posted - Mar 08 2016 :  12:28:31 AM  Show Profile  Reply with Quote
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.

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

foxmuldr
Tomato Guru

USA
316 Posts

Posted - Mar 08 2016 :  08:45:01 AM  Show Profile  Reply with Quote
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

Edited by - foxmuldr on Mar 08 2016 08:46:51 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17771 Posts

Posted - Mar 18 2016 :  1:29:05 PM  Show Profile  Reply with Quote
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.

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

foxmuldr
Tomato Guru

USA
316 Posts

Posted - Mar 18 2016 :  1:52:00 PM  Show Profile  Reply with Quote
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
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17771 Posts

Posted - Mar 18 2016 :  3:32:14 PM  Show Profile  Reply with Quote
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?

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

foxmuldr
Tomato Guru

USA
316 Posts

Posted - Mar 18 2016 :  3:37:45 PM  Show Profile  Reply with Quote
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

Edited by - foxmuldr on Mar 18 2016 3:39:20 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17771 Posts

Posted - Mar 21 2016 :  1:57:14 PM  Show Profile  Reply with Quote
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.

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:
© 2021 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000