彈窗打開一個網頁,但是報錯,代碼如下:
1 #include <stdio.h> 2 #include <windows.h> 3 void main() 4 { 5 ShellExecute(0, "open", "http://www.qq.com", 0, 0, 1); 6 7 getchar(); 8 }
嚴重性 代碼 說明 項目 文件 行 禁止顯示狀態
警告 C4133 “函數”: 從“char [5]”到“LPCWSTR”的類型不兼容 hello f:\users\denggelin\documents\visual studio 2015\projects\hello\hello\源.c 5
解決:
項目右鍵屬性,配置屬性,項目默認值,字符集,把‘使用 Unicode 字符集’改為‘使用多字節字符集'