473,387 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Marshaller Error when calling vb 6 dll with embedded structure.

I have a problem with the marshaller calling a vb6 dll from csharp.
here follows the code that is similar in structure to what i want to call.

rem vb6 dll

type a
b1 as byte
b2(2) as byte
end type

type compoundstruct
c1 as byte
astruct(1 to 4) as a
end type

function dosomething(byref passed as compoundstruct) as int

passed.c1=1
passed.astruct(1).b1=1
passed.astruct(1).b2(1)=1
dosomething=1

end function

Should I create an adapter or is there a way to call this from csharp?
Nov 15 '05 #1
1 1238
Paul,

Assuming that this is an ActiveX dll (in other words, a COM server of
some kind), you can use the TLBIMP.EXE utility to create managed
wrappers/definitions that you can access from C# to call the VB code.

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

"Paul J Barrett" <pa************@hotmail.com> wrote in message
news:6f**************************@posting.google.c om...
I have a problem with the marshaller calling a vb6 dll from csharp.
here follows the code that is similar in structure to what i want to call.

rem vb6 dll

type a
b1 as byte
b2(2) as byte
end type

type compoundstruct
c1 as byte
astruct(1 to 4) as a
end type

function dosomething(byref passed as compoundstruct) as int

passed.c1=1
passed.astruct(1).b1=1
passed.astruct(1).b2(1)=1
dosomething=1

end function

Should I create an adapter or is there a way to call this from csharp?

Nov 15 '05 #2

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

Similar topics

2
by: Varun | last post by:
Hello Despite all the advise i have recieved from everyone on this group i still cannot fix this error. I am fast approachin my deadline so i need to fix this asap :o I get the error whenever i...
2
by: lathe_biosas | last post by:
Hi Im trying to get the variable x from Code Composer via Matlab the following way variable=createobj(cc_target,'x') but there is and error message from matlab: ??? Processor not...
19
by: Ross A. Finlayson | last post by:
Hi, I hope you can help me understand the varargs facility. Say I am programming in ISO C including stdarg.h and I declare a function as so: void log_printf(const char* logfilename, const...
5
by: Dominiek | last post by:
Hi, I have a strange problem. during the developement of my program, while progressively writing more and more code, the callstack of my program gets deeper and deeper (7 levels). Then, all...
5
by: Kurt Van Campenhout | last post by:
Hi, I am trying to get/set Terminal server information in the active directory on a windows 2000 domain. Since the ADSI calls for TS don't work until W2K3, I need to do it myself. I'm fairly...
0
by: marc joanisse | last post by:
Hi Folks, I am writing a c# app that interacts with some scientific hardware (a "bird", which is just a magnetic tracker) through a C++ DLL. The actual data from the "bird" is read by the...
4
by: Jack | last post by:
Hi, I am trying to run an example code from a book. However I am getting the following error message: Number: -2147217900 Description: Syntax error or access violation Source: Microsoft OLE...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
4
by: JackBlack | last post by:
Hi, all! Need a little help tracking down a runtime error problem. I'm getting this error: "Unable to cast object of type 'myStruct' to type 'myStruct'... but the two types are identical! I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.