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.Cr eateInstance
(GetType(Single ), 1)
Dim h As System.Array = System.Array.Cr eateInstance
(GetType(Single ), 1)
Dim l As System.Array = System.Array.Cr eateInstance
(GetType(Single ), 1)
Dim c As System.Array = System.Array.Cr eateInstance
(GetType(Single ), 1)
Dim Vol As System.Array = System.Array.Cr eateInstance
(GetType(Int32) , 1)
Dim Dates As System.Array = System.Array.Cr eateInstance
(GetType(Int32) , 1)
t = CreateObject("T C2000Dev.cTC200 0")
Wnum = 1000
Revision = t.GetRevision
Label1.Text() = Revision
t.GetPrices(Wnu m, 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.GetTypeFro mProgID("TC2000 Dev.cTC2000");
object myObject = Activator.Creat eInstance(myTyp e);
//Works
Int32 Revision = (Int32) myType.InvokeMe mber
("GetRevisio n",
BindingFlags.De fault | BindingFlags.In vokeMethod,
null,
myObject,
new object[]{});
label1.Text = Revision.ToStri ng();
//Does not work
d = (object[]) myType.InvokeMe mber("GetPrices ",
BindingFlags.De fault | BindingFlags.In vokeMethod,
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 0 1527 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 be the
only line the app chokes on. As the Access Obj library is the one most
likely to be in a non-standard location I'm wondering how to do without it.
Can I make that above late binding?
|
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 As DAO.Workspace
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim rs As DAO.Recordset
|
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 = System.Array.CreateInstance
(GetType(Single), 1)
|
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 integer
The integers in these arrays are actually pointers to different columns of
data in a text file.
|
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 cant be the target of an assignment"
CType(MyServerConnections(Myindex), PrivateServerConnectionStruct).Client =
value
| |
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 that
describes this.
Here's the setup. We have a COM server, written in Python. For
completeness, here is the script:
----- testserver.py -----
import pythoncom
|
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", 20}, _
{"First", "String", 20} _
}
|
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 Strict On disallows late binding."
This references line 1, which is my page directive:
|
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 ADO.NET driver) and in
'late binding' (to use activeX terms... yes i am that old) load it and
then use objects it exposes (connection, DataAdapter, etc...)
can this be done? anybody know of any code snippet that could get me
started?
|
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...
|
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,...
| |
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |