Click here to Skip to main content
15,911,503 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Run Program from Within Folder Pin
Parament Technologies18-Jun-14 17:45
Parament Technologies18-Jun-14 17:45 
GeneralRe: Run Program from Within Folder Pin
Dave Kreskowiak19-Jun-14 2:06
mveDave Kreskowiak19-Jun-14 2:06 
GeneralRe: Run Program from Within Folder Pin
Parament Technologies19-Jun-14 4:10
Parament Technologies19-Jun-14 4:10 
GeneralRe: Run Program from Within Folder Pin
Dave Kreskowiak19-Jun-14 4:30
mveDave Kreskowiak19-Jun-14 4:30 
GeneralRe: Run Program from Within Folder Pin
Parament Technologies19-Jun-14 5:59
Parament Technologies19-Jun-14 5:59 
GeneralRe: Run Program from Within Folder Pin
Dave Kreskowiak19-Jun-14 9:49
mveDave Kreskowiak19-Jun-14 9:49 
GeneralRe: Run Program from Within Folder Pin
Eddy Vluggen19-Jun-14 5:14
professionalEddy Vluggen19-Jun-14 5:14 
QuestionVB6 CommonDialog in WIndows 7 Pin
Liefie200017-Jun-14 6:11
Liefie200017-Jun-14 6:11 
I have a CommonDialog that uploads a picture (jpeg) and then saves it to a specific file. It works fine in Windows XP, but not in Windows 7. I have it open in My Computer and then save to a remote temp file. The prblem is that Windows 7 gives you the last location you either viewed or saved to and not the folder that you hard coded into the VB6 program. Is there a way around this? Is there a way to turn the option off in Windows 7 or a different Dialog to use in VB6?

Here's my Code:

Public Sub subUploadImage()
    Dim stFromFile As String
    Dim stToFile As String
    Dim inCnt As Integer

    st_MYCOMPUTER_CLSID = "::" & "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
    stPath_Ols_Photo_Temp = "i:\programs\old\photo_temp\"
    
    On Error GoTo ErrorHandler
  
    
    frmSubjectMaint.CommonDialog1.InitDir = st_MYCOMPUTER_CLSID
    If frmSubjectMaint.CommonDialog1.Flags = cdlCancel Then
        Exit Sub
    End If
    frmSubjectMaint.CommonDialog1.Filter = "JPEG Files (*.jpg)|*.jpg"
    frmSubjectMaint.CommonDialog1.FileName = ""
    frmSubjectMaint.CommonDialog1.Flags = cdlOFNHideReadOnly + cdlOFNOverwritePrompt
    frmSubjectMaint.CommonDialog1.ShowOpen
    stFromFile = frmSubjectMaint.CommonDialog1.FileName
    frmSubjectMaint.CommonDialog1.InitDir = stPath_Ols_Photo_Temp
'    frmSubjectMaint.CommonDialog1.InitDir = stPath_Ols_Photo
    frmSubjectMaint.CommonDialog1.Filter = "JPEG Files (*.jpg)|*.jpg"
    frmSubjectMaint.CommonDialog1.FileName = mskSsn.Text
    stToFile = frmSubjectMaint.CommonDialog1.FileName & ".jpg"
    frmSubjectMaint.CommonDialog1.ShowSave
    FileCopy stFromFile, stPath_Ols_Photo_Temp & stToFile
'    FileCopy stFromFile, stPath_Ols_Photo & stToFile
    If Dir(stPath_Ols_Photo_Temp & stToFile) <> "" Then
        If Dir(stPath_Ols_Photo & stToFile) = "" Then
            FileCopy stPath_Ols_Photo_Temp & stToFile, stPath_Ols_Photo & stToFile
        Else
            inCnt = 1
            If Dir(stPath_Ols_Photo & stToFile & ".old" & inCnt) = "" Then
                Name stPath_Ols_Photo & stToFile As stPath_Ols_Photo & stToFile & ".old" & inCnt
            Else
                Do While Dir(stPath_Ols_Photo & stToFile & ".old" & inCnt) <> ""
                    inCnt = inCnt + 1
                Loop
                Name stPath_Ols_Photo & stToFile As stPath_Ols_Photo & stToFile & ".old" & inCnt
            End If
            FileCopy stPath_Ols_Photo_Temp & stToFile, stPath_Ols_Photo & stToFile
        End If
        Kill stPath_Ols_Photo_Temp & stToFile
    End If
    frmSubjectMaint.lblNoPhoto.Caption = ""
    frmSubjectMaint.imgPhoto.Picture = LoadPicture(stPath_Ols_Photo & stToFile)
    Exit Sub
