473,473 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CreatObject in C#

3 New Member
Hello,

I'm re-writing a VB6 DLL to C#.

The translation is complete and everything works fine, accept the most crucial part.

The VB6 DLL communicates with a remote machine with a CreateObject(..,..) function. It sends an XML(string) and receives an answer from it, also as an XML(string):

Dim objComponent As Object
Dim strXMLOut As String

' get message from MQ
Set objComponent = CreateObject("PMQAccessData.cGetMQData", "NT101")
strXMLOut = objComponent.fGetMQData(strXMLIn, strProject)


In C# I tried the following code, but oType stays null :

Type oType = Type.GetTypeFromProgID("PMQAccessData.cGetMQData", "NT101");
object o = System.Activator.CreateInstance(oType);
strXMLOut = (string)oType.InvokeMember("fGetMQData", System.Reflection.BindingFlags.InvokeMethod, null, o, new object[] { strXMLIn, strProject });


Does anyone have any idea how to tackle this problem?

Thanx! Dennis
Jan 25 '08 #1
3 1382
Plater
7,872 Recognized Expert Expert
I don't know what PMQAccessData is, but it sounds like a custom object. Can you just instanciate it as normal?
Where is the definition of this object stored (in a dll or something)?
You may need to use DLLImport?
Jan 25 '08 #2
DennisBetten
3 New Member
I think PMQAccessData is a DLL running on a remote server (NT101) and the CreateObject methode retreives information by accessing the registry(?) on the remote server.

Unfortunatly I cannot access the remote machine to confirm this.

Is it posible to access a DLL on a remote machine by using DLLImport?
Jan 28 '08 #3
Plater
7,872 Recognized Expert Expert
I am not sure aout remote DLLImport calls.

You might have to ask someone with stronger VB knowledge to explain better what was going on? (If they can)
Jan 28 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Al | last post by:
Hi, I am getting "Application-defined or object-define error" when trying to instantiate an MTS component. However, when I run the VB source-code and leave it in run-time, I am able to...
3
by: hb | last post by:
Hi, I need to use MSXML2.DOMDocument in my ASP page. The following is my code: xml.asp: ===== <% dim sx sx="<root><a>text1</a><b>text2</b></root>" dim xd
8
by: scorpion53061 | last post by:
I am sorry for this but I am not getting an answer elsewhere so I thought I would try here. It seems the safer way to go prior to deployment is to change my early binding to late binding to...
1
by: MisterT | last post by:
I created a .NET library using the VS 2003 COM template. I can do a CreatObject() from vbscript, but none of the properties are visible. What is wrong? Here is the code: ...
2
by: ToddT | last post by:
I have some code in a regular client-based app that calls a COM component hosted in an EXE. For the code to work, the EXE must be running. This works fine. When I place the same code in a Web...
2
by: Robert Vasquez | last post by:
I have three classes. One (Class ObjectC) and two other classes (Class1 and Class2) that will hold instances of the ObjectC class. I would like to transfer an instance of OjectC from Class1 into...
3
by: superfly | last post by:
Hi, I am new to visual basic and Ms Access but this is what I am trying to do. I have a Field called Act/Inact and in this field I have some records that say active and some records that say...
16
by: nkoriginal | last post by:
I want an automatic insert. I've an ASP page with more than 50 fields (form) and I want to an insert all that information in a table in SQL server 2005. Now, I've statments for insert BUT I need...
6
by: Nano | last post by:
I want to update a MS Access Table using ASP, I have made the connection with the database but I am unable to update it. I am using the following code: ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
1
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...
1
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...
0
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...
0
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.