找回密碼 或 安全提問
 註冊
|註冊|登錄

伊莉討論區

搜索
認識好友、聊天,分享生活趣事你準備好成為出色的版主了嗎?安全提問(回答) 和 永久尊貴會員 事宜
mg蘿莉航海王一拳超人明日花無碼 megoffice
taylor s馭房有術僕が人妻kkboxmp3歐陸風雲無碼流出

休閒聊天興趣交流學術文化旅遊交流飲食交流家庭事務PC GAMETV GAME
熱門線上其他線上感情感性寵物交流家族門派動漫交流貼圖分享BL/GL
音樂世界影視娛樂女性頻道潮流資訊BT下載區GB下載區下載分享短片
電腦資訊數碼產品手機交流交易廣場網站事務長篇小說體育運動時事經濟
上班一族博彩娛樂

[簡]終末的火車前往何

[簡]被稱為廢物的原英

[繁]身為魔王的我娶了

[簡]狼與辛香料 Merch

[繁]我的英雄學院 Mem

[繁]劇場版 鬼太郎誕
C & C++ 語言C# 語言Visual Basic 語言PHP 語言JAVA 語言
查看: 3343|回復: 3
打印上一主題下一主題

[問題]將_beginthreadex包成class後,如何傳參數進間接的事件函式[複製鏈接]

Rank: 2Rank: 2

帖子
176
積分
291 點
潛水值
2840 米
樓主
發表於 2018-7-26 04:26 PM|顯示全部樓層
若新密碼無法使用,可能是數據未更新。請使用舊密碼看看。
本帖最後由 MY0613 於 2018-7-26 04:27 PM 編輯



結果:
  1. In 0-th thread, thread id = 4240!
  2. In 1-th thread, thread id = 4496!
  3. In 2-th thread, thread id = 4396!
  4. In 3-th thread, thread id = 4932!
  5. In 4-th thread, thread id = 4704!
  6. In 5-th thread, thread id = 2252!
  7. In 6-th thread, thread id = 4180!
  8. In 7-th thread, thread id = 2220!
  9. In 8-th thread, thread id = 4368!
  10. In 0-th thread, thread id = 2576!
  11. In 1-th thread, thread id = 5068!
  12. In 2-th thread, thread id = 3876!
  13. In 3-th thread, thread id = 3740!
  14. In 4-th thread, thread id = 4624!
  15. In 5-th thread, thread id = 4204!
  16. In 6-th thread, thread id = 4700!
  17. Multiple thread wrapper to class testing is finishing!

  18. Process returned -1073741819 (0xC0000005)   execution time : 18.432 s
  19. Press any key to continue.
複製代碼



需要說明再問吧!

...
瀏覽完整內容,請先 註冊登入會員
附件: 你需要登錄才可以下載或查看附件。沒有帳號?註冊
若瀏覽伊莉的時侯發生問題或不正常情況,請使用Internet Explorer(I.E)。

使用道具檢舉

Rank: 2Rank: 2

帖子
176
積分
291 點
潛水值
2840 米
頭香
發表於 2018-7-30 11:20 AM|顯示全部樓層
分享使你變得更實在,可以使其他人感到快樂,分享是我們的動力。今天就來分享你的資訊、圖片或檔案吧。
補充內容 (2018-7-28 12:39 AM):
抱歉,看太快了沒看到,M大有做(tb + nowThread)->_wrap = (void*) this;
將自己的指標丟給_wrap
但我試過沒有(tb + nowThread)->_wrap = (void*) this;
好像也可以,為什麼?

其實我不時懂你這邊的意思,但在 static FunctionCalledByThread function 裡面,
我目的是想用 ThreadBlockParam._wrap 來找回啟動 Thread 的實體 (instance)
...
瀏覽完整內容,請先 註冊登入會員

使用道具檢舉

Rank: 2Rank: 2

帖子
176
積分
291 點
潛水值
2840 米
3
發表於 2018-7-30 05:05 PM|顯示全部樓層
下載: 訪客無法瀏覽下載點,請先 註冊登入會員
查到
Multithreaded versions of the C run-time libraries only.

To use _beginthread or _beginthreadex, the application must link with one of the multithreaded C run-time libraries.

還真的是 C run-time lib... 難怪要 static function prt.
...
瀏覽完整內容,請先 註冊登入會員

使用道具檢舉

Rank: 2Rank: 2

帖子
176
積分
291 點
潛水值
2840 米
4
發表於 2018-7-30 11:08 PM|顯示全部樓層
若對尊貴或贊助會員有任何疑問,歡迎向我們查詢。我們的即時通或MSN: admin@eyny.com
龍謙 發表於 2018-7-30 08:45 PM
下載: 訪客無法瀏覽下載點,請先 註冊登入會員

喔喔~~~~了解
感恩c大詳細的解說~~~
在stackoverflow上查到的時候,只知道是要將自己的instance傳給自己, ...

好像是被我手賤給砍到了…真是歹勢啦…(下次會只貼 patch)...
瀏覽完整內容,請先 註冊登入會員
若新密碼無法使用,可能是數據未更新。請使用舊密碼看看。

使用道具檢舉

您需要登錄後才可以回帖 登錄 | 註冊

Powered by Discuz!

© Comsenz Inc.

重要聲明:本討論區是以即時上載留言的方式運作,對所有留言的真實性、完整性及立場等,不負任何法律責任。而一切留言之言論只代表留言者個人意見,並非本網站之立場,用戶不應信賴內容,並應自行判斷內容之真實性。於有關情形下,用戶應尋求專業意見(如涉及醫療、法律或投資等問題)。 由於本討論區受到「即時上載留言」運作方式所規限,故不能完全監察所有留言,若讀者發現有留言出現問題,請聯絡我們。有權刪除任何留言及拒絕任何人士上載留言,同時亦有不刪除留言的權利。切勿上傳和撰寫 侵犯版權(未經授權)、粗言穢語、誹謗、渲染色情暴力或人身攻擊的言論,敬請自律。本網站保留一切法律權利。
回頂部