I am attempting to convert a c# to c++ with reflector. The code compiled, disassembled and reconstructed code is generating this error:
1>c:\users\user\documents\visual studio 2008\projects\reflect_readoo\reflect_readoo\readoo.cpp(2) : error C2059: syntax error : 'public'
1>c:\users\user\documents\visual studio 2008\projects\reflect_readoo\reflect_readoo\readoo.cpp(2) : error C2143: syntax error : missing ';' before '{'
1>c:\users\user\documents\visual studio 2008\projects\reflect_readoo\reflect_readoo\readoo.cpp(2) : error C2447: '{' : missing function header (old-style formal list?)
As I am unfamiliar with C++ syntax I'm not 100% sure where to start with these errors. The first the thing I tried was to remove all of the complicated code and just let the whole thing (it's one class in a namespace) be just a cout << "test"; in the namespace and class. removed the "ref" keyword, which removed the top error (this causes a million new errors wwith all of the functions in place) , but then was told a could only use a namespace if compiled with the clr flag, which would somewhat defeat the point of what i'm trying to do.
Can anyone recommend a path of testing that I could head down to start with? Otherwise, can anyone recommend a better way to translate a windows.form c# program into unmanaged c++? Should I just do it myself? (I want to do this eventually anyway, but it'd be a huge help to just have the damn thing and be able to look through and quickly see the differences, and I need the program for myself asap).
Thank you so much for any help, advice or guidance.
I understand the difficulty with the presentation side, I actually was not expecting for that to work, I just asked out of a dreamy hope. However, I would like to translate the "backend" of the application that was originally a console app. that I simply added as a class file to my windows form design. It's only this class of about a 1000 lines.
snippet:
public ref class RProgram{
public:
static System::String ^KeywordsLog = "Keywords.log"; // WHERE THE PROGRAM KEEPS ITS LOG
// classes. . . functions. . . the errors are reported on the first lines
};
for that then I understand, and concede the impossibility I suppose then, but could someone be so kind as to please help me resolve the errors preventing its compilation as managed c++?