By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,494 Members | 976 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,494 IT Pros & Developers. It's quick & easy.

Intellisense not picking up these structs

P: n/a
I have a few variables that I want declared as global. To accomplish this,
I made the files globals.h and globals.cpp.

In globals.h I have the declarations for the structs, and one variable
actually defined. It is defined w/ the extern keyword. Then, in
globals.cpp I actually define that extern variable. If my understanding of
this is correct, then by any file that needs access to this variable simply
needs to include globals.h right?

It seems to.. "sort-of" work. While everything compiles correctly, the
Intellisense does not pick any of this up. AKA: when I type in the name of
the one variable I defined and hit the period key, I do not get a list of
members as I should. Any ideas on this?

-----------globals.h-----------
#pragma once

struct XOrgDirectory
{
CString path;
bool searchSubs;
};

typedef CArray<XOrgDirectory> DirectoryArray;

struct XOrgConfig
{
DirectoryArray Directories;
};

extern XOrgConfig Config;
-----------globals.cpp-----------
XOrgConfig Config;


I have also tried declaring the structs in the following manner, but it made
no difference:
typedef struct
{
DirectoryArray Directories;
} XOrgConfig;
I am not sure which is considered "better."
Any suggestions?

--
Adam Clauss
ca*****@tamu.edu
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

--------------------
From: "Adam Clauss" <ca*****@tamu.edu>
Subject: Intellisense not picking up these structs
Date: Wed, 27 Aug 2003 18:30:18 -0500
Lines: 55
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eV**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.vc
NNTP-Posting-Host: dhcp-128-194-69-36.resnet.tamu.edu 128.194.69.36
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vc:27650
X-Tomcat-NG: microsoft.public.dotnet.languages.vc

I have a few variables that I want declared as global. To accomplish this,
I made the files globals.h and globals.cpp.

In globals.h I have the declarations for the structs, and one variable
actually defined. It is defined w/ the extern keyword. Then, in
globals.cpp I actually define that extern variable. If my understanding of
this is correct, then by any file that needs access to this variable simply
needs to include globals.h right?

It seems to.. "sort-of" work. While everything compiles correctly, the
Intellisense does not pick any of this up. AKA: when I type in the name of
the one variable I defined and hit the period key, I do not get a list of
members as I should. Any ideas on this?

-----------globals.h-----------
#pragma once

struct XOrgDirectory
{
CString path;
bool searchSubs;
};

typedef CArray<XOrgDirectory> DirectoryArray;

struct XOrgConfig
{
DirectoryArray Directories;
};

extern XOrgConfig Config;
-----------globals.cpp-----------
XOrgConfig Config;


I have also tried declaring the structs in the following manner, but it madeno difference:
typedef struct
{
DirectoryArray Directories;
} XOrgConfig;
I am not sure which is considered "better."
Any suggestions?

--
Adam Clauss
ca*****@tamu.edu


Adam, I'm unable to reproduce this problem with either of VS .Net 2002 and
2003. Have you added your files to the project? "extern" should have no
effect on Intellisense. You can also try deleting your project .ncb file
(after you close the solution).

--
Tanveer Gani, Microsoft Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.