vb6-migration

Performance of passing data between .Net and COM assemblies

风格不统一 提交于 2019-12-05 18:41:55
I am in the process of migrating a legacy VB6 app to .Net, however since it is a high-profile business critical application, it is being done piece by piece. In the interest of improving performance, there is one method which gets hit a lot,thousands of times during the application life, and I was wanting to rewrite it in .Net (C#) to see if the runtime can be improved. The method in question manipulates ADODB Recordsets. Is there any performance issues I should be aware of or take into consideration since these recordsets will be passed to and from VB6 via COM interop? I haven't done anything

VB6 and C# regexes

落爺英雄遲暮 提交于 2019-12-05 13:23:22
I need to convert a VB6(which I'm not fammiliar with) project to C# 4.0 one. The project contains some regexes for string validation. I need to know if the regexes behave the same in both cases, so if i just copy the regex string from the VB6 project, to the C# project, will they work the same? I have a basic knowledge of regexes and I can just about read what one does, but for flavors and such, that's a bit over my head at the moment. For example, are these 2 lines equivalent? VB6: isStringValid = (str Like "*[!0-9A-Z]*") C#: isStringValid = Regex.IsMatch(str, "*[!0-9A-Z]*"); Thanks! The old

VB.net Passing a structure to unmanaged dll

我的未来我决定 提交于 2019-12-04 12:08:48
I'm migrating some VB6 code to VB.net, the code contains a structure that contains 1d arrays, 2d arrays, and few other variables. The general outline of the Vb.net structure is as under Public Structure Test Dim a As Single Dim b As Single Dim c As Single <VBFixedArray(2)> Dim arr1() As Single <VBFixedArray(2, 2)> Dim mdarr1(,) As Single <VBFixedArray(4)> Dim arr2() As Byte <VBFixedArray(4)> Dim arr3() As Short <VBFixedArray(3, 2)> Dim mdarr2(,) As Integer Dim d As Integer Dim e As Decimal End Structure The call to the dll is declared as under Public Declare Sub getState Lib "val.dll" (ByRef

VB6 Manifest not working on Windows 7

隐身守侯 提交于 2019-12-04 10:03:38
I have created a manifest file for a VB6 application that is running on Windows 7 (not for any visual style changes, just to make sure it accesses the common registry and not a virtualised one) The exe name is Capadm40.exe, the manifest is named Capadm40.exe.manifest and contains the following: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="CompanyName.Capadm40" type="win32"/> <description>Administers the System</description> <!-- Identify the

upgrade program for converting vb6 app to C#

旧街凉风 提交于 2019-12-04 05:45:31
问题 What is the best pathway to achieve this? I know that VS2005 contains an upgrade mechanism. Do any later versions of VS contain this? 回答1: Microsoft has devoted a site to VB6->.NET migration. They recommend a Free tool from ArtInSoft. However I'm not sure I'd like to maintain a .NET application written in VB6-style. But on the other hand a tool could give you a good start and you can refactor the result where the tool does not produce code of your liking. 回答2: In the latest release of Visual

Equivalent of “Dim As String * 1” VB6 to VB.NET

∥☆過路亽.° 提交于 2019-12-04 05:07:15
I have some VB6 code that needs to be migrated to VB.NET, and I wanted to inquire about this line of code, and see if there is a way to implement it in .NET Dim strChar1 As String * 1 Intellisense keeps telling me that an end of statement is expected. That's known as a "fixed-length" string. There isn't an exact equivalent in VB.NET. Edit : Well, OK, there's VBFixedStringAttribute , but I'm pretty sure that exists solely so that automated migration tools can more easily convert VB6 code to VB.NET for you, and it's not really the ".NET way" to do things. Also see the warnings in the article for

What does the Attribute keyword do in VB6?

时光毁灭记忆、已成空白 提交于 2019-12-03 15:20:55
I am converting some VB6 code to VB.Net. Since my VB6 installation appears to be damaged beyond repair I am using Notepad to read the original source code and can see at near the top of the file:- Attribute VB_Name = "clsBulge" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = False Attribute VB_Description = "Some text here" Attribute VB_Ext_KEY = "SavedWithClassBuilder" ,"Yes" Attribute VB_Ext_KEY = "Member0" ,"collBulges" Attribute VB_Ext_KEY = "Top_Level" ,"Yes" and down in among the works:- Public Property Let

Break VB6 project into chunks to use free version of Artinsoft

风格不统一 提交于 2019-12-02 23:19:13
问题 I am trying to convert a large (200K lines) VB6 project into C#. I only want to convert the form design because I want to rewrite all the actual code in C#. I want to use the free Artinsoft converter but this only allows projects of 10K lines. I am thinking I could break the VB6 project into 20 separate projects and then generate the C#.NET forms by using Artinsoft, then bringing the converted forms back into one C# project. Is this feasible? EDIT: Will this work? What are the potential

My.user.IsInRole always returning false

旧巷老猫 提交于 2019-12-02 17:05:33
问题 Currently, I'm working in one migration request, where we need to change the framework from 3.5 to 4.6.2. Here the problem is after changing the framework below method is not showing result as expected. My.User.IsInRole() is always returning false. If My.User.IsInRole(nlRole.InnerText) Then hasRole = True Exit For End If Also, I tested with below code: Imports System.Security.Principal Class PrincipalCheck Shared Function UserInRole(role As String) As Boolean Dim currPrincipal As New

Break VB6 project into chunks to use free version of Artinsoft

…衆ロ難τιáo~ 提交于 2019-12-02 13:34:04
I am trying to convert a large (200K lines) VB6 project into C#. I only want to convert the form design because I want to rewrite all the actual code in C#. I want to use the free Artinsoft converter but this only allows projects of 10K lines. I am thinking I could break the VB6 project into 20 separate projects and then generate the C#.NET forms by using Artinsoft, then bringing the converted forms back into one C# project. Is this feasible? EDIT: Will this work? What are the potential problems? I will try it in following order 1) Write automated test cases at least for major business