Login  
Search All Forums
Dart Home | PowerTCP Web Enterprise for ActiveX | Custom Development Reply | PowerTCP Web Enterprise for ActiveX Topics | Forums   
AuthorForum: PowerTCP Web Enterprise for ActiveX
Topic: Calling DartStream.Read from C#
jshepherd

From: Atlanta, GA USA
Posts: 3
Member Since: 07/22/02
posted July 22, 2002 2:52 PM

How can I call the DartStream.Read() function from C#? I keep getting the following error:

The best overloaded method match for 'DartWebASP.IDartStream.Read(ref object, int)' has some invalid arguments

I've tried:
DartWebASP.DartStream dartStream = new DartWebASP.DartStreamClass();
string buffer = "";
ret = dartStream.Read(ref buffer, 0);
ret = dartStream.Read(buffer, 0);
ret = dartStream.Read(buffer);
ret = dartStream.Read(ref buffer);


Thanks!

Jay Shepherd
Jon Belanger



From: Rome, NY USA
Posts: 310
Member Since: 06/10/02
posted July 22, 2002 3:05 PM

Dim buffer as an Object then type cast it to a String after the call returns. The problem lies in how VB handles the String type.

So, something like this (I'm deriving my C# knowledge from Java, so this might not be exact)
Object buffer;
ret = dartStream.Read(ref buffer, 0);
String temp = (String)buffer;
jshepherd

From: Atlanta, GA USA
Posts: 3
Member Since: 07/22/02
posted July 22, 2002 3:50 PM

Ok, I tried that method, and it would compile without any errors, however at runtime I get the following error:

Additional information: Parameter 1 of the method used is invalid or not appropriate.

Object buffer = new Object();
ret = dartStream.Read(ref buffer, 0);

Any ideas?
jshepherd

From: Atlanta, GA USA
Posts: 3
Member Since: 07/22/02
posted July 22, 2002 4:08 PM

Ok, I think I got this to work by doing this:

string buffer = "";
Object oBuffer = buffer;

ret = dartStream.Read(ref oBuffer, 0);

Jon Belanger



From: Rome, NY USA
Posts: 310
Member Since: 06/10/02
posted July 22, 2002 4:23 PM

Great, sorry for the slow reply. Don't hesitate to post if you continue to have trouble.
Reply | PowerTCP Web Enterprise for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX