CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2000
    Location
    South East England
    Posts
    86

    Exclamation Visual basic, web controll and Windows 7.

    Visual basic, web controll and Windows 7.

    I now have a Windows 7 pc (64 bit version) and have installed Visual Basic 5. (Enterprise edition)
    I can run programs compiled with Windows XP on the Windows 7 pc.

    If I try to load the file code that uses the 'Microsodt Internet' control
    into Visual basic on on Windows 7 then I get the following errors:

    Error accessing the system registrey
    Errors during load. Refer to ...
    Line ..: Class SHDocVwCtl.WebBrowser of control WebBrowser1 was not a loaded control class.



    Windows XP references:
    Microsoft Internet Controls = C:\WINDOWS\system32\ieframe.oca

    Windows XP components:
    Microsoft Internet Controls = C:\WINDOWS\system32\SHDOCVW.dll

    Windows 7 references:
    Microsoft Internet Controls = C:\Windows\SysWOW64\ieframe.dll

    Windows 7 components:
    Microsoft Internet Controls = C:\Windows\SysWOW64\ieframe.dll

    If I try to point Microsoft Internet Controls to a different file I get the error
    The file 'C:\Windows\System32\shdocvw.dll' was not registered as an ActiveX component.
    Don't spend too much time on your computer.
    Sit on a chair instead!!
    It's a lot more comfortable and better for your hardware.

    :-/

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Visual basic, web controll and Windows 7.

    When you start the IDE, set it to RUN AS ADMINISTRATOR (in compatibility properties section) and have it always start that way. Same with VS2008+
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Aug 2000
    Location
    South East England
    Posts
    86

    Re: Visual basic, web controll and Windows 7.

    I was running it as administrator, but not as Windows XP mode.
    Set to Windows XP (Service pack 3) and can load code in to Visual Basic.

    Could not use the 'CommonDialog' component so installed 'VB Control Creation Edition' and CommonDialog now works with the full version of VB.


    Can't get MSFlexGrid to work yet thou.
    Don't spend too much time on your computer.
    Sit on a chair instead!!
    It's a lot more comfortable and better for your hardware.

    :-/

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Visual basic, web controll and Windows 7.

    Download SP6 for VB6.

    This works on Windows 7: (running as Administrator, that is)
    Code:
    Option Explicit
    
    ' Flexgrid Alignment Constants
    ' ----------------------------
    ' flexAlignLeftTop      0
    ' flexAlignLeftCenter   1
    ' flexAlignLeftBottom   2
    ' flexAlignCenterTop    3
    ' flexAlignCenterCenter 4
    ' flexAlignCenterBottom 5
    ' flexAlignRightTop     6
    ' flexAlignRightCenter  7
    ' flexAlignRightBottom  8
    ' flexAlignGeneral      9
    
    '        .AllowBigSelection = True
    '        .SelectionMode = flexSelectionByRow
    '
    '          .Col = .ColSel       ' =========
    '          .Row = .FixedRows    ' Select Row
    '          .RowSel = .Rows - 1  ' =========
    
    Public m_iSortCol As Integer, m_iSortType As Integer
    
    Private Sub Form_Activate()
      Dim DayName(4) As String
      Dim st As String
      Dim x%
      With MSFlexGrid1
        .CellAlignment = flexAlignRightTop ' Align all cells
        .Clear
        .WordWrap = True
        .Rows = 10
        .Cols = 7
        .FixedRows = 2
        .RowHeight(2) = 600
        st = "   "
        For x = 2 To 6 ' Load Day Names  (0=Sunday)
          st = st & "|<" & Format(Day(Now) + x, " d") & "  "
        Next x
        For x = 1 To 5 ' This adds the second header
        .TextMatrix(1, x) = Format(x + 1, "ddd")
        Next x
        .FormatString = st ' Deploy Heading
        st = ";    " ' Signify Row Headings with ";"
        For x = 0 To 7
          If x = 0 Then
            st = st & "|    "
          Else
            st = st & "| Level " & x
          End If
        Next x
        .FormatString = st '                     Deploy Columns
        .TextMatrix(2, 1) = "*" & vbCrLf & "1" ' Fill column 1 row 1
        .CellForeColor = vbWhite
        .CellBackColor = vbBlue
        .CellAlignment = flexAlignCenterCenter ' Override one above
        .TextMatrix(2, 2) = "2" '                Fill column 1 row 1
        .TextMatrix(2, 3) = "3" '                Fill column 1 row 1
        .TextMatrix(3, 1) = "2" & vbCrLf & "1" ' Fill column 1 row 1
        .TextMatrix(3, 2) = "3" '                Fill column 1 row 1
        .TextMatrix(3, 3) = "1" '                Fill column 1 row 1
            .ColWidth(6) = 1000
            .RowHeight(1) = 600
            .Row = 2
            .Col = 6
            .CellAlignment = flexAlignCenterBottom
            .ForeColor = vbRed
            .Text = "Hello"
            Set .CellPicture = LoadPicture(App.Path & "\beany.bmp")
            .CellPictureAlignment = flexAlignRightCenter
      End With
    End Sub
    
    'Private Sub MSFlexGrid1_Click()
    '  MSFlexGrid1.ColWidth(MSFlexGrid1.Col) = MSFlexGrid1.ColWidth(MSFlexGrid1.Col) + 20
    '  MsgBox "Row: " & MSFlexGrid1.MouseRow & " Col: " & MSFlexGrid1.MouseCol
    'End Sub
    
    Private Sub MSFlexGrid1_DblClick()
      Dim i As Integer
    
      ' sort only when a fixed row is clicked
      If MSFlexGrid1.MouseRow >= MSFlexGrid1.FixedRows Then Exit Sub
    
      i = m_iSortCol                  ' save old column
      m_iSortCol = MSFlexGrid1.Col   ' set new column
    
      ' increment sort type
      If i <> m_iSortCol Then
          ' if clicking on a new column, start with ascending sort
          m_iSortType = 1
      Else
          ' if clicking on the same column, toggle between ascending and descending sort
          m_iSortType = m_iSortType + 1
      If m_iSortType = 3 Then m_iSortType = 1
      End If
    
      DoColumnSort
    End Sub
    
    Sub DoColumnSort()
      With MSFlexGrid1
          .Redraw = False
          .Row = 1
          .RowSel = .Rows - 1
          .Col = m_iSortCol
          .Sort = m_iSortType
          .Redraw = True
      End With
    End Sub
    Attached Images Attached Images  
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Aug 2000
    Location
    South East England
    Posts
    86

    Re: Visual basic, web controll and Windows 7.

    MSFlexGrid now works.
    Must have tried it in Windows 7 mode.
    Sorry for my last line and thank you for your help.
    Don't spend too much time on your computer.
    Sit on a chair instead!!
    It's a lot more comfortable and better for your hardware.

    :-/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured