Click here to Skip to main content
15,888,610 members
Home / Discussions / Visual Basic
   

Visual Basic

 
SuggestionRe: Check for changes on Windows form Pin
Richard Deeming3-Oct-18 1:47
mveRichard Deeming3-Oct-18 1:47 
QuestionRe: Check for changes on Windows form Pin
dan!sh 3-Oct-18 2:09
professional dan!sh 3-Oct-18 2:09 
QuestionIndex and length must refer to a location within the string vb.net Pin
Victoryy Hisar Sitanggang2-Oct-18 4:14
Victoryy Hisar Sitanggang2-Oct-18 4:14 
AnswerRe: Index and length must refer to a location within the string vb.net Pin
Richard Deeming2-Oct-18 4:34
mveRichard Deeming2-Oct-18 4:34 
QuestionRegisterHotKey Pin
JR2122-Oct-18 1:58
JR2122-Oct-18 1:58 
AnswerRe: RegisterHotKey Pin
JR2126-Oct-18 12:53
JR2126-Oct-18 12:53 
QuestionProblems with SSLstream.Read (VB.NET/VS2017) Pin
Member 1185690428-Sep-18 21:58
Member 1185690428-Sep-18 21:58 
QuestionProblem with SHGetFolderPath(): Problem Closed. Pin
mo149228-Sep-18 11:30
mo149228-Sep-18 11:30 
Sorry, I thought my problem was a bad path problem but it turns out to be something else.
Although the information below is correct, the code recognizes the returned
path as a valid path.


Can someone tell me why this code does not return the complete path? Frown | :(
It seems like this 'old code' worked at one time.
Thank You

Const CSIDL_MYMUSIC as integer = 13 ' My Music
Const CSIDL_PERSONAL As Integer = 5 ' My Documents

<DllImport("Shell32", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function SHGetFolderPath(ByVal hWnd As IntPtr, ByVal csidl As Integer, _
ByVal handle As IntPtr, ByVal dwFlags As Integer, _
<MarshalAs(UnmanagedType.LPTStr)> ByVal lpBuffer As System.Text.StringBuilder) As Integer
End Function

For CSIDL_MYMUSIC the return value is "C:\users\myname.Home\Music" instead of "...\My Music"
For CSIDL_PERSONAL the return value is "C:\users\myname.Home\Documents" instead of "...\My Documents"

sub MyFunction()

Dim sb As New StringBuilder(200)
Dim sPath as string

SHGetFolderPath(IntPtr.Zero, CSIDL_MYMUSIC, IntPtr.Zero, 0, sb)
sPath = sb.ToString()

end sub

-- modified 28-Sep-18 18:04pm.
AnswerRe: Problem with SHGetFolderPath(): Problem Closed. Pin
Richard MacCutchan28-Sep-18 21:45
mveRichard MacCutchan28-Sep-18 21:45 
GeneralRe: Problem with SHGetFolderPath(): Problem Closed. Pin
mo149228-Sep-18 23:44
mo149228-Sep-18 23:44 
SuggestionRe: Problem with SHGetFolderPath(): Problem Closed. Pin
Richard Deeming1-Oct-18 8:13
mveRichard Deeming1-Oct-18 8:13 
GeneralRe: Problem with SHGetFolderPath(): Problem Closed. Pin
mo14921-Oct-18 9:45
mo14921-Oct-18 9:45 
Questionhow to get corresponding values of particular column from database to text field Pin
Member 1400114828-Sep-18 5:45
Member 1400114828-Sep-18 5:45 
AnswerRe: how to get corresponding values of particular column from database to text field Pin
Richard MacCutchan28-Sep-18 6:14
mveRichard MacCutchan28-Sep-18 6:14 
AnswerRe: how to get corresponding values of particular column from database to text field Pin
Eddy Vluggen28-Sep-18 6:38
professionalEddy Vluggen28-Sep-18 6:38 
QuestionScreen size and form size Pin
desanti27-Sep-18 18:58
desanti27-Sep-18 18:58 
AnswerRe: Screen size and form size Pin
dan!sh 27-Sep-18 20:45
professional dan!sh 27-Sep-18 20:45 
AnswerRe: Screen size and form size Pin
Richard MacCutchan27-Sep-18 21:07
mveRichard MacCutchan27-Sep-18 21:07 
GeneralRe: Screen size and form size Pin
desanti28-Sep-18 8:59
desanti28-Sep-18 8:59 
GeneralRe: Screen size and form size Pin
Mycroft Holmes28-Sep-18 12:00
professionalMycroft Holmes28-Sep-18 12:00 
QuestionIs c++ worth learning? Pin
Member 1398247125-Sep-18 4:10
Member 1398247125-Sep-18 4:10 
AnswerRe: Is c++ worth learning? Pin
Richard MacCutchan25-Sep-18 5:41
mveRichard MacCutchan25-Sep-18 5:41 
QuestionVBA code to automatically pass credentials to windows security pop up Pin
Roberto64_Ge19-Sep-18 4:33
Roberto64_Ge19-Sep-18 4:33 
QuestionLooking for a copy of VB.net can anyone help. I'm willing to pay. Pin
Member 1398247117-Sep-18 3:49
Member 1398247117-Sep-18 3:49 
AnswerRe: Looking for a copy of VB.net can anyone help. I'm willing to pay. Pin
Dave Kreskowiak17-Sep-18 4:25
mveDave Kreskowiak17-Sep-18 4:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.