C# to VC

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Sgier

    C# to VC

    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_HelloWor ld {

    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.setDescr iptor( "Hello World" );
    newWin.Create() ;

    }

    }
  • Granville Barnett

    #2
    Re: C# to VC


    "Michael Sgier" <sgier@nospam.c omwrote in message
    news:9f0cb$48db 2a80$c299b6c1$1 5110@news.hispe ed.ch...
    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_HelloWor ld {
    >
    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.setDescr iptor( "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::Wind ow newWin^ = gcnew
    XPlane::Widgets ::Windows::Wind ow();
    // ...
    newWin->setSize(...) ;

    -- Granville

    Comment

    Working...