Hi,
I've been having real problems trying to get the above function to work in
my vb .net application which hopefully will assign a new drive letter to a
CD-Rom drive. This is what I've got so far:
Declare Function GetVolumeNameForVolumeMountPoint Lib "kernel32.dll"
Alias "GetVolumeNameForVolumeMountPointA" (ByVal lpszVolumeMountPoint As
String, ByVal lpszVolumeName As String, ByVal cchBufferLength As Integer) As
Integer
public function
Dim iret As Integer
Dim current as string = "Z:\"
Current &= vbNullChar
Dim sTemp = New StringBuilder(50)
sTemp = vbNullChar
iret = GetVolumeNameForVolumeMountPoint(Current, sTemp, 50)
end function
Supposedly the volume name is returned in the sTemp string, but i've yet to
get a return on this. I've also experimented with using pointers to the
strings and altering the function but this also doesn't work.
Any help would be appreciated.
Many Thanks
Mike
(Definitely a beginner)