Microsoft Platform SDK - February 2003
為了要抓 MAC address,用 GetAdaptersInfo() 興高采烈地把程式寫好之後,卻發現因為少了 iphlpapi.h 和 iphlpapi.lib 而無法 compile,這才知道必須要裝 Microsoft Platform SDK 才能夠用舊版 Visual C++ 推出時還沒有出現的 Windows 的新功能。
好死不死地,也許是為了推廣 .Net,Microsoft 老早就停止了對 Visual Studio 6 的支援,所以現在 Microsoft 網站上 officially 可以抓到的 Platform SDK,只有最新版的 Windows® Server 2003 SP1 Platform SDK。可是,網頁上卻寫著:
- Development Tools. To build the C/C++ samples, you must have a C/C++ compiler. If you are using Microsoft Visual C/C++®, run it at least once before installing the SDK. This will ensure that the environment variables are correctly configured. To build the Visual Basic samples, you must have Microsoft Visual Basic®. This SDK does not support working with Microsoft Visual C/C++®, 6.0 as support for VC 6.0 has ended. The last SDK that will work with VC 6.0 is the February 2003 Edition, you can order a CD on the fulfillment site. Side by side installations are not supported.
換句話說,除非整個換跑道從 VC6 升級到 VC.Net,否則就沒得用了。之前看 VB 社群因為 Microsoft 撤掉 VB6 的支援而鬧的沸沸揚揚,心裡覺得事不關己戲演的真熱鬧,結果現在輪到自己碰到同樣的問題,只好一樣咕噥一聲:「看~機車。」
還好,用 Google 挖的到 Microsoft 網站上被隱藏起來的舊網頁,這個「XPSP2 PSDK Full Download with Local Install」是 Windows® Server 2003 SP1 Platform SDK 的出來之前的前一個版本,不確定 VC6 可不可以用;而這個「Windows Server 2003 PSDK Full Download with Local Install」則正是網頁裡宣稱可以給 VC6 使用的版本:Windows® Server 2003 Platform SDK - February 2003,共 342MB 裝起來要 1G 多,目前正在努力。
更新 (2006-12-01):要解開 Platform SDK,應該是要到 command-line 模式下,去執行其安裝程式,直接在 GUI 上點兩下,不會有效果。不過,因為 Platform SDK 太大了,我很懶得重新抓下來,再重新裝一遍,所以沒辦法詳細列出安裝方式,請見諒。



