C# to VC

  • Thread starter Thread starter Michael Sgier
  • Start date Start date
M

Michael Sgier

Hi
how would that c# look in VC?
There are 2 dlls coming with that. Can I simply do "add existing item"
in VS2003?
Thanks Michael


using XPlane;

public class plugin_HelloWorld {

public static void Main() {

XPlane.Widgets.Windows.Window newWin = new
XPlane.Widgets.Windows.Window();
newWin.setSize( 200, 500, //left, top
320, 240 //width, height
);
newWin.setDescriptor( "Hello World" );
newWin.Create();

}

}
 
Michael Sgier said:
Hi
how would that c# look in VC?
There are 2 dlls coming with that. Can I simply do "add existing item" in
VS2003?
Thanks Michael


using XPlane;

public class plugin_HelloWorld {

public static void Main() {

XPlane.Widgets.Windows.Window newWin = new
XPlane.Widgets.Windows.Window();
newWin.setSize( 200, 500, //left, top
320, 240 //width, height
);
newWin.setDescriptor( "Hello World" );
newWin.Create();

}

}

I suggest you pickup a beginners book on C++ as the question has a trivial
answer if you strip the framework specific imperatives away, in fact it is
incredibly similar if you use C++/CLI.

Your question almost translates more into "how do I define an entrypoint in
C++?" in which case it is;

int main()
{
// whatever here...
return 0;
}

in C++/CLI you might do the following for the // whatever here...

XPlane::Widgets::Windows::Window newWin^ = gcnew
XPlane::Widgets::Windows::Window();
// ...
newWin->setSize(...);

-- Granville
 
Back
Top