473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Error C2027

I have created 2 window forms - Form1 and Form2. What I need to do now is to enable the event in Form2.h to access functions declared in Form1.cpp.

Below are parts of the codes:
Expand|Select|Wrap|Line Numbers
  1. //Form1.h
  2.  
  3. #pragma once
  4.  
  5. #include <stdio.h>
  6. #include <vcclr.h>
  7. #include <iostream>
  8. using namespace std;
  9. #include "File1.h"
  10. #include "File2.h"
  11. #include "Form3.h"
  12.  
  13. namespace Project {
  14.  
  15.     using namespace System;
  16.     using namespace System::IO;
  17.     using namespace System::ComponentModel;
  18.     using namespace System::Collections;
  19.     using namespace System::Windows::Forms;
  20.     using namespace System::Data;
  21.     using namespace System::Drawing;
  22.     using namespace System::Text;
  23.     using namespace System::Runtime::InteropServices;
  24.     using namespace System::Threading;
  25.  
  26.     /// <summary>
  27.     /// Summary for Form1
  28.     ///
  29.     /// WARNING: If you change the name of this class, you will need to change the
  30.     ///          'Resource File Name' property for the managed resource compiler tool
  31.     ///          associated with all .resx files this class depends on.  Otherwise,
  32.     ///          the designers will not be able to interact properly with localized
  33.     ///          resources associated with this form.
  34.     /// </summary>
  35.     public ref class Form1 : public System::Windows::Forms::Form
  36.     {
  37.     public:
  38.         Form1(void)
  39.         {
  40.             InitializeComponent();
  41.             //
  42.             //TODO: Add the constructor code here
  43.             //            
  44.         }
  45.  
  46. //Form1.cpp
  47. void Form1::test()
  48. {
  49.         //Functions here
  50. }
  51.  
  52. //Form2.h
  53. #pragma once
  54.  
  55. #include "Form3.h"
  56.  
  57. using namespace System;
  58. using namespace System::ComponentModel;
  59. using namespace System::Collections;
  60. using namespace System::Windows::Forms;
  61. using namespace System::Data;
  62. using namespace System::Drawing;
  63. using namespace AxVIDEOCAPLib;
  64.  
  65. namespace Project{
  66.  
  67.     ref class Form1;
  68. .
  69. .
  70. .
  71. #pragma endregion
  72.     public:
  73.         Form1 ^pdlg;
  74.                 int a;
  75.  
  76.  
  77. private: System::Void Form2_MouseDown(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
  78.              if (m_LeftMouseDown = true)
  79.              {
  80.                  pdlg->test() = a; //error here
  81.              }             
  82.          }
  83.  
Error 13 error C2027: use of undefined type 'Project::Form1' c:\documents and settings\desktop\projectrproject\Form2.h 194

Is there anyway I can resolve this error?

Thank you.
Oct 30 '07 #1
2 3600
kenobewan
4,871 Expert 4TB
Looks like you are using some C++. More info please.
Oct 30 '07 #2
Looks like you are using some C++. More info please.
Sorry... I'm using C++.NET in Microsoft Visual Studio 2005.
Oct 31 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
2
by: ramkrishna.kulkarni | last post by:
Hello, Please see the code below. class A : public B<C,D,E> { // some data and member variables } class P : public Q<R,S>, public T
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
0
by: kevin_g_frey | last post by:
Hello We have an internal tool that generates a series of .NET class wrappers for accessing our database entities. One of our database entities is called "System" so our correspond __gc class is...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
2
by: rohinichandrap | last post by:
Hi, I am getting the error C2027:Use of undefined type 'T' when I tried to compile some code in visual c++7.1 that went fine in Visual c++6.0. Below is the relevant code where the error has...
0
by: Rahul | last post by:
Hi Everyone, I get the error on the following code, error C2027: use of undefined type 'B' class AA { public: operator B() {
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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...

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.