473,804 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing COM (VB6) User-Defined types (UDTs) from a VB.NET dll

Hey all,

I was wondering if you could put me out of my misery (hopefully, not literaly)
..

I am currently trying to port some VB6 code to VB.NET because of a possible
significant performance improvement on a very large simulation based system.
All my variables are currently encapsulated in public UDTs. If I could
access these COM UDTs from a .NET dll, I will be sorted for porting the
important engine of the system without having to change any VB6 GUIs. I got
through the quagmire that is CCW (Com Callable Wrappers) and have a working .
NET dll with respect to accessing the .NET dll from VB6, but can't seem to
pass my UDTs from COM to .NET. They are complex multi-tiered, nested UDTs
within UDTs.

The question: can UDTs be passed (marshalled) from COM to .NET? If not,
should I scrap the UDTs, create a .NET structure or class and instantiate
that within COM in the first place?

cheers,
James
Nov 21 '05 #1
1 1595
On Wed, 19 Oct 2005 01:00:57 GMT, "jimfollett 1 via DotNetMonster.c om" <u14971@uwe> wrote:

¤ Thanks Paul for your reply.
¤
¤ If accessing COM UDTs from .NET is not really an option, then I have no easy
¤ solution to the problem. I had to use UDTs in the first place with VB6
¤ because VB6 classes don't handle arrays well, and now this has the knock-on
¤ effect that my code is not very portable to .NET - doh.
¤
¤ I am trying out replacing my COM UDTs with .NET public classes called from
¤ VB6, but proof of concept is no small task sadly. This is because the memory
¤ strucutres are a tad complex and a great deal of changes will have to be
¤ made to alter the implementation from array based structures to "collection "
¤ classes. If I used "ArrayList" classes would this change over be minimised
¤ because interating is the same type of coding, UBound exists etc?
¤
¤ cheers, James

I didn't want to imply that it wasn't an option just that it might be a bit of a hassle.

I'm probably not going to be able to help you with the nested UDT issue so you may want to try
posting your question in the microsoft.publi c.dotnet.framew ork.interop newsgroup.
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
15128
by: Tom Meuzelaar | last post by:
Hello: I'm using VB6 in VS enterprise. I'd like to place an HTML form inside a VB container, have a user fill out the form information, click a submit button, and then have the program capture the field values and write them to an ASCII file on the hard drive. Can anyone confirm that this is even possible? I have dredged up one article "Accessing the Internet Explorer Document Object Model from Visual Basic 5.0" (Asmi, 1998) that covers...
13
14119
by: Neil Brown | last post by:
Does anyone know how to access a MySQL server from vb6? Any suggestions appreciated. NB
4
1335
by: Joseph Geretz | last post by:
Our company develops and markets a client/server application which is written in VB6 as a rich Win32 Client/Server application. For a variety of technological reasons we are looking to migrate toward the .NET environment. However, a number of business factors make it impractical to accomplish this through an abrupt termination of the VB6 product and complete rewrite. Instead, we are looking to perform new development in .NET and slowly over...
3
2183
by: Paul Phillips | last post by:
Here is what I am trying to do. I have an application that is written in VB 6 and in this application it is accessing a custom dll file that was created using Microsoft Fortran Professional 4.0. Now I have created the same application as far as user interface in a ASP.Net web application but I am having trouble accessing the Fortran dll file. I am doing the DLLImport statement in a class by itself. I make an instance of this class...
1
1207
by: Mullin Yu | last post by:
i found out that if i debug the web services that accessing a vb6 com (a dll file), other clients' request will be stalled until releasing from the debug mode. to me, the dll seems to be a queue then. but, my dll is already 1. set to Instancing to MultiUse 2. try with COM+ at win2k how to get rid of this issue? i expect should be allowed concurrent access.
1
1577
by: NWx | last post by:
Hi, I'm an old developer, but didn't used SQL Server or MSDE to much before. I have NetSDK instance of MSDE installed on my PC by Net Framework SDK. All quickstart samples access it using trusted connection. However, I want to access it using user / password, but I have no idea what is default username / password to use. Any help is appreciated.
6
14001
by: Andy Barber | last post by:
Hi, I'm trying to write an app that reads data from a table into a string variable for later use in my program. Below is a snippet of the code I'm using, which compiles ok, but at runtime I get and error 'Object reference not set to an instance of an object.' as soon as I try to access the data in the fields, I.e. at the line that reads 'KeyFlags(i) = rstFields("keyflag").value'
0
972
by: Nijazi Halimaji | last post by:
Hi Newsgroup I have written a .NET Component, made the check on "register for COM interop" in Build options, create a strong name and registered the assembly in the GAC. Accessing this Assembly with VB6 or VB Script (with CreateObject) works very fine. But when I try to access this assembly with a 16-bit-Basic-Language-Platform
0
1005
by: RSH | last post by:
Hi, I'm a veteran VB6 programmer venturing up to C#. I have seen a ton of examples of C# using different techniques for accessing a SQL database but I was wondering if there is a way to work with a database much like we did using ADO under VB6? I guess I'm looking for the simplicity of being able to do an update or insert without having to write all the SQL to go with it. Here is a very common example of what I'm trying to emulate in...
0
1361
by: Tobester | last post by:
Hi I am having problems accessing a vb6 dll from ASP.Net. The vb6 dll is registered. I have then created an interop file using tlbimp. The interop has been added to the GAC. I can run the code through a windows application with everything working fine. In this situation I have:
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10569
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10325
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10315
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9140
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.