473,811 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

class dependencies and namespace

Hi,

I am trying to solve an issue with a dependency between two classes as
shown below :

atlwince.h (declaration and definition is done in the .h)
----------

struct _ATL_AYGSHELL_S TATE
{
public:
// Handle initialization and cleanup of AYGSHELL
_ATL_AYGSHELL_S TATE()
{
if (!AYGSHELL::SHS ipInfo(...)) <- Not yet defined
{
m_nAygshellUIMo del = Smartphone;
}
else
{
m_nAygshellUIMo del = PocketPC;
}
}
};

const _ATL_AYGSHELL_S TATE& ATL_CDECL _AtlGetAygshell State();
BOOL WINAPI AtlIsAygshellSu pported();
int WINAPI AtlGetAygshellU IModel();
BOOL WINAPI AtlIsDRAEnabled ();
void WINAPI AtlEnableDRA(BO OL bEnable);

namespace AYGSHELL
{
inline BOOL SHSipInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT
fWinIni)
{
const _ATL_AYGSHELL_S TATE& aygshellState = _AtlGetAygshell State();
ASSERT(aygshell State.m_pfnSHSi pInfo);

return aygshellState.m _pfnSHSipInfo(u iAction, uiParam, pvParam, fWinIni);
}
}// namespace AYGSHELL

As you can see I have a mutual dependency bewteen these two classes.
When I compile I get :

error C2653: 'AYGSHELL' : is not a class or namespace name

Dec 30 '07 #1
2 1630
On Dec 29, 6:14 pm, Mosfet <anonym...@free .frwrote:
Hi,

I am trying to solve an issue with a dependency between two classes as
shown below :

atlwince.h (declaration and definition is done in the .h)
----------

struct _ATL_AYGSHELL_S TATE
{
public:
// Handle initialization and cleanup of AYGSHELL
_ATL_AYGSHELL_S TATE()
{
if (!AYGSHELL::SHS ipInfo(...)) <- Not yet defined
{
m_nAygshellUIMo del = Smartphone;
}
else
{
m_nAygshellUIMo del = PocketPC;
}
}

};

const _ATL_AYGSHELL_S TATE& ATL_CDECL _AtlGetAygshell State();
BOOL WINAPI AtlIsAygshellSu pported();
int WINAPI AtlGetAygshellU IModel();
BOOL WINAPI AtlIsDRAEnabled ();
void WINAPI AtlEnableDRA(BO OL bEnable);

namespace AYGSHELL
{
inline BOOL SHSipInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT
fWinIni)
{
const _ATL_AYGSHELL_S TATE& aygshellState = _AtlGetAygshell State();
ASSERT(aygshell State.m_pfnSHSi pInfo);

return aygshellState.m _pfnSHSipInfo(u iAction, uiParam, pvParam, fWinIni);
}

}// namespace AYGSHELL

As you can see I have a mutual dependency bewteen these two classes.
When I compile I get :

error C2653: 'AYGSHELL' : is not a class or namespace name

Just forward declare AYGSHELL::SHSip Info before the declaration of
struct _ATL_AYGSHELL_S TATE

namespace AYGSHELL
{
inline BOOL SHSipInfo(UINT uiAction, UINT uiParam, PVOID
pvParam, UINT fWinIni);
}

Thanks and regards
Sonison James
Dec 30 '07 #2
Mosfet wrote:
Hi,

I am trying to solve an issue with a dependency between two classes as
shown below :

atlwince.h (declaration and definition is done in the .h)
----------

struct _ATL_AYGSHELL_S TATE
{
public:
// Handle initialization and cleanup of AYGSHELL
_ATL_AYGSHELL_S TATE()
{
if (!AYGSHELL::SHS ipInfo(...)) <- Not yet defined
{
m_nAygshellUIMo del = Smartphone;
}
else
{
m_nAygshellUIMo del = PocketPC;
}
}
};

const _ATL_AYGSHELL_S TATE& ATL_CDECL _AtlGetAygshell State();
BOOL WINAPI AtlIsAygshellSu pported();
int WINAPI AtlGetAygshellU IModel();
BOOL WINAPI AtlIsDRAEnabled ();
void WINAPI AtlEnableDRA(BO OL bEnable);

