473,847 Members | 1,698 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 1766
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
9533
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
1887
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
2785
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
5062
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
6725
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
7275
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
2318
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
9886
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
9730
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,...
1
10706
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,...
1
7882
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
5719
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...
0
5911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4528
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
4119
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3164
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.