作者layan (一定要喝溫開水!!!)
看板C_and_CPP
標題Re: [問題] Console 下使用 Com 元件
時間Tue Jan 18 23:10:15 2011
※ 引述《tropical72 (藍影)》之銘言:
: 開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
: vs2008 + xp
: 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
: #include <afxwin.h>
: #include <wininet.h>
: #include <afxext.h>
: 問題(Question):
: 網路上針對 vc + com 元件的說明,九成以上都是在 MFC 底下進行,
: 請問有沒有辦法開 console mode, 使用 com 元件?
: 程式碼(Code):(請善用置底文網頁, 記得排版)
: http://paste.plurk.com/show/354248/
: (CString 到時可全換掉沒關係)
: 補充說明(Supplement):
: 謝謝各位指教。
很簡單. 在你的 main 寫:
CoInitialize(NULL); // initialize COM service.
把你的 SetWallPaper Code 全搬到這裡... 就結束了
CoUnitialize();
return 0;
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.240.169.67
推 tropical72:請問header 除了 windows.h 外要多加什麼嗎? 01/18 23:15
推 tropical72:!! 可以了!! 謝謝指教,太感謝了,最後附上碼 01/18 23:27
→ tropical72:telnet://ptt.cc , afxwin.h afxext.h 這二個要拿掉 01/18 23:27