Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Installer Project Pin
tkemory8-Nov-03 7:08
tkemory8-Nov-03 7:08 
GeneralDatabase access - in general Pin
mirano8-Nov-03 0:28
mirano8-Nov-03 0:28 
GeneralRe: Database access - in general Pin
WillemM8-Nov-03 5:31
WillemM8-Nov-03 5:31 
GeneralC# applet Pin
Sergiu7-Nov-03 20:30
Sergiu7-Nov-03 20:30 
GeneralRe: C# applet Pin
WillemM8-Nov-03 5:31
WillemM8-Nov-03 5:31 
GeneralRe: C# applet Pin
jparsons8-Nov-03 12:04
jparsons8-Nov-03 12:04 
GeneralRe: C# applet Pin
Sergiu9-Nov-03 20:15
Sergiu9-Nov-03 20:15 
GeneralLate Binding an ActiveX executable Pin
JL_3277-Nov-03 16:06
JL_3277-Nov-03 16:06 
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
QuestionHow do u change the brightness of an image in C# Pin
james4057-Nov-03 11:48
james4057-Nov-03 11:48 
GeneralPutting a fixed array of data into the database Pin
EddieSD647-Nov-03 11:16
sussEddieSD647-Nov-03 11:16 
GeneralRe: Putting a fixed array of data into the database Pin
Colin Angus Mackay7-Nov-03 14:20
Colin Angus Mackay7-Nov-03 14:20 
QuestionExternal Variables??? Pin
bscott31257-Nov-03 10:04
bscott31257-Nov-03 10:04 
AnswerRe: External Variables??? Pin
MultiThread8-Nov-03 5:51
MultiThread8-Nov-03 5:51 
GeneralRe: External Variables??? Pin
bscott31258-Nov-03 6:08
bscott31258-Nov-03 6:08 
GeneralRe: External Variables??? Pin
MultiThread8-Nov-03 6:15
MultiThread8-Nov-03 6:15 
QuestionHow do I create an app.config file?? Pin
Code Toad7-Nov-03 9:12
Code Toad7-Nov-03 9:12 
AnswerRe: How do I create an app.config file?? Pin
Colin Angus Mackay7-Nov-03 14:28
Colin Angus Mackay7-Nov-03 14:28 
GeneralReading simple XML Pin
MrEyes7-Nov-03 8:03
MrEyes7-Nov-03 8:03 
GeneralRe: Reading simple XML Pin
Mazdak7-Nov-03 8:57
Mazdak7-Nov-03 8:57 
GeneralRe: Reading simple XML Pin
Daniel M. Edwards7-Nov-03 9:22
Daniel M. Edwards7-Nov-03 9:22 
GeneralRe: Reading simple XML Pin
MrEyes7-Nov-03 13:36
MrEyes7-Nov-03 13:36 
GeneralACCESS OBJECT LIBRARY PROBLEM Pin
_Comet_Keeper_7-Nov-03 7:03
_Comet_Keeper_7-Nov-03 7:03 
GeneralRe: ACCESS OBJECT LIBRARY PROBLEM Pin
Heath Stewart7-Nov-03 7:37
protectorHeath Stewart7-Nov-03 7:37 
QuestionHow to know if TextBox caret is on last line Pin
Judah Gabriel Himango7-Nov-03 6:53
sponsorJudah Gabriel Himango7-Nov-03 6:53 
QuestionWhat do you use the HACK task for? Pin
flipdoubt7-Nov-03 5:55
flipdoubt7-Nov-03 5:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.