Results 1 to 12 of 12

Thread: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

  1. #1

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    Dear VBFormers,

    I am looking to have this usercontrol i wrote in VB6, to then be convertered into VB.NET 2019, please help me

    !! Thanks in advance !!
    Attached Files Attached Files
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945

    Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    What does the user control do? Also, looking at the code, I see several things I don't like such as "On Error Resume Next" and hard coded file handles to name a few. I think you're better off rewriting the whole thing.

  3. #3
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945

    Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    I tried loading your control in a project, but it won't load for some reason. Could you provide a small sample project for your control?

  4. #4

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    -- Sorry it's far too big for posting here, or even anywhere else, then so. the resource file, is the biggest i have ever so seen, as one of them
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  5. #5

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    okay then, how abour you help me to rewrite it, in VB.NET 2019 source code, then so.

    !! Thanks in advance !!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  6. #6
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945

    Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    I can help you with specific questions. What have you got so far and what parts do you need help with?

  7. #7
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,747

    Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    This is all the code.

    It starts with a dummy wait loop.
    Then it does a check on some value, if it's 0 then it jumps to label (which is the next line ...)
    If it's not 0 then it proceeds to the next line (with the same label)

    It extracts some data to a string buffer from a resource file.
    The saves the string buffer using the text methods of VB6 to a file.

    Again some dummy loops with pointless GoTo statements.

    The the saved data (a MKV movie file) is opened using some external ActiveX DLL
    -> Object = "{6BF52A50-394A-11D3-B153-00C04F79FAA6}#1.0#0"; "wmp.dll"

    Code:
    Private Sub UserControl_Initialize()
    On Error Resume Next
    
    Dim PauseTime, Start, Finish, TotalTime
    Dim a As Integer
    Dim strBuff As String
    
        With UserControl.SSTab
            .Tab = 0
        End With
            
    1   With UserControl
            a = a + 1
        
            PauseTime = 3
            Start = Timer
            Do While Timer < Start + PauseTime
            DoEvents
            Loop
            Finish = Timer
            TotalTime = Finish - Start
            If TotalTime = 0 Then GoTo 2
    
    2       strBuff = StrConv(LoadResData("EP" & a, "VIDEO"), vbUnicode)
                Open "C:\zVideo-1234567890.mkv" For Output As #1
                    Print #1, strBuff
                Close #1
            
                strBuff = ""
            
            PauseTime = 3
            Start = Timer
            Do While Timer < Start + PauseTime
            DoEvents
            Loop
            Finish = Timer
            TotalTime = Finish - Start
            If TotalTime = 0 Then GoTo 3
           
    3       strBuff = StrConv(LoadResData("PLAYLIST", "DATA"), vbUnicode)
                Open "C:\zVideo-1234567890.wpl" For Output As #1
                    Print #1, strBuff
                Close #1
                
                strBuff = ""
            
            PauseTime = 3
            Start = Timer
            Do While Timer < Start + PauseTime
            DoEvents
            Loop
            Finish = Timer
            TotalTime = Finish - Start
            If TotalTime = 0 Then GoTo 4
            
    4       .picBox.Picture = Nothing
    
            PauseTime = 3
            Start = Timer
            Do While Timer < Start + PauseTime
            DoEvents
            Loop
            Finish = Timer
            TotalTime = Finish - Start
            If TotalTime = 0 Then GoTo 5
    
    5       .WMP.URL = "C:\zVideo-1234567890.mkv"
        End With
    End Sub

  8. #8
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    Quote Originally Posted by Arnoutdv View Post
    This is all the code.

    It starts with a dummy wait loop.
    Then it does a check on some value, if it's 0 then it jumps to label (which is the next line ...)
    If it's not 0 then it proceeds to the next line (with the same label)

    It extracts some data to a string buffer from a resource file.
    The saves the string buffer using the text methods of VB6 to a file.

    Again some dummy loops with pointless GoTo statements.

    The the saved data (a MKV movie file) is opened using some external ActiveX DLL
    -> Object = "{6BF52A50-394A-11D3-B153-00C04F79FAA6}#1.0#0"; "wmp.dll"

    Code:
    Private Sub UserControl_Initialize()
    On Error Resume Next
    
    Dim PauseTime, Start, Finish, TotalTime
    Dim a As Integer
    Dim strBuff As String
    
        With UserControl.SSTab
            .Tab = 0
        End With
            
    1   With UserControl
            a = a + 1
        
            PauseTime = 3
            Start = Timer
            Do While Timer < Start + PauseTime
            DoEvents
            Loop
            Finish = Timer
            TotalTime = Finish - Start
            If TotalTime = 0 Then GoTo 2
    
    2       strBuff = StrConv(LoadResData("EP" & a, "VIDEO"), vbUnicode)
                Open "C:\zVideo-1234567890.mkv" For Output As #1
                    Print #1, strBuff
                Close #1
            
                strBuff = ""
            
            PauseTime = 3
            Start = Timer
            Do While Timer < Start + PauseTime
            DoEvents
            Loop
            Finish = Timer
            TotalTime = Finish - Start
            If TotalTime = 0 Then GoTo 3
           
    3       strBuff = StrConv(LoadResData("PLAYLIST", "DATA"), vbUnicode)
                Open "C:\zVideo-1234567890.wpl" For Output As #1
                    Print #1, strBuff
                Close #1
                
                strBuff = ""
            
            PauseTime = 3
            Start = Timer
            Do While Timer < Start + PauseTime
            DoEvents
            Loop
            Finish = Timer
            TotalTime = Finish - Start
            If TotalTime = 0 Then GoTo 4
            
    4       .picBox.Picture = Nothing
    
            PauseTime = 3
            Start = Timer
            Do While Timer < Start + PauseTime
            DoEvents
            Loop
            Finish = Timer
            TotalTime = Finish - Start
            If TotalTime = 0 Then GoTo 5
    
    5       .WMP.URL = "C:\zVideo-1234567890.mkv"
        End With
    End Sub
    Does it actually do anything useful? I guess what I'm really asking is if it's worth translating.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  9. #9
    PowerPoster
    Join Date
    Nov 2017
    Posts
    3,632

    Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    Quote Originally Posted by Niya View Post
    Does it actually do anything useful? I guess what I'm really asking is if it's worth translating.
    Short answer - no. Long answer - review the past couple years of threads by the OP.

  10. #10
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    Quote Originally Posted by OptionBase1 View Post
    review the past couple years of threads by the OP.
    Oh I'm extremely familiar with who the OP is which is why I even asked that question.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  11. #11

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    hey dudes, i am Richard Graeme Ambra, that of which you don't know who i am, then so
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  12. #12

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me

    first i want to access the Windows Media Player, which is the ActiveX that is called: WMP.ocx, or what not so, then okay with that
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

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