<?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[Einen share erstellen in C++ mit MSDEStudio6.0]]></title><description><![CDATA[<p>Einen share erstellen in C++ mit MSDEStudio6.0</p>
<p>Weisss jemand wie man im C++ mit dem Devstudio 6.0 eine Share eine Directorys erstellt?<br />
Es muss eine share auf Windows 2000, 2003 und XP erstellen könne wercher fuer alle offen komplet offen ist</p>
<p>Ich versuche es mit dere folgenden Funktion</p>
<p>bool AFile::createShare( const AString&amp; dir ,const AString&amp; shareName){<br />
SHARE_INFO_2 p;<br />
p.shi2_netname = TEXT((char*)(LPCTSTR)shareName);<br />
p.shi2_type = STYPE_DISKTREE; // disk drive<br />
p.shi2_remark = TEXT(&quot;TESTSHARE to test NetShareAdd&quot;);<br />
p.shi2_permissions = ACCESS_ALL;<br />
p.shi2_max_uses = 4;<br />
p.shi2_current_uses = 0;<br />
p.shi2_path = TEXT((char*)(LPCTSTR)dir);<br />
p.shi2_passwd = NULL; // no password<br />
DWORD parm_err = 0;<br />
if(NetShareAdd((char*)(LPCTSTR)AInfo::getCurrentNode(), 2, (LPBYTE) &amp;p, &amp;parm_err)==0) {<br />
printf(&quot;Share created.<br />
&quot;);<br />
return true;<br />
} else {<br />
AMsg::warnLogBox(AInfo::getCurrentLastErrorText());<br />
return false;<br />
}</p>
<p>wobei AString eine ableitung von CString<br />
AMsg::warnLogBox ein box ausgibt<br />
AInfo::getCurrentLastErrorText den Textx des letzten Fehler und hohlt<br />
AInfo::getCurrentNode() den aktuellen Rechnerenamhem hohlt / Auf diesem soll der Link auch gemacht werden )<br />
folgende Fehlermeldung wird herausgelesen<br />
rc=0x3E5 Uberlappender E/A-Vorgang wird<br />
verarbeitet</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/99412/einen-share-erstellen-in-c-mit-msdestudio6-0</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 05:14:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/99412.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Jan 2005 07:42:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Einen share erstellen in C++ mit MSDEStudio6.0 on Fri, 28 Jan 2005 07:42:57 GMT]]></title><description><![CDATA[<p>Einen share erstellen in C++ mit MSDEStudio6.0</p>
<p>Weisss jemand wie man im C++ mit dem Devstudio 6.0 eine Share eine Directorys erstellt?<br />
Es muss eine share auf Windows 2000, 2003 und XP erstellen könne wercher fuer alle offen komplet offen ist</p>
<p>Ich versuche es mit dere folgenden Funktion</p>
<p>bool AFile::createShare( const AString&amp; dir ,const AString&amp; shareName){<br />
SHARE_INFO_2 p;<br />
p.shi2_netname = TEXT((char*)(LPCTSTR)shareName);<br />
p.shi2_type = STYPE_DISKTREE; // disk drive<br />
p.shi2_remark = TEXT(&quot;TESTSHARE to test NetShareAdd&quot;);<br />
p.shi2_permissions = ACCESS_ALL;<br />
p.shi2_max_uses = 4;<br />
p.shi2_current_uses = 0;<br />
p.shi2_path = TEXT((char*)(LPCTSTR)dir);<br />
p.shi2_passwd = NULL; // no password<br />
DWORD parm_err = 0;<br />
if(NetShareAdd((char*)(LPCTSTR)AInfo::getCurrentNode(), 2, (LPBYTE) &amp;p, &amp;parm_err)==0) {<br />
printf(&quot;Share created.<br />
&quot;);<br />
return true;<br />
} else {<br />
AMsg::warnLogBox(AInfo::getCurrentLastErrorText());<br />
return false;<br />
}</p>
<p>wobei AString eine ableitung von CString<br />
AMsg::warnLogBox ein box ausgibt<br />
AInfo::getCurrentLastErrorText den Textx des letzten Fehler und hohlt<br />
AInfo::getCurrentNode() den aktuellen Rechnerenamhem hohlt / Auf diesem soll der Link auch gemacht werden )<br />
folgende Fehlermeldung wird herausgelesen<br />
rc=0x3E5 Uberlappender E/A-Vorgang wird<br />
verarbeitet</p>
]]></description><link>https://www.c-plusplus.net/forum/post/708425</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708425</guid><dc:creator><![CDATA[Thomas Andreas Kocher]]></dc:creator><pubDate>Fri, 28 Jan 2005 07:42:57 GMT</pubDate></item><item><title><![CDATA[Reply to Einen share erstellen in C++ mit MSDEStudio6.0 on Fri, 28 Jan 2005 08:10:22 GMT]]></title><description><![CDATA[<p>Ganz falsches Forum <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> <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>
]]></description><link>https://www.c-plusplus.net/forum/post/708437</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708437</guid><dc:creator><![CDATA[Redhead]]></dc:creator><pubDate>Fri, 28 Jan 2005 08:10:22 GMT</pubDate></item><item><title><![CDATA[Reply to Einen share erstellen in C++ mit MSDEStudio6.0 on Fri, 28 Jan 2005 08:16:18 GMT]]></title><description><![CDATA[<p>Thomas: Du hast das ja schonmal im MFC Forum gepostet und jetzt auch noch hier. Aber es gehört nach WinAPI. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/708440</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708440</guid><dc:creator><![CDATA[;)]]></dc:creator><pubDate>Fri, 28 Jan 2005 08:16:18 GMT</pubDate></item><item><title><![CDATA[Reply to Einen share erstellen in C++ mit MSDEStudio6.0 on Fri, 28 Jan 2005 10:08:22 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=403" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/708537</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708537</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Fri, 28 Jan 2005 10:08:22 GMT</pubDate></item><item><title><![CDATA[Reply to Einen share erstellen in C++ mit MSDEStudio6.0 on Fri, 28 Jan 2005 12:06:21 GMT]]></title><description><![CDATA[<p>Aus irgendeinem Grund funktioniert das TEXT-Makro in diesem Beispiel nicht (Bei mir auch nicht, wenn ich den originalen Code aus dem MSDN-Beispiel nehme). Ich habe dann immer einen Konvertierungsfehler erhalten(1113-Für das Unicode-Zeichen ist kein zugeordnetes Zeichen in der Mehrbytecodepage vorhanden.) Ich habe es dann mit einer eigenen Funktion umgewandelt und hatte damit keine Probleme</p>
<pre><code class="language-cpp">PWCHAR WString( const char* str ) {
    if( str == NULL ) {
        return NULL;
    }

    int iBufSize = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, str, -1, NULL, 0 );
    WCHAR* wstr= new WCHAR[iBufSize+1];
    MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, str, -1, wstr, iBufSize );

    return (wstr);
}

bool AFile::createShare( const AString&amp; dir ,const AString&amp; shareName){ 
    SHARE_INFO_2 p; 

    p.shi2_netname = (LPSTR)WString(shareName); 
    p.shi2_type = STYPE_DISKTREE; // disk drive 
    p.shi2_remark = (LPSTR)WString(&quot;TESTSHARE to test NetShareAdd&quot;); 
    p.shi2_permissions = ACCESS_ALL; 
    p.shi2_max_uses = 4; 
    p.shi2_current_uses = 0; 
    p.shi2_path = (LPSTR)WString(dir); 
    p.shi2_passwd = NULL; // no password 

    DWORD parm_err = 0; 

    if(NetShareAdd((LPSTR)WString(AInfo::getCurrentNode()), 2, (LPBYTE) &amp;p, &amp;parm_err)==0) { 
        printf(&quot;Share created.&quot;); 
        return true; 
    } else { 
        AMsg::warnLogBox(AInfo::getCurrentLastErrorText()); 
        return false; 
    } 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/708607</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/708607</guid><dc:creator><![CDATA[masterofx32]]></dc:creator><pubDate>Fri, 28 Jan 2005 12:06:21 GMT</pubDate></item></channel></rss>