473,761 Members | 8,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Another try.... What to use to pass data from VB dll to C#?

Hello,

I tried this question prior and got no response, so thought I would try
to explain differently..

I am not sure which type of object to pass between a VB 6.0 ActiveX dll and
C#. I am wrapping a COM object because I am having issues with the types
that C# does not seem to understand. I need to be able to use a method from
the VB 6.0 dll which will query a proprietary data structure. I then need
to return this and iterate through it in C#. I would prefer some type of
recordset object, but am not sure what needs to be done. I would think this
would be simple, but not sure...

Any idea how I can either: 1. Pass a recordset object -OR- 2. Pass
an array -OR- 3. Pass some other object which makes sense

The VB dll should: Be able to take parameters and return a set of
data (Date/Time and Value(single/double/string - or I can force it to string
and convert)

The C# app should: Be able to iterate through the returned object and
evaluate the information.

Thanks in advance,

Andrew Mueller
Nov 13 '05 #1
3 3185
Andrew,

This is really all up to you. You can export .NET types to COM, and
they should be accessible to VB (if the types you are creating/using are
Automation compatable). Subsequently, you can import COM types into .NET.

This means that you could have the VB dll use a DataSet or use an
ADODB.Recordset , it's really up to you. You just have to make sure that it
interops well. It's probably easiest to have the VB6 dll work with
recordset objects. However, if you want to take advantage of ADO.NET, you
will have to perform conversions between ADO.NET data sets and
ADODB.Recordset s.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni************* *@exisconsultin g.com

"Andrew Mueller" <am******@ins3. com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hello,

I tried this question prior and got no response, so thought I would try to explain differently..

I am not sure which type of object to pass between a VB 6.0 ActiveX dll and C#. I am wrapping a COM object because I am having issues with the types
that C# does not seem to understand. I need to be able to use a method from the VB 6.0 dll which will query a proprietary data structure. I then need
to return this and iterate through it in C#. I would prefer some type of
recordset object, but am not sure what needs to be done. I would think this would be simple, but not sure...

Any idea how I can either: 1. Pass a recordset object -OR- 2. Pass an array -OR- 3. Pass some other object which makes sense

The VB dll should: Be able to take parameters and return a set of
data (Date/Time and Value(single/double/string - or I can force it to string and convert)

The C# app should: Be able to iterate through the returned object and evaluate the information.

Thanks in advance,

Andrew Mueller

Nov 13 '05 #2
What ever "object" you pass, you have to have a reference to a .NET wrapped
version of that object. My personal feeling is passing the data as XML is
your best option. If you do this right (ie, follow the DataSet schema), you
can move data from COM into a .NET DataSet.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

*************** *************** *************** *************** *************** *
****
Think Outside the Box!
*************** *************** *************** *************** *************** *
****
"Andrew Mueller" <am******@ins3. com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hello,

I tried this question prior and got no response, so thought I would try to explain differently..

I am not sure which type of object to pass between a VB 6.0 ActiveX dll and C#. I am wrapping a COM object because I am having issues with the types
that C# does not seem to understand. I need to be able to use a method from the VB 6.0 dll which will query a proprietary data structure. I then need
to return this and iterate through it in C#. I would prefer some type of
recordset object, but am not sure what needs to be done. I would think this would be simple, but not sure...

Any idea how I can either: 1. Pass a recordset object -OR- 2. Pass an array -OR- 3. Pass some other object which makes sense

The VB dll should: Be able to take parameters and return a set of
data (Date/Time and Value(single/double/string - or I can force it to string and convert)

The C# app should: Be able to iterate through the returned object and evaluate the information.

Thanks in advance,

Andrew Mueller

Nov 13 '05 #3
What type of data? Is it the type of data that will break down nicely
to a primitive type like a byte array or int array? You can pass
strings easily enough, so if you can serialize or string-represent
your objects, that's a consideration. You can use ADO recordsets in
..NET so passing a disconnected ADO recordset is an option.

"Andrew Mueller" <am******@ins3. com> wrote in message news:<#z******* *******@TK2MSFT NGP12.phx.gbl>. ..
Hello,

I tried this question prior and got no response, so thought I would try
to explain differently..

I am not sure which type of object to pass between a VB 6.0 ActiveX dll and
C#. I am wrapping a COM object because I am having issues with the types
that C# does not seem to understand. I need to be able to use a method from
the VB 6.0 dll which will query a proprietary data structure. I then need
to return this and iterate through it in C#. I would prefer some type of
recordset object, but am not sure what needs to be done. I would think this
would be simple, but not sure...

Any idea how I can either: 1. Pass a recordset object -OR- 2. Pass
an array -OR- 3. Pass some other object which makes sense

The VB dll should: Be able to take parameters and return a set of
data (Date/Time and Value(single/double/string - or I can force it to string
and convert)

The C# app should: Be able to iterate through the returned object and
evaluate the information.

Thanks in advance,

Andrew Mueller

Nov 13 '05 #4

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

Similar topics

1
9593
by: Joe | last post by:
I am trying to write a Perlscript to be used with some HTML pages. Here is how it works: 1.. The first HTML page has a form which requests for user input. Then it passes the QUERY_STRING to a Perl script. 2.. The Perl script will then validate the data. If input validation fails, it returns to the previous screen and asks the user to retry. If the validation passes, it display the user input and asks for confirmation.
2
2742
by: Miguel Orrego | last post by:
Hi, I have a page that pulls data from a database, one of the fields is Notetext which frequently contains an email. I then want to pass this onto another page, that updates the email field in another database, so in page 1: strNote = rsnotes("NOTETEXT") And to pass to the next page:
12
6558
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html I am passing countries, products, and courses. The first two display
6
1840
by: anon | last post by:
Post Forwarding question...... For this control below, <asp:Button runat="server" PostTargetUrl="page2.aspx" /> The Attribute: PostTargetUrl="page2.aspx" Is this PostTargetUrl Attribute going to be available in the <a> and Html Controls as well as opposed to just the <asp:Button> control?
27
6213
by: Oscar | last post by:
I am looking for a way to pass an ADO recordset that has been retrieved in an ASP page to another HTML-page. Is there someone who can provide me with a small sample or a link to see how this is done? regards, Oscar
7
6202
by: Dave | last post by:
I have two forms, Form1 and Form2. From Form2, how do I reference the value in a control on Form1? Or perhaps a more specific question: Form1 contains a textbox with the value of 10. This form is hidden. Form2 is active and a user enters a value of 2 into a blank text box. How can I add this value to the textbox in Form1 so that when Form1 is displayed it's textbox displays 12? I probably have the wrong mindset here; I'm thinking...
4
4803
by: tom | last post by:
Hi Experts, I want to pass the selectedDate value from my calender form to another web form or a web user control. Could you please show me how to do this? Thanks in advance.
8
1963
by: Chris | last post by:
Hi, I have two froms (form1 and form2). I want to be able to pass values from form 1 to form2 and be able to use those values leter in form2. This is my code for form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Server.Transfer("form2.aspx", True) End Sub
17
7074
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the returned value is "" Anybody know how to set this value on 1st page properly, in order to let 2nd page catch it? I don't want to use querystring to pass this value!
3
4417
by: colleen1980 | last post by:
Hi: Can any one please help me when user select 2 dates from DDLDate1 10/09/2006 and DDLDate2 10/12/06 and the name and it close the form. I need to create multiple records in the another table on the basis of two dates like that. Data in continous form table1 ----------------------------- Data entered in continous form 10/09/2006 10/12/2006 John
0
9554
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
9376
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9988
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
9923
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
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
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
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2788
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.