1 Attachment(s)
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 !!
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.
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?
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
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 !!
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?
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
Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me
Quote:
Originally Posted by
Arnoutdv
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.
Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me
Quote:
Originally Posted by
Niya
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.
Re: How to Convert this VB6 UserControl source code for VB.NET OCX, please help me
Quote:
Originally Posted by
OptionBase1
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.
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
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