If you have VS, don't do command compilation. I never came across a situation where VS recommended old syntax. If you need to create a fully managed assembly, choose Class Library project type. Use new syntax and compile using /clr:safe.
if you need to communicate with native libraries, compile with /clr switch which will produce mixed assemblies. Since you have VS IDE, best option is to use it to compile rather than doing through command. VS does things like manifest embedding automatically.
It doesn't work.
If I guess,
I'd say myself that the error is in the starting of the form.h
What if the variables are always reset to 0?
What if the form, would be... in a repeatative process?
So where should I put the variable Tsn11 ?
It should be managed assemblies. You can pack windows forms in to assemblies(DLLs) which can be used with multiple applications. Create a Class Library project and add reference to System.Windows.Forms assembly.
How to divide a class into multi-files(like c# partial)?
C++ or C++/CLI already supports this. One header file and several source files is possible. You can have a MainFormUI.cpp which includes MainForm.h and have methods like InitializeComponent. Another source file say MainForm.cpp which has all other method implementations.
Unfortunately, VS designer won't support this kind of separation and it will always write the auto-generated code to MainForm.h.