namespace AYGSHELL
{
inline BOOL SHSipInfo(UINT uiAction, UINT uiParam, PVOID pvParam,
UINT fWinIni)
{
const _ATL_AYGSHELL_S TATE& aygshellState = _AtlGetAygshell State();
ASSERT(aygshell State.m_pfnSHSi pInfo);

return aygshellState.m _pfnSHSipInfo(u iAction, uiParam, pvParam,
fWinIni);
}
}// namespace AYGSHELL

As you can see I have a mutual dependency bewteen these two classes.
When I compile I get :

error C2653: 'AYGSHELL' : is not a class or namespace name
Also, change your names. _ATL_AYGSHELL_S TATE is a reserved identifier.
Identifiers with a leading underscore followed by an uppercase letter
are reserved to the implementation in all scopes.
Dec 30 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
2025
by: Steven T. Hatton | last post by:
I will assume many people reading this would never create anything similar to the example below. So let me preface this with _*IF*_ you were in a situation where you had to chose between using #includes or forward declaring each class in diamond.h, which would you choose? Why? If there is something fundamentally wrong with the way I've approached the structure of this example, I am interested to know. As for preferences and tastes, I...
0
2496
by: big A | last post by:
I am receiving an error stating that File or Assembly name <filname.dll>, or one of its dependencies, was not found In one assembly I have three abstract classes In another I have three derived classes from the abstract classes The 1st class contains the 2nd class The 2nd class is a custom collection for the 3rd class
5
7289
by: Keith Bannister | last post by:
I'm new to .net so here goes. I'm tying to deserialize a class that is associated with an XML schema. I created the C# class with xsd.exe as below: xsd.exe /c /n:somenamespace properties.xsd this creates properties.cs
3
12667
by: Vinay | last post by:
HI, I am writing a utility which will list all the services running on system like services.msc program. Now I want to display the Startup type of service like manual/automation. How can I get that property? I just want to read that property, and do not want to create new one. TIA,
0
1177
by: menkaur | last post by:
I was writing simple test program for using class libraries (OS: Windows 2003 Server). The problem I’ve got: runtime error: ------------------------------------------- An unhandled exception of type 'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll Additional information: Remoting configuration failed with the exception System.IO.FileNotFoundException: File or assembly name System.Runtime.Remoting, or one of its...
15
5689
by: Laurent Lequenne | last post by:
Hello All, I'm currently developing a free windows Scrabble (in french :)) application that uses extensively the WebBrowser class of NET 2.0 for configuration, and data browsing. It works 100% on my machine, with the WebBrowser Class, and the Microsoft.MsHtml component. I can access all elements on the pages through the events, I can change some parts. Everything is rendered with XSLTs and changing directly the document through the ...
6
2197
by: silversurfer2025 | last post by:
Hello world, I seem to go from one tricky error to the other (at least tricky for me). I am using qt and another code-package where many other files are stored which I need (written by someone else). The problem is that within this package and qt there are two definitions of the class 'Region' such that I get the compiler-error: use of 'Region' is ambiguous /usr/local/Trolltech/Qt-4.1.4/include/QtGui/qwindowdefs.h:124: error: first...
14
6759
by: amitsoni.1984 | last post by:
hi, I have some values(say from -a to a) stored in a vector and I want to plot a histogram for those values. How can I get it done in python. I have installed and imported the Matplotlib package but on executing the code =hist(eig, 10) # make a histogram I am getting an error saying "NameError: name 'hist' is not defined". Is there any other way to plot histograms over a given range?
7
8121
by: Russell Mangel | last post by:
/* Hi, I am trying to hold a reference to un-managed pointer IStorage. The client/callers will make many accesses to IStorage, but only in-directly. For performance reasons IStorage needs to be opened once, and a reference held by MyClass for duration of session. 1. Should I use a native class to do the native stuff?
0
9728
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10135
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9205
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7670
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6890
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.