51 Comments
hehe
i am jack
感谢你的这篇文章,要不然还会在 Microsoft.com 里乱翻呢。Thank
不客氣。又,「XPSP2 PSDK Full Download with Local Install」我用過,確定可以給 VC6 使用。
Thanks for pointing out where to download the older February 2003 platform SDK.
我完整安裝了February 2003 platform SDK,卻還是沒有iphlpapi.h。請問可能是什麼問題呢?
LittleP,
安裝後,應該在程式集裡面會有一個「Microsoft Platform SDK for Windows XP SP2」的資料夾,裡面有個「Visual Studio Registration」的子資料夾,執行裡面的「Register PSDK Directories with Visual Studio」應該就可以讓 Visual C++ 知道去哪裡找 iphlpaoi.h。
照你說的去做,
問題已經解決了。
感謝... :D
This SDK does not support working with Microsoft Visual C/C++®, 6.0 as support for VC 6.0 has ended. The last SDK that will work with VC 6.0 is the February 2003 Edition, 我安装Windows® Server 2003 SP1 Platform SDK两遍都没注意到这句话。哎。。。结果可想而知。谢谢~~~
XPSP2 PSDK Full Download with Local Install验证,可以在VC6.0上使用。但仍然不能跑MSDN上的代码。http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp上面就是不能跑的代码的地址。。是否还要装什么东西?
Hi JeffHuang,Where to find older sdk version for win2k?Thanks a lot.
Hi Steven Huang,
Theoretically, platform sdk are backward compatible. If you want to write win2k programs, XPSP2 PSDK Full Download with Local Install can do that, as long as you keep attention not using modern features above win2k. You should be able to find documents about features you use on MSDN, and there should be windows version requirement listed on them.
If you're absolutely sure wanting older sdk version for win2k. Sorry, I just can't find one.
Jeff,You are right. win2k & winxp are also base on nt kernel.I have searched all the whole day, but found nothing about the special win2k sdk.Thanks you very much.-Steven
Yes but if you are still using VC 6.0 then you need the older platform sdk......
Sorry, I'm not quite understand, whom is Andrea replying to?
I'm still using VC6, and using XPSP2 PSDK Full Download with Local Install just fine. Actually, this is what this article meant: Microsoft stopped supporting VC6 in its newest PSDK, and do not provide older PSDK officially. So I digged into Microsoft's website and found the XPSP2 PSDK Full Download with Local Install page, it's the previous version of the first no-support-to-vc6 PSDK and do work fine in my tests.
從 Jserv 的這篇《人非聖賢 - Bug-free 的迷思》看到這篇《BUG,规范,断言和调试》,最後面有提到:
特此記錄,原來是
/GS的關係。Full Microsoft Platform SDK February 2003 Edition (The last SDK that will work with VC 6.0) is here:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
Size (bytes): 342,000,000
Last Updated: February 2003 (!)
Enjoy! :)
Dima,
Yes, this link is exactly the one I showed in my article. However, thanks anyway.
看到你的BLOG,感到非常高兴,我们可以做个朋友吗?我是中国成都的,我的MSN是:liugh698@hotmail.com。
Hi jeffhung,
I has installed "XPSP2 PSDK Full Download with Local Install" and executed" Register PSDK Directories with Visual Studio". But I still can't find propid.h. Do you know why?
Thanks
Hi, Stan, 我只有在我的 XPSP2-SDK 目錄下,看到
propIdl.h檔耶。我到「XPSP2 PSDK Full Download with Local Install」download 所有的 .CAB 檔, 但執行 PSDK-FULL.bat 或 extract.exe 時 失敗, 彈出 'access denied' , why ? 請教如何解決.
Hi, skon,
Try run it in command-line.
re:
skon says:
June 2nd, 2006 at 10:48 am
我到「XPSP2 PSDK Full Download with Local Install」download 所有的 .CAB 檔, 但執行 PSDK-FULL.bat 或 extract.exe 時 失敗, 彈出 'access denied' , why ? 請教如何解決.
jeffhung says:
你要在目录的命令行下执行
抓狂了,能不能救救我?解压出错:
Extracting c:\psdk\images\smallfile.gif
Extracting c:\psdk\images\smallnote.gif
Extracting c:\psdk\images\smdisk.gif
Extracting c:\psdk\images\smtimer.gif
Extracting c:\psdk\images\uninstall-done.ico
Extracting c:\psdk\images\Uninstall.ICO
Extracting c:\psdk\License\License.htm
Extracting c:\psdk\License\Redist.Txt
Extracting c:\psdk\setup\CoreSDK-common.0.0.cab
Extracting c:\psdk\setup\CoreSDK-common.1.0.cab
ERROR: Cabinet file PSDK-FULL.1.cab is corrupted
另外,你们俩说的是不同版本,大小差很多。
Dima says:
March 9th, 2006 at 5:18 pm
Full Microsoft Platform SDK February 2003 Edition (The last SDK that will work with VC 6.0) is here:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
Size (bytes): 342,000,000
Last Updated: February 2003 (!)
Enjoy! :)
jeffhung says:
March 9th, 2006 at 10:02 pm
Dima,
Yes, this link is exactly the one I showed in my article. However, thanks anyway.
"February 2003 platform SDK" is what I need,Thanks a lot!
Gargoyle,
You're welcome. :-)
is there anyway to download only parts of it? I only need the Core SDK, and downloading all 342MB will take more than half a day over here (no broadband?!).
请问Microsoft Platform SDK Feb 2003下载后,使用psdk-full解压后,怎么安装?在主文件夹下找不到安装的.exe文件,有一个Setup.Exe双击后是一个主页的连接.
见到这个BLOG, 实在是太高兴了, 我找这个SDK找了好久了.
huangfeng,
歡迎光臨。:-)
请问一下如何用sample下的Makefile文件在VC6.0中建工程,我怎么也看不懂文档中的解释,"Click Yes to the message that asks if you want to proceed."
"Select the platforms supported in the makefile. "是什么意思?
huangfeng,
能否詳述一下您的使用程序?我看不是很懂。
我按照您所说的地址下载了Microsoft Platform SDK for Windows XP SP2, 其中有些SAMPLE是使用".dsw"工程的方式保存的,而有些(最简单的)是只有"Makefile"文件(无".mak"后缀)和".c"文件.请问一下我应该怎样打开像这样只有"Makefile"文件和".c"文件的工程.
huangfeng,
正常來說,Makefile 是給 make 用的,直至目前為止,使用 Makefile 仍然是在 text-mode 下,管理專案最常見的方法。請參見 make - wikipedia 以學習如何使用 make。
在使用 Microsoft 產製的開發工具時,用的 make 叫做 nmake,其 Makefile 在概念上與傳統的 make 相似,但語法 (syntax) 不太一樣。
所以,您可以開啟 command prompt,進去該 sample 目錄後,打 nmake 編譯程式。
另外,請教一下,您是用 VC6 還是用 VS 2003/2005?我想對應一下兩岸的專業用語,以方便討論。此點在 Microsoft 很喜歡胡亂創造新(譯)詞的情況下,尤其重要。
我猜,所謂的「工程」,指的是 VC 6 的 workspace 或 VC 7/8 (VS 2003/2005) 的 solution,不知對否?
我安装的时候,弹出versions未定义,请问怎么回事?
殷远超:
對不起,我也不知道耶。
谢谢您的指点, 我想在您的帮助下我已经解决问题了.
以前我一直使用的是VC6.0中文版, 现在在看VC2005的MSDN, 想了解了解它.
我上面所说的确实应该称为"工作区", 有"打开"->"工作区"的选项. 也有"新建"->"工程"的标签. 只是我一直习惯性的叫它"工程", 在你没问我之前我也没注意这个问题."工作区"下面才有"工程",我想其他程序员应该都叫他"工作区". 因为我是自学, 也还没参加工作, 所以问题很多, 以后我有问题问您, 还请仁兄您多指点.
不知道您使用的是那一版VC, 你认为 VC2005 比 VC6.0 有没有大的优点, 有没有必要改向使用2005呢?
huangfeng,
VC6 的 workspace 等同於 VC 2003/2005 的 solution。在台灣,沒有中文版的 VC6,所以我們都還是用 project/workspace 這些原文。而 VC 2003/2005 有中文版,不過似乎翻譯和中國不太一樣。繁體中文的 solution 被翻作「(解決)方案」,而 project 我就不清楚是翻作什麼了。
基本上,微軟產品的中譯,我個人感覺實在是差到了極點,更別提兩岸交流的問題了。如果可以的話,還是盡量用原文名詞,比較不容易發生誤會。:-)
我現在主要用 VC6 寫 Windows 程式,用 VC2005 寫 WinCE 程式,以及用 gcc3 寫 Linux/FreeBSD 程式。
光以 Compiler 來說,VC2005 當然比 VC6 強太多了。不過一個很現實的考量就是,除非整個部門的開發工具都升級到 VC 2003/2005,要不然為了向前相容,VC 2003/2005 那些令人感動的「標準」功能,還是沒有意義。:-(
但以 IDE 的穩定度來說,我個人覺得 VC6 比 VC 2003/2005 穩太多了 (但 VC6 還是很會當機,或 Internal Compiler Error)。
您能否告诉我为什么一个简单的创建Windows窗口程式:
#include
#define WINDOW_CLASS_NAME "WindowClassName"
LRESULT CALLBACK WinProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
switch(msg)
{
case WM_CREATE:
break;
case WM_PAINT:
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return(DefWindowProc(hWnd, msg, wparam, lparam ) );
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
HWND hWnd;
MSG msg;
WNDCLASS wndClass;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = 0;
wndClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH );
wndClass.hCursor = LoadCursor( NULL, IDC_ARROW );
wndClass.hIcon = LoadIcon( NULL, IDI_APPLICATION );
wndClass.hInstance = hInstance;
wndClass.lpfnWndProc = WinProc;
wndClass.lpszClassName = WINDOW_CLASS_NAME;
wndClass.lpszMenuName = NULL;
wndClass.style = NULL;
RegisterClass( &wndClass );
hWnd = CreateWindow( WINDOW_CLASS_NAME, "MyWindow",WS_OVERLAPPEDWINDOW|WS_VISIBLE,
0, 0, 640, 480, NULL, NULL, hInstance, NULL );
while(GetMessage( &msg, NULL, 0, 0 ) )
{
if(msg.message == WM_QUIT )
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (msg.wParam);
}
在98中建个workspace 再用2005载入,Compile,正确。
而在2005中建一个解决方案, 载入.cpp文件 Compile:
Error: [cannot convert from 'const char [16]' to 'LPCWSTR']
Error: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [16]' to 'LPCWSTR'
warning: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
TO 殷远超:
可能是你的浏览器的安全设置阻止了安装程序的 ActiveX 控件,
请用 MS 的 IE 版本,或者降低安全设置试试。
huangfeng,
這是因為 generic-text-mapping 的關係,請參見 The Code Project 的這篇《Unicode, MBCS and Generic text mappings》,有非常詳細的講解。
最近我亦有一篇《Writing libraries with Generic-Text-Mapping》在探討相關的議題。
setup。exe执行 弹出网页
没有继续安装 怎么解决?
同问,安装的时候(无论是直接点exe还是用命令行),都只弹出一个网页。不知是为什么?
Hi, it is very helpful of your article! thank you very much!
But I want to know which the best one that I should download??Is it the [Microsoft Platform SDK - February 2003]?Or the [XPSP2 PSDK Full Download with Local Install]?
GJZ,
It depends on which kind of program you want to write. As the name suggest, if you only want to write XP programs, then "XPSP2 PSDK" is good enough. But if you want to write Windows 2003 programs, you'll need "Microsoft Platform SDK - February 2003".
Jeff Hung
February 2003 platform SDK 在下面的網址可以找到:
http://groups.google.com/group/microsoft.public.platformsdk.sdk_install/msg/087b0178f5d8159e?&hl=en
哎! 只是构建编程环境就这么难! 而又不断"升级",折腾!
编程环境="VC6"+"DDK"+"Platform"(+"DriverStudio")或
编程环境=
"VC.Net"+"DDK"+"Platform"(+"DriverStudio")?
劳您引荐一些参考书,可以吗? 谢谢.
谢谢 已经安装好了
你好,
我想請問 我照著下面這個網站的安裝步驟
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
然後按了setup 結果跑出下面這個網頁 而不是安裝畫面
C:\PSDK\default.htm
之前有安裝這個版本 August 2004
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
但是在編譯時就出現問題 程式碼來自directx的範例
cannot convert from 'unsigned short [13]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
David,
您好。有些 platform sdk 的 installer 是網頁介面。請先將 default browser 設成 IE,然後再安裝。
至於「
cannot convert from 'unsigned short [13]' to 'const char *'」的問題,關鍵在於TCHAR被視為char或是wchar_t。請參閱本站關於「generic text mapping」的文章。-- jeffhung
4 Backlinks
技术玩家李维的blogsoGoo荒堂WilliamLee's VideoCodec六翼的天使MSN技巧bharry (CM)Inside Live MessengerSo Sue MeMika Raento龙芯跳动一个藏袍JeffHung.Blog[IMG ]
Competitious # "不敢冒险就不是硅谷的企业" - 孟岩 # INET6: python 網頁框架之 URL Mapper 淺談 # Google Code Search # PyX - Python graphics package # Microsoft Platform SDK 选择 # Microsoft Platform SDK - February 2003 # 有关WINVER和_WIN32_IE宏的平台定义 # Re: Re: [python-chinese] 一个关于smtplib的问题 # 请教关于SMTP对象的login问题 # 豆瓣趋势 - 电影走势图 # 回头七年创业 # 关联你的网络-再谈社交网络(social network)
iphlpapi.h 和 iphlpapi.libreferece http://www.jeffhung.net/blog/articles/jeffhung/277/
http://www.jeffhung.net/blog/articles/jeffhung/277/
Post a Comment