ErrorHandler:
    Select Case Err.Number
        Case 52
            Call subErrorRoutine("There is no disk in the specified drive.  Do you want to upload from a floppy diskette?.", 4)
            If inUserResponse = vbYes Then
                Resume
            Else
                frmSubjectMaint.CommonDialog1.InitDir = st_MYCOMPUTER_CLSID
                Resume Next
            End If
        Case 58
            'Already on file
            Resume Next
    End Select
End Sub

AnswerRe: VB6 CommonDialog in WIndows 7 Pin
Eddy Vluggen17-Jun-14 7:30
professionalEddy Vluggen17-Jun-14 7:30 
GeneralRe: VB6 CommonDialog in WIndows 7 Pin
Liefie200017-Jun-14 8:08
Liefie200017-Jun-14 8:08 
GeneralRe: VB6 CommonDialog in WIndows 7 Pin
Eddy Vluggen17-Jun-14 8:10
professionalEddy Vluggen17-Jun-14 8:10 
GeneralRe: VB6 CommonDialog in WIndows 7 Pin
Liefie200017-Jun-14 8:14
Liefie200017-Jun-14 8:14 
Questionlistview selected row is light grey when control loses focus, not deep blue Pin
Jim Dolson17-Jun-14 4:20
Jim Dolson17-Jun-14 4:20 
AnswerRe: listview selected row is light grey when control loses focus, not deep blue Pin
Dave Kreskowiak17-Jun-14 7:09
mveDave Kreskowiak17-Jun-14 7:09 
AnswerRe: listview selected row is light grey when control loses focus, not deep blue Pin
Eddy Vluggen17-Jun-14 7:26
professionalEddy Vluggen17-Jun-14 7:26 
GeneralRe: listview selected row is light grey when control loses focus, not deep blue Pin
Jim Dolson17-Jun-14 16:00
Jim Dolson17-Jun-14 16:00 
QuestionEntity framework : disconnect from database and set offilne Pin
dilkonika16-Jun-14 4:47
dilkonika16-Jun-14 4:47 
AnswerRe: Entity framework : disconnect from database and set offilne Pin
Dave Kreskowiak17-Jun-14 7:03
mveDave Kreskowiak17-Jun-14 7:03 
Question"Open Database connectivity error" while opening Word from VB with OLE Pin
Badusha15-Jun-14 22:36
Badusha15-Jun-14 22:36 
AnswerRe: "Open Database connectivity error" while opening Word from VB with OLE Pin
Eddy Vluggen17-Jun-14 7:31
professionalEddy Vluggen17-Jun-14 7:31 
GeneralRe: "Open Database connectivity error" while opening Word from VB with OLE Pin
Badusha24-Jun-14 19:02
Badusha24-Jun-14 19:02 
QuestionHow to switch frame to RightToLeft Pin
Member 1061936511-Jun-14 21:03
Member 1061936511-Jun-14 21:03 
QuestionPlease help me to put UserControl to datagridview cells Pin
Miller Nguyen11-Jun-14 16:34
Miller Nguyen11-Jun-14 16:34 
AnswerRe: Please help me to put UserControl to datagridview cells Pin
Bernhard Hiller11-Jun-14 20:47
Bernhard Hiller11-Jun-14 20:47 
GeneralRe: Please help me to put UserControl to datagridview cells Pin
Miller Nguyen12-Jun-14 20:56
Miller Nguyen12-Jun-14 20:56 

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.