Intellisense not picking up these structs

A

Adam Clauss

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?
 
T

Tanveer Gani [MSFT]

--------------------
From: "Adam Clauss" <[email protected]>
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#[email protected]>
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!TK2MSFTNGP10.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 made
no difference:
typedef struct
{
DirectoryArray Directories;
} XOrgConfig;


I am not sure which is considered "better."
Any suggestions?

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top