473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Wie benutze ich WNetGetConnection korrekt mit C++

Hallo zusammen,
möchte rausfinden, ob zB das Laufwerk "W:\" ein gemapptes Netzlaufwerk
oder ein lokales Laufwerk ist.

Ich denke, das geht mit WNetGetConnection.

Finde mit Google irgendwie kein C++ Beispiel, nur sowas:

Dim ret As Integer
Dim out As String = New String(" ", 260)
Dim len As Integer = 260
ret = WNetGetConnection("Q:", out, len)
Console.WriteLine(out)

Irgendwie scheitere ich dran, wie das auf C++ umschreiben soll:
In der MSDN finde ich:
DWORD WNetGetConnection(
LPCTSTR lpLocalName,
LPTSTR lpRemoteName,
LPDWORD lpnLength );

Tja, und da verlassen mich meine geringen VCC- Künste:
LPCTSTR localName;
localName=_T("i:");
LPTSTR remoteName;
LPDWORD len;
DWORD result;
result=WNetGetConnection(localName.c_str(),remoteN ame,len);
printf("%d\n",result);

Irgendwie komme ich damit nicht weiter, weil ich überhaupt nicht weiß,
wie ich mit diesen Windows-spezifischen Makro-String-Typen LPTSTR usw.
umgehen soll.

Danke schön für ein simples Beispiel, Bernd

--
BM Computer-Services, Bergmannstr. 66, 10961 Berlin
Webdesign, Internet, Layout und Grafik
Tel.: 030/20649400, mobil 0175/7419517, Fax: 030/20649401
Web: http://www.bmservices.de, eMail: ko*****@bmservices.de
Apr 6 '06 #1
1 2013
Hi Bernd!

This is an english-spoken newsgroup...

See also answers in
microsoft.public.de.vc

Greetings
Jochen
Apr 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Torsten Mohr | last post by:
Hi, i write a set of extension modules for python in C. I also use some new types that i defined there. At the moment i write some methods that expect some of these types as parameters. I...
1
by: Sidney Mark Croy | last post by:
Greetings In VB 6.0 using WNetGetConnection Windows API you could convert a physical drive designation to a UNC. How do you convert a physical drive to a UNC within VB.NET? Thank you
3
by: Adam Froio | last post by:
Hi, Is there a way to look up a mapped drive letter's share name using VB.NET? I'd like to get \\server\share from O:\ I'm pretty sure it can be done by looking it up in the registry or...
1
by: Glenn Leifheit | last post by:
Does anyone have any sample code on enumerating network shares with vb.net. I here you need to use wither an API or WMI, or are there other recomendations. Thanks Glenn
4
by: KSC | last post by:
In the following function, after adding the filename to the path, the filename is not there. Even if I try to add the filename in the calling sub or function, the filename is not there. While...
3
by: Stanav | last post by:
Hello all, I'm trying to get the UNC path of a mapped network folder, but it somehow doesn't work. Below is my code, and I really hope that some can help me on this by pointing out what I did...
0
by: NSB | last post by:
Guten Morgen! Ich habe zwei Fragen bzgl. der Konvertierung einer DTD in ein XML Schema: Ist die folgende Umsetzung korrekt: DTD: <!ELEMENT uug-query:search-term (#PCDATA)> Schema:
8
by: Peter Larsen [] | last post by:
Hi, If i have a mapped drive and an UNC path - both pointing to the same directory on the server, how do i determine if they match (point to the same directory on the server) ?? Thank you....
0
by: Ste | last post by:
Good morning to all. I have made a class to manage network connections using APIs WNetAddConnection2A WNetCancelConnection2A WNetGetConnection. I can connect and disconnect remote folder...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.