<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Welche Headerdatei fehlt ?]]></title><description><![CDATA[<p>Ich versuche mich grade im NT-Dienstmanagement.<br />
Also anzeigen der services starten stoppen etc...</p>
<p>ich benutze MS Visual C++ und bekomme mit folgenden includes:</p>
<pre><code>#include &lt;Windows.h&gt;
#include &lt;Winsvc.h&gt;
#include &lt;Tlhelp32.h&gt;
#include &lt;stdio.h&gt;
</code></pre>
<p>diese Fehlermeldungen:</p>
<pre><code>MyProjects\catX\main.cpp(52) : error C2065: 'SERVICE_STATUS_PROCESS' : undeclared identifier
MyProjects\catX\main.cpp(80) : error C2065: 'QueryServiceStatusEx' : undeclared identifier
\MyProjects\catX\main.cpp(80) : error C2065: 'SC_STATUS_PROCESS_INFO' : undeclared identifier
\MyProjects\catX\main.cpp(174) : error C2228: left of '.dwCurrentState' must have class/struct/union type
</code></pre>
<p>Msdn sagt dazu :<br />
Declared in Winsvc.h; include Windows.h. | Link to Advapi32.lib. | Requires Advapi32.dll.</p>
<p>ich bin mir nicht ganz sicher ob die dll gelinkt ist habe jedenfalls die advapi32.lib gelinkt wie ich eine dll linke konnte ich leider nicht rausfinden.</p>
<p>liegt es daran oder fehlt mir ein header?</p>
<p>bin für jede hilfe dankbar</p>
<p>mfg c°h°</p>
<p>PS ( wenn msdn sagt declared in winsvc.h muss ich die dann includen oder muss ich etwas anderes machen ? )</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/139790/welche-headerdatei-fehlt</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 00:52:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/139790.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Mar 2006 11:53:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Welche Headerdatei fehlt ? on Thu, 09 Mar 2006 11:53:16 GMT]]></title><description><![CDATA[<p>Ich versuche mich grade im NT-Dienstmanagement.<br />
Also anzeigen der services starten stoppen etc...</p>
<p>ich benutze MS Visual C++ und bekomme mit folgenden includes:</p>
<pre><code>#include &lt;Windows.h&gt;
#include &lt;Winsvc.h&gt;
#include &lt;Tlhelp32.h&gt;
#include &lt;stdio.h&gt;
</code></pre>
<p>diese Fehlermeldungen:</p>
<pre><code>MyProjects\catX\main.cpp(52) : error C2065: 'SERVICE_STATUS_PROCESS' : undeclared identifier
MyProjects\catX\main.cpp(80) : error C2065: 'QueryServiceStatusEx' : undeclared identifier
\MyProjects\catX\main.cpp(80) : error C2065: 'SC_STATUS_PROCESS_INFO' : undeclared identifier
\MyProjects\catX\main.cpp(174) : error C2228: left of '.dwCurrentState' must have class/struct/union type
</code></pre>
<p>Msdn sagt dazu :<br />
Declared in Winsvc.h; include Windows.h. | Link to Advapi32.lib. | Requires Advapi32.dll.</p>
<p>ich bin mir nicht ganz sicher ob die dll gelinkt ist habe jedenfalls die advapi32.lib gelinkt wie ich eine dll linke konnte ich leider nicht rausfinden.</p>
<p>liegt es daran oder fehlt mir ein header?</p>
<p>bin für jede hilfe dankbar</p>
<p>mfg c°h°</p>
<p>PS ( wenn msdn sagt declared in winsvc.h muss ich die dann includen oder muss ich etwas anderes machen ? )</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012358</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012358</guid><dc:creator><![CDATA[c°h°]]></dc:creator><pubDate>Thu, 09 Mar 2006 11:53:16 GMT</pubDate></item><item><title><![CDATA[Reply to Welche Headerdatei fehlt ? on Thu, 09 Mar 2006 12:07:18 GMT]]></title><description><![CDATA[<p>&quot;undeclared identifier&quot; bedeutet, daß der Compiler den Namen nicht kennt. D.h. du solltest mal in der Winsvc.h nachsehen, ob die wirklich drinstehen.</p>
<p>(ich weiß nicht, ob das wichtig ist, aber eventuell könnte das &quot;Requires Windows Vista, Windows XP, or Windows 2000 Professional.&quot; auch Probleme bereiten)</p>
<p>PS: Wenn da steht &quot;declared in x; include y&quot; mußt du es nicht direkt einbinden - das bedeutet, daß irgendwo in y ein &quot;#include &lt;x&gt;&quot; drinsteht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012375</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012375</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 09 Mar 2006 12:07:18 GMT</pubDate></item><item><title><![CDATA[Reply to Welche Headerdatei fehlt ? on Thu, 09 Mar 2006 12:21:37 GMT]]></title><description><![CDATA[<p>Vermutlich hat dein VS dise Funktionen noch nicht... installieren entweder ein passendes PSDK oder verwende einen neueren Compiler...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012385</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Thu, 09 Mar 2006 12:21:37 GMT</pubDate></item><item><title><![CDATA[Reply to Welche Headerdatei fehlt ? on Thu, 09 Mar 2006 13:59:08 GMT]]></title><description><![CDATA[<p>ja seitdem ich nach psdk gegoglet habe glaube ich auch das meine version veraltet ist arbeite noch mit visual c++ 6.0 <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>habe diesen dl link gefunden: <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=eba0128f-a770-45f1-86f3-7ab010b398a3&amp;DisplayLang=en" rel="nofollow">http://www.microsoft.com/downloads/details.aspx?FamilyID=eba0128f-a770-45f1-86f3-7ab010b398a3&amp;DisplayLang=en</a></p>
<p>dort steht leider auch:<br />
This SDK does not support working with Microsoft Visual C/C++<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/00ae.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--registered"
      title=":registered:"
      alt="®"
    />, 6.0 as support for VC 6.0 has ended<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>dh wohl ich muss mir einen neuen compiler zulegen.<br />
Welcher freeware compiler ist denn zu empfehlen und kommt mit den neuesten winapi befehlen zurecht ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012497</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012497</guid><dc:creator><![CDATA[c°h°]]></dc:creator><pubDate>Thu, 09 Mar 2006 13:59:08 GMT</pubDate></item><item><title><![CDATA[Reply to Welche Headerdatei fehlt ? on Thu, 09 Mar 2006 17:58:24 GMT]]></title><description><![CDATA[<p>Du solltest Dir vielleicht einfach mal das anschauen, was im WinAPI Forum ganz oben steht...<br />
ABer extra für Dich auch hier:<br />
<a href="http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm" rel="nofollow">http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012684</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012684</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Thu, 09 Mar 2006 17:58:24 GMT</pubDate></item><item><title><![CDATA[Reply to Welche Headerdatei fehlt ? on Thu, 09 Mar 2006 23:16:50 GMT]]></title><description><![CDATA[<p>DANKE <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
Habs mir runtergeladen installiert und die includes einfach ausgetauscht - sieht nun sehr gut aus <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Haber nur leider noch einen Fehler an dem ich mir die Zähne ausbeisse.</p>
<pre><code>[...]
   SC_HANDLE sc = OpenSCManager (NULL,NULL,SC_MANAGER_ENUMERATE_SERVICE);
    if (sc != NULL){

		short getprocinfo = 1;
        ENUM_SERVICE_STATUS service_data;
        ENUM_SERVICE_STATUS *lpservice;
        BOOL retVal;
        DWORD bytesNeeded,srvCount,resumeHandle = 0,srvType, srvState;
		SERVICE_STATUS_PROCESS ssStatus;
		SC_HANDLE schService;

[...]

        srvType = SERVICE_WIN32;
        srvState = SERVICE_STATE_ALL;

        retVal = EnumServicesStatus (sc,srvType,srvState,&amp;service_data,sizeof(service_data),&amp;bytesNeeded,&amp;srvCount,&amp;resumeHandle);

        DWORD err = GetLastError();

        if ((retVal == FALSE) || err == ERROR_MORE_DATA){
            DWORD dwBytes = bytesNeeded + sizeof(ENUM_SERVICE_STATUS);
            lpservice = new (ENUM_SERVICE_STATUS);
            EnumServicesStatus (sc, srvType, srvState,lpservice,dwBytes,&amp;bytesNeeded,&amp;srvCount,&amp;resumeHandle);
        }

		int i;
        for(i=0;i&lt;(int)srvCount;i++){
   			schService = OpenService(sc,lpservice[i].lpServiceName,SERVICE_ALL_ACCESS);
    		if ( QueryServiceStatusEx(schService,SC_STATUS_PROCESS_INFO, &amp;ssStatus, sizeof(SERVICE_STATUS_PROCESS),&amp;bytesNeeded)==0 ){
[...]
</code></pre>
<p>bringt mir diesen Fehler er betrifft die unterste codezeile</p>
<pre><code>catX\main.cpp(79) : error C2664: 'QueryServiceStatusEx' : cannot convert parameter 3 from 'struct _SERVICE_STATUS_PROCESS *' to 'unsigned char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
</code></pre>
<p>msdn sagt<br />
&quot;Use SC_STATUS_PROCESS_INFO to retrieve the service status information. The lpBuffer parameter is a pointer to a SERVICE_STATUS_PROCESS structure.&quot;</p>
<p>Ein Fehler bei der SERVICE_STATUS_PROCESS initialisierung ?</p>
<p>danke</p>
<p>MFG c°h°</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012937</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012937</guid><dc:creator><![CDATA[c°h°]]></dc:creator><pubDate>Thu, 09 Mar 2006 23:16:50 GMT</pubDate></item><item><title><![CDATA[Reply to Welche Headerdatei fehlt ? on Fri, 10 Mar 2006 02:06:40 GMT]]></title><description><![CDATA[<p>BOOL QueryServiceStatusEx(<br />
SC_HANDLE hService,<br />
SC_STATUS_TYPE InfoLevel,<br />
LPBYTE lpBuffer,<br />
DWORD cbBufSize,<br />
LPDWORD pcbBytesNeeded<br />
);</p>
<p>Die Fehlermeldung sagt dir doch was zu tun ist..</p>
<blockquote>
<p>conversion requires reinterpret_cast, C-style cast or function-style cast</p>
</blockquote>
<pre><code>QueryServiceStatusEx(schService,SC_STATUS_PROCESS_INFO, (LPBYTE)&amp;ssStatus, sizeof(SERVICE_STATUS_PROCESS),&amp;bytesNeeded)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1012957</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012957</guid><dc:creator><![CDATA[Gnade Gottes]]></dc:creator><pubDate>Fri, 10 Mar 2006 02:06:40 GMT</pubDate></item><item><title><![CDATA[Reply to Welche Headerdatei fehlt ? on Fri, 10 Mar 2006 02:13:03 GMT]]></title><description><![CDATA[<p>Dank Dir</p>
<p>Anfängerfehler <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1012958</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1012958</guid><dc:creator><![CDATA[c°h°]]></dc:creator><pubDate>Fri, 10 Mar 2006 02:13:03 GMT</pubDate></item></channel></rss>