{"id":7840,"date":"2024-07-04T08:01:01","date_gmt":"2024-07-04T00:01:01","guid":{"rendered":""},"modified":"2024-07-04T08:01:01","modified_gmt":"2024-07-04T00:01:01","slug":"c1001\u8bed\u6cd5\u9519\u8bef_\u7535\u8111\u8bed\u6cd5\u9519\u8bef\u600e\u4e48\u89e3\u51b3","status":"publish","type":"post","link":"https:\/\/mushiming.com\/7840.html","title":{"rendered":"c1001\u8bed\u6cd5\u9519\u8bef_\u7535\u8111\u8bed\u6cd5\u9519\u8bef\u600e\u4e48\u89e3\u51b3"},"content":{"rendered":"

\n <\/path> \n<\/svg> <\/p>\n

\u5206\u4eab\u4e00\u4e0b\u6211\u8001\u5e08\u5927\u795e\u7684\u4eba\u5de5\u667a\u80fd\u6559\u7a0b\uff01\u96f6\u57fa\u7840\uff0c\u901a\u4fd7\u6613\u61c2\uff01\u4e00\u9488\u89c1\u8840 error C2146 \u8bed\u6cd5\u9519\u8bef \u7f3a\u5c11<\/strong><\/p>\n<\/p>\n

\u4e5f\u6b22\u8fce\u5927\u5bb6\u8f6c\u8f7d\u672c\u7bc7\u6587\u7ae0\u3002\u5206\u4eab\u77e5\u8bc6\uff0c\u9020\u798f\u4eba\u6c11\uff0c\u5b9e\u73b0\u6211\u4eec\u4e2d\u534e\u6c11\u65cf\u4f1f\u5927\u590d\u5174\uff01<\/strong><\/p>\n<\/p>\n

\n                 <\/p>\n

\u5982\u679c\u4f60\u786e\u8ba4\u4e0d\u7f3a\u5c11\u201c\uff1b\u201d\uff0c\u90a3\u4e48\u5c31\u662f\u4f60\u5fd8\u4e86\u5305\u542b\u5934\u6587\u4ef6\u6216\u5934\u6587\u4ef6\u5305\u542b\u7684\u987a\u5e8f\u4e0d\u5bf9\u3002<\/p>\n

<\/p>\n

<\/p>\n

\u6700\u8fd1\u7528VC7\u505a\u4e00\u4e2a\u5c0f\u8f6f\u4ef6\uff0c\u4e3b\u8981\u7684\u529f\u80fd\u662f\u5b9a\u65f6\u626b\u63cfGPRS\u63a5\u6536\u8fc7\u6765\u7684\u6570\u636e\uff0c\u5e76\u5b58\u653e\u5728\u6570\u636e\u5e93\u91cc\u3002\u8981\u6c42\u628a\u8f6f\u4ef6\u6ce8\u518c\u6210\u4e3awindows\u670d\u52a1\u3002\u5728\u6240\u6709\u7684\u5de5\u4f5c\u505a\u5b8c\u4ee5\u540e\uff0c\u6211\u7740\u624b\u5b9e\u73b0\u8fd9\u90e8\u5206\u529f\u80fd\u3002\u5176\u5b9e\u5b8c\u5168\u4e0d\u7528\u5728\u7a0b\u5e8f\u4e2d\u5199\u5165\u4efb\u4f55\u4ee3\u7801\uff0c\u53ea\u9700\u8981\u6267\u884c\u4e00\u4e2a\u6279\u5904\u7406\u6587\u4ef6\uff0c\u4fbf\u53ef\u5b8c\u7f8e\u5730\u6253\u6210\u670d\u52a1\u4e86\u3002\u4f46\u6211\u8fd8\u662f\u60f3\u8bd5\u4e00\u4e0b\u7528\u7a0b\u5e8f\u600e\u4e48\u5b9e\u73b0\u8fd9\u4e2a\u529f\u80fd\u3002
\u5728VC\u77e5\u8bc6\u5e93\u91cc\uff0c\u627e\u5230\u4e00\u7bc7\u6587\u7ae0\uff0c\u5176\u5b9e\u539f\u7406\u5e76\u4e0d\u96be\uff0c\u65e0\u975e\u662f\u628a\u7a0b\u5e8f\u7684\u5207\u5165\u53e3\uff0c\u7531main\u51fd\u6570\u8f6c\u6362\u5230\u670d\u52a1\u63a7\u5236\u53f0\u4e0a\u53bb\u3002\u6587\u7ae0\u7684\u540d\u5b57\u53eb\u300a\u7528 C \u8bed\u8a00\u7f16\u5199 Windows \u670d\u52a1\u7a0b\u5e8f\u7684\u4e94\u4e2a\u6b65\u9aa4\u300b\uff0c\u6709\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u4e00\u4e0b\u3002\u5728\u8fd9\u91cc\u8981\u8bf4\u7684\u662f\uff0c\u6211\u7528\u7684VS2003\u505a\u4e3a\u5f00\u53d1\u5de5\u5177\uff0c\u4e0eVC6\u6709\u4e00\u5b9a\u5dee\u522b\uff0c\u6bd4\u5982main\u548c_tmain\uff0c\u5728\u5f15\u7528\u7684\u5934\u6587\u4ef6\u91cc\uff0c\u4e5f\u6709\u4e9b\u8bb8\u4e0d\u540c\u3002\u5f53\u6211\u628a\u7a0b\u5e8f\u5c01\u88c5\u6210\u670d\u52a1\u7684\u5f62\u5f0f\uff0c\u53d1\u73b0\u51fa\u4e86\u4e00\u5806\u9519\u8bef\uff0c\u641e\u4e86\u4e00\u5929\uff0c\u4e5f\u4e0d\u77e5\u9053\u662f\u54ea\u91cc\u7684\u95ee\u9898\u3002\u6700\u540e\uff0c\u5de6\u601d\u53f3\u60f3\uff0c\u767e\u5ea6\u8c37\u6b4c\uff0c\u7ec8\u4e8e\u627e\u5230\u4e86\u95ee\u9898\u7684\u672c\u8d28\u3002\u5f52\u4e3a\u4e00\u53e5\u8bdd\u5c31\u662f\u8981\u201c\u6ce8\u610f\u5f15\u7528\u5934\u6587\u4ef6\u7684\u5148\u540e\u987a\u5e8f\u201d\uff01\u8fd9\u4e2a\u95ee\u9898\u8bf4\u5927\u4e0d\u5927\uff0c\u8bf4\u5c0f\u4e0d\u5c0f\uff0c\u9519\u8bef\u96be\u627e\uff0c\u5f88\u8ba9\u4eba\u5934\u75bc\u3002\u5199\u4e0b\u6b64\u6587\uff0c\u544a\u4e4b\u9047\u5230\u7c7b\u4f3c\u95ee\u9898\u7684\u670b\u53cb\u4eec\uff0c\u4f60\u4eec\u7684\u7a0b\u5e8f\u6ca1\u6709\u9519\u8bef\uff0c\u4f46\u8bf7\u6539\u53d8\u4e00\u4e0b\u5f15\u7528\u7684H\u6587\u4ef6\u7684\u987a\u5e8f\uff01\u50cf\u6211\u8fd9\u4e2a\u4f8b\u5b50\u6765\u8bf4\uff0c\u987a\u5e8f\u5982\u4e0b\uff1a
#include \"stdafx.h\"
#include <winsvc.h>
\u5982\u679c\u98a0\u5012\u4e86\uff0c\u5c31\u4f1a\u51fa\u73b0\u4e0b\u9762\u4e00\u5806\u4ee4\u4eba\u5934\u75bc\u7684\u9519\u8bef\uff1a<\/p>\n

\u6b63\u5728\u7f16\u8bd1...
ServerTest.cpp
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(58) : error C2146: \u8bed\u6cd5\u9519\u8bef : \u7f3a\u5c11\u201c;\u201d(\u5728\u6807\u8bc6\u7b26\u201chServStatus\u201d\u7684\u524d\u9762)
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(58) : error C2501: \u201chServStatus\u201d : \u7f3a\u5c11\u5b58\u50a8\u7c7b\u6216\u7c7b\u578b\u8bf4\u660e\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(59) : error C2146: \u8bed\u6cd5\u9519\u8bef : \u7f3a\u5c11\u201c;\u201d(\u5728\u6807\u8bc6\u7b26\u201chSStat\u201d\u7684\u524d\u9762)
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(59) : error C2501: \u201chSStat\u201d : \u7f3a\u5c11\u5b58\u50a8\u7c7b\u6216\u7c7b\u578b\u8bf4\u660e\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(75) : error C2065: \u201cSERVICE_TABLE_ENTRY\u201d : \u672a\u58f0\u660e\u7684\u6807\u8bc6\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(75) : error C2146: \u8bed\u6cd5\u9519\u8bef : \u7f3a\u5c11\u201c;\u201d(\u5728\u6807\u8bc6\u7b26\u201cDispatchTable\u201d\u7684\u524d\u9762)
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(75) : error C2065: \u201cDispatchTable\u201d : \u672a\u58f0\u660e\u7684\u6807\u8bc6\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(75) : error C2059: \u8bed\u6cd5\u9519\u8bef : \u201c]\u201d
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(75) : error C2143: \u8bed\u6cd5\u9519\u8bef : \u7f3a\u5c11\u201c;\u201d(\u5728\u201c{\u201d\u7684\u524d\u9762)
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(76) : error C2143: \u8bed\u6cd5\u9519\u8bef : \u7f3a\u5c11\u201c;\u201d(\u5728\u201c}\u201d\u7684\u524d\u9762)
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(76) : warning C4550: \u8868\u8fbe\u5f0f\u8ba1\u7b97\u4e3a\u7f3a\u5c11\u53c2\u6570\u5217\u8868\u7684\u51fd\u6570
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(76) : error C2143: \u8bed\u6cd5\u9519\u8bef : \u7f3a\u5c11\u201c;\u201d(\u5728\u201c,\u201d\u7684\u524d\u9762)
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(77) : error C2143: \u8bed\u6cd5\u9519\u8bef : \u7f3a\u5c11\u201c;\u201d(\u5728\u201c{\u201d\u7684\u524d\u9762)
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(77) : error C2143: \u8bed\u6cd5\u9519\u8bef : \u7f3a\u5c11\u201c;\u201d(\u5728\u201c}\u201d\u7684\u524d\u9762)
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(80) : error C3861: \u201cStartServiceCtrlDispatcher\u201d: \u5373\u4f7f\u4f7f\u7528\u53c2\u6570\u76f8\u5173\u7684\u67e5\u627e\uff0c\u4e5f\u672a\u627e\u5230\u6807\u8bc6\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(80) : error C3861: \u201cDispatchTable\u201d: \u5373\u4f7f\u4f7f\u7528\u53c2\u6570\u76f8\u5173\u7684\u67e5\u627e\uff0c\u4e5f\u672a\u627e\u5230\u6807\u8bc6\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(87) : error C2065: \u201cSC_HANDLE\u201d : \u672a\u58f0\u660e\u7684\u6807\u8bc6\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(87) : error C2146: \u8bed\u6cd5\u9519\u8bef : \u7f3a\u5c11\u201c;\u201d(\u5728\u6807\u8bc6\u7b26\u201cschSCManager\u201d\u7684\u524d\u9762)
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(87) : error C2065: \u201cschSCManager\u201d : \u672a\u58f0\u660e\u7684\u6807\u8bc6\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(88) : error C2146: \u8bed\u6cd5\u9519\u8bef : \u7f3a\u5c11\u201c;\u201d(\u5728\u6807\u8bc6\u7b26\u201cschService\u201d\u7684\u524d\u9762)
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(88) : error C3861: \u201cSC_HANDLE\u201d: \u5373\u4f7f\u4f7f\u7528\u53c2\u6570\u76f8\u5173\u7684\u67e5\u627e\uff0c\u4e5f\u672a\u627e\u5230\u6807\u8bc6\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(88) : error C2065: \u201cschService\u201d : \u672a\u58f0\u660e\u7684\u6807\u8bc6\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(99) : error C2065: \u201cSC_MANAGER_ALL_ACCESS\u201d : \u672a\u58f0\u660e\u7684\u6807\u8bc6\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(99) : error C3861: \u201cschSCManager\u201d: \u5373\u4f7f\u4f7f\u7528\u53c2\u6570\u76f8\u5173\u7684\u67e5\u627e\uff0c\u4e5f\u672a\u627e\u5230\u6807\u8bc6\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(99) : error C3861: \u201cOpenSCManager\u201d: \u5373\u4f7f\u4f7f\u7528\u53c2\u6570\u76f8\u5173\u7684\u67e5\u627e\uff0c\u4e5f\u672a\u627e\u5230\u6807\u8bc6\u7b26
e:\\Project C++\\ServerTest\\ServerTest\\ServerTest\\ServerTest.cpp(101) : error C3861: \u201cschSCManager\u201d: \u5373\u4f7f\u4f7f\u7528\u53c2\u6570\u76f8\u5173\u7684\u67e5\u627e\uff0c\u4e5f\u672a\u627e\u5230\u6807\u8bc6\u7b26
......
\u5982\u679c\u5f15\u7528\u987a\u5e8f\u6b63\u786e\u4e86\uff0c\u4f60\u7684\u7a0b\u5e8f\u5c31\u4f1a\u50cf\u8d8a\u72f1\u7b2c\u4e09\u5b63\u4e2d\u7684\u90a3\u4e2a\u76d1\u72f1\u8001\u5927\u8bf4\u7684\u4e00\u6837\uff1a\u5982\u84dd\u5929\u822c\u660e\u6717\u3002<\/p>\n

           \n<\/p><\/div>\n<\/p>\n

<\/strong> <\/p>\n

\u7ed9\u6211\u8001\u5e08\u7684\u4eba\u5de5\u667a\u80fd\u6559\u7a0b\u6253call\uff01\u4e00\u9488\u89c1\u8840 error C2146 \u8bed\u6cd5\u9519\u8bef \u7f3a\u5c11<\/h5>\n
\n \"c1001\u8bed\u6cd5\u9519\u8bef_\u7535\u8111\u8bed\u6cd5\u9519\u8bef\u600e\u4e48\u89e3\u51b3\n<\/div>\n","protected":false},"excerpt":{"rendered":"c1001\u8bed\u6cd5\u9519\u8bef_\u7535\u8111\u8bed\u6cd5\u9519\u8bef\u600e\u4e48\u89e3\u51b3\u4e00\u9488\u89c1\u8840errorC2146\u8bed\u6cd5\u9519\u8bef\u7f3a\u5c11_error:c2146:\u8bed\u6cd5\u9519\u8bef:\u7f3a\u5c11\u201c;\u201d(\u5728\u6807\u8bc6\u7b26\u201ccrop\u201d\u7684\u524d\u9762)","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/7840"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=7840"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/7840\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=7840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=7840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=7840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}