473,799 Members | 3,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Should be simple C++ managed header include question

I have a split container on my form,
from within one of them I wish to reach
the main from of the app. I'm having
problems with the headers and namespaces.
I want something like this:

//within right pane form
ABCForm^ abcForm = (ABCForm^)Appli cation::OpenFor ms["ABCForm"];
abcForm->ExecutePublicF unction();

If I include the main form header I get:

'ABCForm' : undeclared identifier
'abcForm' : undeclared identifier
syntax error: ')'
and many more....

The two forms are of the same namespace.

if within the namespace I do this:

namespace ABC{
ref class VPEForm;
public ref class OtherForm : public Form
{
the line:
ABCForm^ abcForm = (ABCForm^)Appli cation::OpenFor ms["ABCForm"];
will compile without complaint. But then the line:
abcForm->ExecutePublicF unction();

I get:
use of undefined type : 'ABC:ABCForm'
Like it sees the 'ref class VPEForm' as the complete definition of
the class.

So what's the proper way to reference the other form and handle
the includes and namespace from another form?

This should be simple I know...

Thanks,

Steven

Jul 9 '07 #1
3 1764
The solution I ended up using was putting the code and includes in the
cpp file. This prevented the crossed up references in the headers.

"Steven Edison" <Ed*******@news groups.nospamwr ote in message
news:uP******** ********@TK2MSF TNGP02.phx.gbl. ..
>I have a split container on my form,
from within one of them I wish to reach
the main from of the app. I'm having
problems with the headers and namespaces.
I want something like this:

//within right pane form
ABCForm^ abcForm = (ABCForm^)Appli cation::OpenFor ms["ABCForm"];
abcForm->ExecutePublicF unction();

If I include the main form header I get:

'ABCForm' : undeclared identifier
'abcForm' : undeclared identifier
syntax error: ')'
and many more....

The two forms are of the same namespace.

if within the namespace I do this:

namespace ABC{
ref class VPEForm;
public ref class OtherForm : public Form
{
the line:
ABCForm^ abcForm = (ABCForm^)Appli cation::OpenFor ms["ABCForm"];
will compile without complaint. But then the line:
abcForm->ExecutePublicF unction();

I get:
use of undefined type : 'ABC:ABCForm'
Like it sees the 'ref class VPEForm' as the complete definition of
the class.

So what's the proper way to reference the other form and handle
the includes and namespace from another form?

This should be simple I know...

Thanks,

Steven

Jul 9 '07 #2
The solution I ended up using was putting the code and includes in the
cpp file. This prevented the crossed up references in the headers.

"Steven Edison" <Ed*******@news groups.nospamwr ote in message
news:uP******** ********@TK2MSF TNGP02.phx.gbl. ..
>I have a split container on my form,
from within one of them I wish to reach
the main from of the app. I'm having
problems with the headers and namespaces.
I want something like this:

//within right pane form
ABCForm^ abcForm = (ABCForm^)Appli cation::OpenFor ms["ABCForm"];
abcForm->ExecutePublicF unction();

If I include the main form header I get:

'ABCForm' : undeclared identifier
'abcForm' : undeclared identifier
syntax error: ')'
and many more....

The two forms are of the same namespace.

if within the namespace I do this:

namespace ABC{
ref class VPEForm;
public ref class OtherForm : public Form
{
the line:
ABCForm^ abcForm = (ABCForm^)Appli cation::OpenFor ms["ABCForm"];
will compile without complaint. But then the line:
abcForm->ExecutePublicF unction();

I get:
use of undefined type : 'ABC:ABCForm'
Like it sees the 'ref class VPEForm' as the complete definition of
the class.

So what's the proper way to reference the other form and handle
the includes and namespace from another form?

This should be simple I know...

Thanks,

Steven

Jul 9 '07 #3
Hi Steven,

I have added a reply to you in microsoft.publi c.dotnet.framew ork newsgroup,
please check it there, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
Jul 10 '07 #4

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

Similar topics

10
9530
by: Gary Hughes | last post by:
I'm getting the following error when attempting to link a managed C++ dll. I can't find any reference to these errors with google. Can anyone help? I've included the class definition causing the errors below. Everything compiles fine and all the types are defined, it appears that the template type itga::order_collection::iterator is causing the trouble. Gary.
1
1885
by: knormand | last post by:
I have an older MFC C++ app with some new Managed C++ being thrown in. Recently I turned on the /clr flag for one of my old .cpp files. I then placed '#pragma unmanaged' just below my #include statements near the top of the file. These headers contain older unmanaged class declarations. When running I discovered a new bug, a crash, at a point in execution that was nowhere near any code that's been touched in quite a while. After hunting down...
3
2247
by: Eckart Haug | last post by:
I'm working with C# objects from managed C++ using the gcroot template. There'a a C++ header containing the definition of a C++ class: #using <mscorlib.dll> #include <vcclr.h> #using <CSharpModule.dll> class CPlusPlusClass
3
2783
by: Thorsten | last post by:
HI I'm a C# developer and unfortunately I have to write now some code in managed and unmanaged C++. In this area I'm Newbie and therefore please forgive me if this is a really simple question.
13
5058
by: bonk | last post by:
Hello, I am trying to create a dll that internally uses managed types but exposes a plain unmanaged interface. All the managed stuff shall be "wrapped out of sight". So that I would be able to use that dll from pure unmanaged code (for example inherit from classes in that dll). Is something like that possible. I heared something called ManWarp tried that approach. If it is possible, how can I do that. Maybe there is a small litttle
8
1449
by: Ignazio | last post by:
When creating forms with Visual C++ 2005, all the code for building the interface (the InitializeComponent method) and event handlers are set in the ..H file, as they were inline methods. So I ask, for managed code they are effectively inline methods or they are handled indifferently if they are in the class declaration or outside of it? Do I still have to write declarations and definitions in different files for avoiding multiple compiling...
12
6724
by: Cmtk Software | last post by:
I'm trying to define an enum which will be used from unmanaged c++, C++/CLI managed c++ and from C#. I defined the following enum in a VS dll project set to be compiled with the /clr switch: public enum Days { Sunday };
5
7272
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I have a class that is writen in unmanaged pure native C++. This class files (h and cpp) are inserted to a managed C++ (VC++ 2005, C++/CLI) DLL compoenet. This DLL compoenet is used in a C# application. My question is: Does the performance of the unmanaged pure native C++ class described above is the same if it was a in a pure unmanaged native C++ DLL component?
2
2317
by: kelvin.koogan | last post by:
Our company has a mix of users with VS2003 & VS2005. I'm am having difficulty working out how components written with these 2 tools can be written together. I want to be able to a) incorporate a C++/CLI DLL written in VS2005 into a managed extensions app written with VS2003 and b) use a managed extensions DLL written with VS2003 in a C++/CLI app written in VS2005. How can I do this? Immediate problems I found:
0
9688
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
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
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...
1
10243
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
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
6809
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();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4146
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
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.