473,471 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Create 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^)Application::OpenForms["ABCForm"];
abcForm->ExecutePublicFunction();

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^)Application::OpenForms["ABCForm"];
will compile without complaint. But then the line:
abcForm->ExecutePublicFunction();

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 1747
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*******@newsgroups.nospamwrote in message
news:uP****************@TK2MSFTNGP02.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^)Application::OpenForms["ABCForm"];
abcForm->ExecutePublicFunction();

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^)Application::OpenForms["ABCForm"];
will compile without complaint. But then the line:
abcForm->ExecutePublicFunction();

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*******@newsgroups.nospamwrote in message
news:uP****************@TK2MSFTNGP02.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^)Application::OpenForms["ABCForm"];
abcForm->ExecutePublicFunction();

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^)Application::OpenForms["ABCForm"];
will compile without complaint. But then the line:
abcForm->ExecutePublicFunction();

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.public.dotnet.framework 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
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...
1
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...
3
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...
3
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...
13
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...
8
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,...
12
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: ...
5
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#...
2
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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,...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
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.