Click here to Skip to main content
14,027,403 members
Rate this:
 
Please Sign up or sign in to vote.
Under a vc.net project, windows are drawn through windows api.
At this point, I added a class testClass to my project, which is a window.
Normally you should write code like this:
TestClass ^ frmTest = gcnew testClass (filepath);
FrmTest - > eReLoadFile += gcnew EventHandler (this, & Form1:: frmTest_eReLoadFile);
FrmTest - > ShowDialog ();
But how should Win32 applications be expressed?

What I have tried:

TestClass ^ frmTest = gcnew testClass (filepath);
FrmTest - > eReLoadFile += gcnew EventHandler (this, & Form1:: frmTest_eReLoadFile);
FrmTest - > ShowDialog ();

Compile error

Error 413 Error C2061: Syntax Error: Identifier "testClass"
Posted
Updated 15-Feb-19 2:37am
Comments
Stefan_Lang 15-Feb-19 3:46am
   
1. if this is managed C++/CLI you should tag your question accordingly; this is not native C++ code
2. Your first line reference two different symbols, TestClass and testClass - which is it? symbols in C++ are case sensitive, and I would assume that extends to managed C++/CLI
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You code is for Windows Forms, Win32 (Winapi) applications are quite different beasts (see, for instance Module 1. Your First Windows Program - Windows applications | Microsoft Docs[^]).
   
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

You made some typo (used small letters) in your code, and used later big letters
TestClass ^ frmTest = gcnew TestClass (filepath);
frmTest - > eReLoadFile += gcnew EventHandler (this, & Form1:: frmTest_eReLoadFile);
frmTest - > ShowDialog ();
That doesnt like the compiler!!!

Pay more attention to details. Every bit counts ;-)
   
Comments
Richard MacCutchan 15-Feb-19 10:05am
   
You forgot the second one has a small t in the question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web03 | 2.8.190419.4 | Last Updated 15 Feb 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100