vb6-migration

Using a VB6 Class in C#

╄→尐↘猪︶ㄣ 提交于 2019-12-18 05:41:21
问题 Is it possible to use a VB6 class in C#? 回答1: I think you should just be able to add the library that contains your VB6 type as a reference in your C# project. Visual Studio will create an Interop Assembly on the fly, and you'll get access to all of the types in the VB6 library via Runtime Callable Wrappers. The tool that creates the Interop Assembly is TLBIMP.EXE, and you can run this yourself if you want more control over the process, eg. if you want to create a Primary Interop Assembly

How to declare a fixed-length string in VB.NET?

社会主义新天地 提交于 2019-12-17 19:15:28
问题 How do i Declare a string like this: Dim strBuff As String * 256 in VB.NET? 回答1: Use the VBFixedString attribute. See the MSDN info here <VBFixedString(256)>Dim strBuff As String 回答2: It depends on what you intend to use the string for. If you are using it for file input and output, you might want to use a byte array to avoid encoding problems. In vb.net, A 256-character string may be more than 256 bytes. Dim strBuff(256) as byte You can use encoding to transfer from bytes to a string Dim s

Conversion tool comparisons for visual basic 6.0 [closed]

我与影子孤独终老i 提交于 2019-12-17 07:30:38
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . Has anyone here used either of the following (or any other tool) to convert your vb6 code to a .net language? Artinsoft's upgrade

Can a VB6 project use a .Net .dll

只愿长相守 提交于 2019-12-14 01:14:43
问题 I have a VB6 project. My question is can I call a .NET .dll that has all the business rules of the project (from the VB6 application)? Basically I have a VB6 project with a classic ASP project calling a vb6/ActiveX .dll. The requirement is to figure out the best way to upgrade the application. So, if I update the ActiveX .dll can the VB6 app call that new .NET .dll? I guess the same question is viable for the classic ASP project as well... Thanks! 回答1: Yes, but you need to make the .Net types

Converting Fixed length statement from VB6 to VB.Net

女生的网名这么多〃 提交于 2019-12-13 04:34:00
问题 We perform a protocol based data sending to device where the device requires a formatted data packets. the sample packet data is XXFSXXXFSXXXXXXXFSXXXXXX . The X mentioned is the max length size of each string. if data is less than string max length it should be filled with NULL character like ..11FS123FS1234XXXX (the remaining X will be filled with NULL). I am just trying to convert one of VB6 function to VB.Net and below is the converted statement where i am facing issue Option Strict Off

Import a VB6 structure into C#

ⅰ亾dé卋堺 提交于 2019-12-12 19:14:50
问题 I've been tasked with converting some legacy code to a new system and we've got some VB6 structures that are here. Is there a way to convert them into a C# structure easily? I could redefine the structure in C# but there's no fixed strings in C#. (Or maybe I misunderstand) Any prods in the right direction? Private Type MapRec Name As String * NAME_LENGTH Revision As Long Moral As Byte Up As Integer Down As Integer Left As Integer Right As Integer Music As String BootMap As Integer BootX As

Len() function vs String.Length property; which to choose?

心不动则不痛 提交于 2019-12-12 09:33:04
问题 I'm making the transition from VB6 to VB.Net (VS 2010) and have a basic rather than expansive understanding of the latter. I obviously have quite a bit of code to... I hesitate to use the word "upgrade" when "port" would be more apt given that the upgrade wizard in past versions of VS may as well have just commented out the code and said "Hey, why don't you re-start from scratch?" In one procedure which I'm bringing across the Len() function was used to determine the length of a string

Migrating VB6 code to use 64-bit ODBC DSN

匆匆过客 提交于 2019-12-12 03:48:25
问题 I have a legacy VB6 application, which is making ODBC connections to a proprietory 3rd party database using ODBC. Dim con As Object ' New ADODB.Connection Set con = CreateObject("ADODB.Connection") con.Open ("DB64bitDSN") It used to work until now. Recently they have installed 64 bit version of the 3rd party database. The 3rd party database automatically creates a 64 bit ODBC DSN during installation, and the same is working when I connect using Excel's Data Connection Wizard, and using ODBC

.Net unicode problem, vb6 legacy

守給你的承諾、 提交于 2019-12-11 15:34:10
问题 I have a decryption routine in VB6. I now want the same decryption in C#. The strings that need decryption are in unicode, so I use Encoding.Unicode.GetString to read the input in C#. The input now looks exactly the same as in VB6. The first few characters in the loop are decrypted ok! Then I encounter a difference... The program parses the character '˜' with a different index than in VB6. When debugging I see the following in VB and in .Net: VB6 ˜ = code 152 C# ˜ = code 732 Needless to say,

VB Collection to C# Conversion

你说的曾经没有我的故事 提交于 2019-12-11 14:55:00
问题 I hope this makes sense. I have a program that I am converting from a combination of VB6, and VB.Net 2 to C# 4. I am having a problem with collections in VB, they are a KeyValuePair. I have three collections: m_oCol(string, clsFeatureObjectCollection) which contains clsFeatureObject<br /> m_oCol(string, clsFeatureObject) which contains clsFeatureCollection<br /> m_oCol(string, clsFeatureCollection) which contains clsFeature In C# I have converted the m_oCol(string, clsFeatureCollection) which