vb6-migration

Setting default property fails because it is read only?

 ̄綄美尐妖づ 提交于 2021-02-11 13:49:24
问题 This code was converted from VB6 to VB.Net: Public prvMainForm = VB6Form If prvMainForm IsNot Nothing Then CObj(prvMainForm).StatusBar.Panels(1) = "Initializing Folders..." End If (My code is quite long so I've just added this if block which is where the actual error occurs.) The error is seen on the single line inside the If statement: Property 'Item' is 'ReadOnly' 回答1: StatusBar.Panels(1) returns a MSComctlLib.Panel . StatusBar.Panels(1) = "Initializing Folders..." is valid in VB6 because

Converting DateAdd and Format code from VB6 to C#

倾然丶 夕夏残阳落幕 提交于 2021-02-07 13:12:58
问题 I have the following code in vb - tAvailableDate = DateAdd("d", 21, Format(Now, gDATEFORMAT)) I am attempting to convert this into C#. I have converted this so far - tAvailableDate = DateAdd("d", 21, Format (DateTime.Now, Global.gDATEFORMAT)); But I cannot find a replacement for the DateAdd() or Format() feature. Any ideas? Thanks. 回答1: DateAdd is an old VB6 method that was carried over into VB.NET for backwards compatibility. You could get it to work in C# as well if you included the

Converting DateAdd and Format code from VB6 to C#

╄→гoц情女王★ 提交于 2021-02-07 13:12:58
问题 I have the following code in vb - tAvailableDate = DateAdd("d", 21, Format(Now, gDATEFORMAT)) I am attempting to convert this into C#. I have converted this so far - tAvailableDate = DateAdd("d", 21, Format (DateTime.Now, Global.gDATEFORMAT)); But I cannot find a replacement for the DateAdd() or Format() feature. Any ideas? Thanks. 回答1: DateAdd is an old VB6 method that was carried over into VB.NET for backwards compatibility. You could get it to work in C# as well if you included the

Conversion Single To Hex

冷暖自知 提交于 2021-01-29 07:32:43
问题 I am trying to convert the following VB6 code to VB.NET: Public Function SingleToHex(ByVal Tmp As Single) As String Dim TmpBytes(0 To 3) As Byte Dim TmpSng As Single Dim tmpStr As String Dim x As Long TmpSng = Tmp Call CopyMemory(ByVal VarPtr(TmpBytes(0)), ByVal VarPtr(TmpSng), 4) For x = 3 To 0 Step -1 If Len(Hex(TmpBytes(x))) = 1 Then tmpStr = tmpStr & "0" & Hex(TmpBytes(x)) Else tmpStr = tmpStr & Hex(TmpBytes(x)) End If Next x SingleToHex = tmpStr End Function I tried to find a function in

Conversion Single To Hex

心已入冬 提交于 2021-01-29 07:17:20
问题 I am trying to convert the following VB6 code to VB.NET: Public Function SingleToHex(ByVal Tmp As Single) As String Dim TmpBytes(0 To 3) As Byte Dim TmpSng As Single Dim tmpStr As String Dim x As Long TmpSng = Tmp Call CopyMemory(ByVal VarPtr(TmpBytes(0)), ByVal VarPtr(TmpSng), 4) For x = 3 To 0 Step -1 If Len(Hex(TmpBytes(x))) = 1 Then tmpStr = tmpStr & "0" & Hex(TmpBytes(x)) Else tmpStr = tmpStr & Hex(TmpBytes(x)) End If Next x SingleToHex = tmpStr End Function I tried to find a function in

vb6 to vb.net dll compatibility version

若如初见. 提交于 2021-01-27 13:32:53
问题 I explain my problem : I have some program (5-6) in vb6, and a lot of DLL in vb6. We will perform a migration of these DLL and program in Vb.Net. We want to start with DLL, and each program references 2 or 3 DLL. I want to perform the migration of the DLL in vb.net (no problem for that) but i want to keep the (binary) compatibility between my old vb6 DLL and the new one in vb.net Because without that i will have to re build each application using this DLL because the compatibility is broken.

vb6 to vb.net dll compatibility version

旧城冷巷雨未停 提交于 2021-01-27 13:24:10
问题 I explain my problem : I have some program (5-6) in vb6, and a lot of DLL in vb6. We will perform a migration of these DLL and program in Vb.Net. We want to start with DLL, and each program references 2 or 3 DLL. I want to perform the migration of the DLL in vb.net (no problem for that) but i want to keep the (binary) compatibility between my old vb6 DLL and the new one in vb.net Because without that i will have to re build each application using this DLL because the compatibility is broken.

How can I share an interface between VB6 and C#?

二次信任 提交于 2021-01-27 07:10:49
问题 I would like to be able to code a class interface which I can implement in C# and VB6 classes so that these classes can be handled in the same way within VB6 code but I can't make this work. In VB6 I want to have come class VB6Class using the Implements key word to implement some interface ISharedInterface. In C# I want to have some other class C#Class which I can expose to COM as also implementing ISharedInterface. The goal is that VB6 code will then be able to operate on VB6Class and C

How to open visual basic 6 program with visual studio.net

浪尽此生 提交于 2020-07-29 10:46:12
问题 I want to open a program (written in Visual basic 6) to be open in Visual Studio.net. Please guide, how could I do that? While trying to open VB6 (.vbp file) program directly from the OPEN project option in visual studion.net, I was getting this error, "Visual Basic 6 (.vbp) files cannot be opened in Visual Studio" 回答1: I am trying to open in VS 2010. Visual Studio 2010 does not support VB6 projects. See the link here From the msdn documentation: Visual Studio 2010 does not provide tools for

How to open visual basic 6 program with visual studio.net

前提是你 提交于 2020-07-29 10:45:07
问题 I want to open a program (written in Visual basic 6) to be open in Visual Studio.net. Please guide, how could I do that? While trying to open VB6 (.vbp file) program directly from the OPEN project option in visual studion.net, I was getting this error, "Visual Basic 6 (.vbp) files cannot be opened in Visual Studio" 回答1: I am trying to open in VS 2010. Visual Studio 2010 does not support VB6 projects. See the link here From the msdn documentation: Visual Studio 2010 does not provide tools for