473,385 Members | 1,958 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,385 software developers and data experts.

late binding an ActiveX Executable with multiple return arrays

No one on any of the other boards seem to know

In VB.Net this late binding works fine
Dim Version As Integer
Dim Revision As Integer
Dim Wnum As Integer
Dim o As System.Array = System.Array.CreateInstance
(GetType(Single), 1)
Dim h As System.Array = System.Array.CreateInstance
(GetType(Single), 1)
Dim l As System.Array = System.Array.CreateInstance
(GetType(Single), 1)
Dim c As System.Array = System.Array.CreateInstance
(GetType(Single), 1)
Dim Vol As System.Array = System.Array.CreateInstance
(GetType(Int32), 1)
Dim Dates As System.Array = System.Array.CreateInstance
(GetType(Int32), 1)

t = CreateObject("TC2000Dev.cTC2000")

Wnum = 1000

Revision = t.GetRevision
Label1.Text() = Revision

t.GetPrices(Wnum, o, h, l, c, Vol, Dates, 100)

Label2.Text() = c(1)


When it is converted to C# late binding, the GetRevision
method works but the GetPrices does not

GetRevision only is suppose to return an Int32, but
GetPrices is supposed to return multiple System.Arrays

int WNum = 1000;

System.Array _open = new System.Single[1];
System.Array _high = new System.Single[1];
System.Array _low = new System.Single[1];
System.Array _close = new System.Single[1];
System.Array _vol = new System.Int32[1];
System.Array _date = new System.Int32[1];
object[] d = {WNum, _open, _high, _low, _close, _vol,
_date, day};
Type myType = Type.GetTypeFromProgID("TC2000Dev.cTC2000");
object myObject = Activator.CreateInstance(myType);
//Works
Int32 Revision = (Int32) myType.InvokeMember
("GetRevision",
BindingFlags.Default | BindingFlags.InvokeMethod,
null,
myObject,
new object[]{});

label1.Text = Revision.ToString();

//Does not work
d = (object[]) myType.InvokeMember("GetPrices",
BindingFlags.Default | BindingFlags.InvokeMethod,
null,
myObject,
new object[]{WNum, _open, _high, _low, _close, _vol,
_date, 100});
How does the InvokeMember need to change to allow the
GetPrices to work?

WNum and 100 are the input params, and _open, _high,
_low, _close, _vol, _date are system arrays that are
returned

Thanks

Nov 15 '05 #1
0 1490

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

Similar topics

13
by: Mike MacSween | last post by:
I'm doing this: strAccessPath = SysCmd(acSysCmdAccessDir) & "msaccess.exe" in a vb executable to do what it looks like. If I remove the reference to the access object library this seems to...
9
by: Zlatko Matić | last post by:
I was reading about late binding, but I'm not completely sure what is to be done in order to adjust code to late binding... For example, I'm not sure if this is correct: early binding: Dim ws...
0
by: JL_327 | last post by:
No one on any of the other boards seem to know In VB.Net this late binding works fine Dim Version As Integer Dim Revision As Integer Dim Wnum As Integer Dim o As System.Array =...
30
by: lgbjr | last post by:
hi All, I've decided to use Options Strict ON in one of my apps and now I'm trying to fix a late binding issue. I have 5 integer arrays: dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
3
by: gregory_may | last post by:
I want to prevent late binding of this statement: MyServerConnections(Myindex).client = Value But when I try with the code below, I get an editor error: "Expression is a value and therefor...
6
by: Tim Roberts | last post by:
I've been doing COM a long time, but I've just come across a behavior with late binding that surprises me. VB and VBS are not my normal milieux, so I'm hoping someone can point me to a document...
9
by: Miro | last post by:
VB 2003 and Im still new to vb, so i hope i can explain this as best I can. I have a variable defined as such: ( simple example ) Dim AVariableOfSorts(,) As Object = _ { _ {"Last", "String",...
1
by: Adotek | last post by:
Hi All, I've just converted a solution from .Net v1.1 to v2.0, by allowing Visual Studio 2005 to do the conversion. Since doing so, I am getting a compilation error as follows: "Option...
1
by: Jonathan Sion | last post by:
Hi All, this is a bit tricky: i am writing an application that uses ADO.NET. the trick is: i dont know in advance what driver it would be. i want to let user point to a DLL (which has to be an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.