This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 197394

Summary: Resolving member in array of struct fails
Product: cnd Reporter: fse <fse>
Component: Code ModelAssignee: nnnnnk <nnnnnk>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:
Attachments: Screenshot of the compiler's version dialog
Screenshot of the problem in Netbeans' edtitor window

Description fse 2011-04-04 13:45:47 UTC
Hi

The following example is compilable, but the editor complains "Unable to resolve identifier mi". I am using the MinGW TDM toolchain.
Thanks for your work!

//------------------------------------
#include <windows.h>
#include <winuser.h>

int main(int argc, char** argv)
{
	INPUT inputList[1];
	inputList[0].mi.dx = 1;
	return 0;
}
//------------------------------------
Comment 1 nnnnnk 2011-05-06 10:23:01 UTC
hello,

please, could you provide declaration of INPUT structure.

with declaration from http://msdn.microsoft.com/en-us/library/ms646270%28v=vs.85%29.aspx I can not reproduce the issue.
Comment 2 fse 2011-05-09 07:28:53 UTC
Created attachment 108184 [details]
Screenshot of the compiler's version dialog
Comment 3 fse 2011-05-09 07:30:24 UTC
Created attachment 108185 [details]
Screenshot of the problem in Netbeans' edtitor window
Comment 4 fse 2011-05-09 07:38:06 UTC
Hi

The INPUT structure is declared on my system in this way:

  typedef struct tagINPUT {
    DWORD type;
    __MINGW_EXTENSION union {
      MOUSEINPUT mi;
      KEYBDINPUT ki;
      HARDWAREINPUT hi;
    } DUMMYUNIONNAME;
  } INPUT,*PINPUT,*LPINPUT;

I added screenshots of my MinGW TDM version info window and of my Netbeans editor window showing the error as it is displayed on my 64 bit systems (I did not check on 32 bit). Hope this helps.

Regards

Friedemann Seebass
Comment 5 soldatov 2011-05-11 14:34:36 UTC
minimal test case:

typedef struct tagINPUT {
  DWORD type;
  __extension__ union {
		MOUSEINPUT mi;
		KEYBDINPUT ki;
		HARDWAREINPUT hi;
  } ;
} INPUT,*PINPUT,*LPINPUT;

int main(int argc, char** argv)
{
    INPUT inputList[1];
    inputList[0].mi.dx = 1;
    return 0;
}