サイトトップへ
OSASK.NET
  サイトトップへ       新掲示板(閉鎖済)   Wiki(凍結済)   旧掲示板(廃止済)   ニュース(廃止済)  
5: 2004-10-04 (月) 19:16:54 ソース 現: 2024-01-08 (月) 12:58:51 ゲスト ソース
Line 87: Line 87:
 /* "helloc4.cpp":helloをC++言語で記述した例 */  /* "helloc4.cpp":helloをC++言語で記述した例 */
 /*  stack:4k malloc:1k */  /*  stack:4k malloc:1k */
 + 
 /* このソースの説明が"helloc4.txt"に書かれています */  /* このソースの説明が"helloc4.txt"に書かれています */
 + 
 extern "C" {  extern "C" {
 #include <guigui00.h>  #include <guigui00.h>
 void OsaskMain();  void OsaskMain();
 }  }
 + 
 #define  AUTO_MALLOC  0  #define  AUTO_MALLOC  0
 + 
 class helloc4 {  class helloc4 {
 public:  public:
Line 102: Line 102:
   ~helloc4();    ~helloc4();
 };  };
 + 
 helloc4::helloc4() {  helloc4::helloc4() {
   struct LIB_WINDOW *window;    struct LIB_WINDOW *window;
   struct LIB_TEXTBOX *wintitle, *textbox;    struct LIB_TEXTBOX *wintitle, *textbox;
 + 
   /* ライブラリの初期化(必ず最初にやらなければならない) */    /* ライブラリの初期化(必ず最初にやらなければならない) */
   lib_init(AUTO_MALLOC);    lib_init(AUTO_MALLOC);
 + 
   /* ウィンドウのオープン */    /* ウィンドウのオープン */
   window = lib_openwindow(AUTO_MALLOC, 0x0200, 136, 48);    window = lib_openwindow(AUTO_MALLOC, 0x0200, 136, 48);
 + 
   /* ウィンドウタイトル用のテキストボックスをオープン */    /* ウィンドウタイトル用のテキストボックスをオープン */
   wintitle = lib_opentextbox(0x1000, AUTO_MALLOC, 0,  7, 1,  0,  0, window, 0x00c0, 0);    wintitle = lib_opentextbox(0x1000, AUTO_MALLOC, 0,  7, 1,  0,  0, window, 0x00c0, 0);
 + 
   /* "hello, world"を表示するためのテキストボックスをオープン */    /* "hello, world"を表示するためのテキストボックスをオープン */
   textbox  = lib_opentextbox(0x0000, AUTO_MALLOC, 0, 12, 1, 16, 16, window, 0x00c0, 0);    textbox  = lib_opentextbox(0x0000, AUTO_MALLOC, 0, 12, 1, 16, 16, window, 0x00c0, 0);
 + 
   /* ウィンドウタイトルを表示 */    /* ウィンドウタイトルを表示 */
   lib_putstring_ASCII(0x0000, 0, 0, wintitle, 0, 0, "helloc4");    lib_putstring_ASCII(0x0000, 0, 0, wintitle, 0, 0, "helloc4");
 + 
   /* メッセージを表示 */    /* メッセージを表示 */
   lib_putstring_ASCII(0x0000, 0, 0, textbox,  0, 0, "hello, world");    lib_putstring_ASCII(0x0000, 0, 0, textbox,  0, 0, "hello, world");
 + 
   /* 終了 */    /* 終了 */
   lib_waitsignal(0x0001, 0, 0);    lib_waitsignal(0x0001, 0, 0);
 }  }
 + 
 helloc4::~helloc4(){}  helloc4::~helloc4(){}
 + 
 void OsaskMain()  void OsaskMain()
 {  {
Line 140: Line 140:
-やっぱVC++は不便な点が多いので、GOがバージョンアップしてC++の不具合が無くなるのを期待。 -- ''uchan'' SIZE(10){2004-10-03 (日) 17:01:06} -やっぱVC++は不便な点が多いので、GOがバージョンアップしてC++の不具合が無くなるのを期待。 -- ''uchan'' SIZE(10){2004-10-03 (日) 17:01:06}
-ライブラリ出来ました。VCにパスを通し、CL = cl.exe -I$(INCPATH) -c としました。 -- ''uchan'' SIZE(10){2004-10-04 (月) 07:16:28} -ライブラリ出来ました。VCにパスを通し、CL = cl.exe -I$(INCPATH) -c としました。 -- ''uchan'' SIZE(10){2004-10-04 (月) 07:16:28}
 +-ものぐさな人に必要な処置を施したosa_dir2改をあげておきます。http://bayside.upper.jp/upload/osasksdk-20041005.lzh -- ''bayside'' SIZE(10){2004-10-05 (火) 22:01:17}
 +-obj2bim3で"Warning : can't link ??2@YAPAXI@Z"が発生。どうもnewがリンクできていないらしい。 -- ''bayside'' SIZE(10){2004-10-06 (水) 15:17:52}
 +-つまりnew演算子用のランタイムがVCにあって、それが無いからリンクできないのでしょう。おそらくランタイムはOSに依存するので、VCのランタイムから持ってくるだけでは解決できないと思います。 -- [[K]] SIZE(10){2004-10-06 (水) 15:58:27}
 +-inline void* operator new(size_t n){ return malloc(n); } でたいていの環境でnewが使えるようになるはづ。 -- [[名無しさん]] SIZE(10){2004-10-06 (水) 17:28:47}
#comment #comment

トップ   差分 バックアップ 複製 名前変更 リロード印刷に適した表示   ページ新規作成 全ページ一覧 単語検索 最新ページの一覧   ヘルプ
新着

目次
メンバー一覧


最新の20件
2016-10-01 2016-09-08
  • @MenuBar.
2016-09-07 2016-09-04 2016-08-15 2015-09-23 2014-07-30 2014-07-04 2014-02-04 2013-10-26 2013-06-21 2013-06-17 2013-06-15 2013-04-02 2013-02-09 2013-02-04 2012-12-25 2012-12-01 2012-05-28 2012-03-31

トピック一覧
一般用コメント最新
新掲示板lina
2016/9/5 20:58
SandBoxゲスト
2016/9/4 12:01
RecentDeletedlina
2015/6/2 19:29
Old-OSASK-MLlina
2014/6/29 9:14
hideyosi/メールhideyosi
2014/1/6 20:17
hideyosi/募集中lina
2013/11/8 19:56

このサイトは川合秀実から委託を受けて、OSASKコミュニティによって管理・運営されています。