原创 error MIDL2025 : syntax error : expecting a type specification near "HRESULT"解決辦法

  在vc6.0用ATL建立一個COM組件,然後在接口定義中加入方法,會遇到編譯錯誤: (1)error MIDL2025 : syntax error : expecting a type specif

原创 BSTR、char*和CString轉換

 1) char*轉換成CString       若將char*轉換成CString,除了直接賦值外,還可使用CString::Format進行。例如          char chArray[] = 'This is a test

原创 IP Address控件的使用方法

#include <afxsock.h> //把CString表示的IP地址寫到IP Address裏面  CString strIP="192.168.0.17";  DWORD dwIP=ntohl(inet_addr(strIP)

原创 ATL 實現COM

        ATL實現COM 感覺是目前最簡單的編程方式了。

原创 創建COM組件全過程(C++)

 一:創建一個接口         typedef struct Interface Interface ISimpleMsgBox : public IUnknown { // IUnknown STDMETHO