Problem with System::out

Help
Bel Od
2004-06-16
2004-06-16
  • Bel Od

    Bel Od - 2004-06-16

    Can you help get me started with the following code.  I don't seem to be able to run the following code.  I use Visual C++ 6.0, I created a project with an executable to run in a DOS window.  When I run in I get "Runtime Error!" "abnormal program termination". When I activate the cout statements, those work.  The problem seems to be with the System::out->println statement.

    Thanks

    ----------------

    // PartMessageBasic.h
    //#include <iostream.h>
    //#include <stdlib.h>
    #include <acdk.h>
    #include <acdk/lang/System.h>

    // defining RPartMessageBasic, PartMessageBasicArray and RPartMessageBasicArray
    ACDK_DECL_CLASS(PartMessageBasic);

    class PartMessageBasic : public acdk::lang::Object {    
    };

    int main(int argc, char *argv[]){
        //cout << "1 BEGIN Part Message Basic.\n";
        RString str = "RUNNING Part Message Basic.";
        System::out->println(str);
        //cout << str;
        //cout << "2 END Part Message Basic.\n";
           return 0;
    }

     
    • Roger Rene Kommer

      Hi,

      You have to call the acdk::lang::System::main(...) function:

      // alternatally use a static class method
      int yourmain(RStringArray args)
      {
        // begin here
      }

      int
      main(int argc, char* argv[], char** envptr)
      {
        return acdk::lang::System::main(yourmain, argc, argv, envptr);
      }

      This is necessary, because inside the System::main System::out, threading, memory management and other stuff will be initialized.

      For a starting template you can also use the acdk_boot sample, with a sample dll and executable.

      Roger

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks