Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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[^]).
 
Share this answer
 
You made some typo (used small letters) in your code, and used later big letters
C++
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 ;-)
 
Share this answer
 
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900