vb6-migration

Making a DLL COM accessible

五迷三道 提交于 2019-11-27 07:46:23
问题 I have a class library written in .Net that I would like to make available to VB6/VBA. What I tried did not work (obviously as I am asking this question). Here is what I did: I Created a Class Library Project in Visual Studio 2010 Express and put the code in a Class Module. I opened the project properties and went to "Assembly Information" and checked "Make COM Visible". I went to "Advanced Compile" options and targeted .Net 2.0 (it's very simple code). I then removed all references expect

What's the simplest .NET equivalent of a VB6 control array?

╄→гoц情女王★ 提交于 2019-11-27 06:47:39
问题 Maybe I just don't know .NET well enough yet, but I have yet to see a satisfactory way to implement this simple VB6 code easily in .NET (assume this code is on a form with N CommandButtons in array Command1() and N TextBoxes in array Text1()): Private Sub Command1_Click(Index As Integer) Text1(Index).Text = Timer End Sub I know it's not very useful code, but it demonstrates the ease with which control arrays can be used in VB6. What is the simplest equivalent in C# or VB.NET? 回答1: Make a

C# DLL cannot affect value of a number passed by reference from a VB6 application

馋奶兔 提交于 2019-11-27 05:37:14
I have a legacy VB6 application that calls a VB6 DLL, and I am trying to port the VB6 DLL to C# without yet touching the main VB6 application code. The old VB6 DLL had one interface that received a VB6 long (32-bit integer) by reference, and updated the value. In the C# DLL I have written, the updated value is never seen by the main VB6 application. It acts as though what was really marshalled to the C# DLL was a reference to a copy of the original data, not a reference to the original data. I can successfully pass arrays by reference, and update them, but single values aren't behaving. The C#

Is there a way to programmatically convert VB6 Formatting strings to .NET Formatting strings?

半城伤御伤魂 提交于 2019-11-27 05:10:53
Does anyone know of a good reference for VB6 format-strings? Does anyone know of a converter from VB6 formatting strings to .NET strings? I'm working on porting a large VB6 code base to .NET. It is a database centric piece of software, and the database itself holds VB6 format-strings which are later loaded and used to display other data in the database. My question, like this article , is how to port this. However the answer chosen for that question isn't adequate for my needs. I'm uncomfortable relying on libraries specifically designed for backwards compatibility with a language I've been

How do I figure out the correct argument structure for an unmanaged dll?

淺唱寂寞╮ 提交于 2019-11-27 04:07:30
问题 I was loading in some old VB functions from VBA, and mostly got everything updated to VB.NET, but there are function declarations for functions in "wininet.dll" which don't seem to match up correctly. The Error I'm getting is: Exception Thrown: Managed Debugging Assistant, 'PInvokeStackImbalance':... The long and short of it is that the length of the declared arguments needs to be explicit and it isn't matching up to the real functions in the dll. I looked this up and I can get by just

How do I convert Twips to Pixels in .NET?

眉间皱痕 提交于 2019-11-27 02:05:38
问题 I'm working on a migration project in which a database actually stores display sizes in twips. Since I can't use twips to assign sizes to WPF or Winforms controls, I was wondering if .NET has a conversion method usable at runtime? 回答1: It turns out that the migration tool has something, but it wouldn't do any good at runtime. Here's what I did (if the hard-coded value in the extension method were changed to the value for points per inch it would work as a point converter too): 1 Twip = 1

Best Development tools for Upgrading from VB6.0 [closed]

不羁的心 提交于 2019-11-26 21:40:50
问题 Im planning to upgrade a large vb6 application to .net. The project uses many third party components eg VSFlexGrid as well as crystal reports. It also uses old VB6 dlls whose source code is unavailable. My questions are Should I convert the source to C# or is VB.net robust enough? What do I do about third party components that are not supported or that use technologies that are insecure/obsolete? I would welcome any useful input from anybody who has done this before. 回答1: Here is an

How can I convert VB6 code to C#? [closed]

依然范特西╮ 提交于 2019-11-26 19:57:07
问题 Does anyone know a way to convert from VB6 code to C#? Is there a tool that can do this for me? 回答1: VisualStudio offers (or at least offered) a wizard to do a conversion from VB6 to VB.NET (which could then be converted to C# with a bit of work, possibly helped by #develop's VB.NET <-> C# converter), but when last I used it, for anything non-trivial there was a lot of manual work needing to be done so I suspect you're probably better rewriting or porting by hand if this is a large and/or