Click here to Skip to main content
15,920,053 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: My code is showing syntax error in insert into statement can you please help me with a solution guys Pin
Richard MacCutchan31-Oct-18 6:54
mveRichard MacCutchan31-Oct-18 6:54 
Questionvisual zkteco Pin
Member 1402998229-Oct-18 11:38
Member 1402998229-Oct-18 11:38 
AnswerRe: visual zkteco Pin
Richard MacCutchan30-Oct-18 5:21
mveRichard MacCutchan30-Oct-18 5:21 
QuestionHow to create an custom error message box , that I can used for all my forms using vb.net Pin
Member 140121708-Oct-18 8:48
Member 140121708-Oct-18 8:48 
AnswerRe: How to create an custom error message box , that I can used for all my forms using vb.net Pin
Mycroft Holmes8-Oct-18 11:31
professionalMycroft Holmes8-Oct-18 11:31 
AnswerRe: How to create an custom error message box , that I can used for all my forms using vb.net Pin
JR21211-Oct-18 10:35
JR21211-Oct-18 10:35 
QuestionHow to add a contact in google contacts from vb 2010 Pin
_nixz_7-Oct-18 22:04
_nixz_7-Oct-18 22:04 
AnswerRe: How to add a contact in google contacts from vb 2010 Pin
Richard MacCutchan7-Oct-18 22:57
mveRichard MacCutchan7-Oct-18 22:57 
GeneralRe: How to add a contact in google contacts from vb 2010 Pin
_nixz_9-Oct-18 3:06
_nixz_9-Oct-18 3:06 
QuestionCreating random access file with visual basic.net Pin
Member 139824717-Oct-18 11:48
Member 139824717-Oct-18 11:48 
AnswerRe: Creating random access file with visual basic.net Pin
Richard MacCutchan7-Oct-18 21:57
mveRichard MacCutchan7-Oct-18 21:57 
QuestionProblem with System.Text.Encoding, Solved Pin
mo14923-Oct-18 11:58
mo14923-Oct-18 11:58 
AnswerRe: Problem with System.Text.Encoding, Solved Pin
Eddy Vluggen4-Oct-18 2:15
professionalEddy Vluggen4-Oct-18 2:15 
QuestionCheck for changes on Windows form Pin
wjburke22-Oct-18 11:59
wjburke22-Oct-18 11:59 
AnswerRe: Check for changes on Windows form Pin
Eddy Vluggen2-Oct-18 21:49
professionalEddy Vluggen2-Oct-18 21:49 
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 

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.