Click here to Skip to main content
15,906,766 members
Home / Discussions / C#
   

C#

 
GeneralRegistrations open for 2nd Batch of C# and VB.NET Pin
8-May-01 3:21
suss8-May-01 3:21 
GeneralWarning! This is another F'ing AD. Pin
Dave Kreskowiak13-Jun-05 10:46
mveDave Kreskowiak13-Jun-05 10:46 
Generalhi - how do i iterate thru a table Pin
7-May-01 5:55
suss7-May-01 5:55 
GeneralCalendar Web Control Pin
1-May-01 19:55
suss1-May-01 19:55 
GeneralC# Applet Like Functionality Pin
25-Apr-01 5:50
suss25-Apr-01 5:50 
GeneralRe: C# Applet Like Functionality Pin
29-May-01 11:54
suss29-May-01 11:54 
GeneralRe: C# Applet Like Functionality Pin
Nikhil Dabas31-May-01 8:46
Nikhil Dabas31-May-01 8:46 
Generalcalling COM objects within .NET C# Pin
18-Apr-01 9:06
suss18-Apr-01 9:06 
I'm in the process of trying to call our Verity COM object from within a .NET c# class. I successfully made a reference to the COM object from within VS.NET, and it seems to have worked in that I can see the methods and properties of the object. (from my reading, my adding a reference from VS.NET, it automatically takes care of creating the metadata necessary to call the COM object from within .NET as opposed to running the command line tlbimp.exe)

I am also able to create the object, and set some properties....however when trying to set some one object type to another, the compiler will not let me do it.

For example:
The Verity Object has a Vsearch class. A method in the vsearch class is called "GetResults()". The docs say it returns a "Result" Object.

So in my code, I create a Search object, a Result object, and then try to set my result object to the contents...like this

VerityIS.Vsearch mysearch = new VerityIS.Vsearch();
VerityIS.Result myresult = new VerityIS.Result();

...set some parametes for searching on mysearch, then execute the GetResults() method.

myresult = mysearch.Getresult();

The compiler complains that you cannot implicitly convert type "Object" to "VerityIS.Result"....meaning it sees the mysearch.Getresult() as returning just an "Object" type.


So then I try to use explicit casting.....

myresult = (VerityIS.Result)mysearch.GetResult();

The compiler let's me do this, without a problem. However, when I call this from within a ASP+ page, I get the InvalidCastException error message.

My question is, Is this a bug? Or, is there someway for me to identify the mysearch.Getresult() as the type of "VerityIS.Result" to the .NET framework??
GeneralSingleton objects in C# Pin
4-Apr-01 18:02
suss4-Apr-01 18:02 
GeneralRe: Singleton objects in C# Pin
6-Apr-01 5:32
suss6-Apr-01 5:32 
Generalertret Pin
28-Mar-01 23:52
suss28-Mar-01 23:52 
GeneralRe: ertret Pin
Dave Kreskowiak13-Jun-05 10:42
mveDave Kreskowiak13-Jun-05 10:42 
QuestionGPF? Pin
21-Mar-01 2:40
suss21-Mar-01 2:40 
AnswerRe: GPF? Pin
Dave Kreskowiak13-Jun-05 10:41
mveDave Kreskowiak13-Jun-05 10:41 
Generalabout message use C# Pin
19-Mar-01 22:16
suss19-Mar-01 22:16 
GeneralRe: about message use C# Pin
29-May-01 11:56
suss29-May-01 11:56 
GeneralC# and ScriptHosting Pin
Datacrime16-Mar-01 1:28
Datacrime16-Mar-01 1:28 
GeneralRe: C# and ScriptHosting Pin
Eric Gunnerson (msft)19-Mar-01 12:28
Eric Gunnerson (msft)19-Mar-01 12:28 
GeneralRe: C# and ScriptHosting Pin
Datacrime19-Mar-01 21:01
Datacrime19-Mar-01 21:01 
QuestionWriting COM servers in C#? Pin
Michael Dunn13-Mar-01 14:47
sitebuilderMichael Dunn13-Mar-01 14:47 
AnswerRe: Writing COM servers in C#? Pin
Eric Gunnerson (msft)19-Mar-01 12:25
Eric Gunnerson (msft)19-Mar-01 12:25 
GeneralRe: Writing COM servers in C#? Pin
Michael Dunn19-Mar-01 20:00
sitebuilderMichael Dunn19-Mar-01 20:00 
GeneralRe: Writing COM servers in C#? Pin
Christian Graus18-Aug-04 16:11
protectorChristian Graus18-Aug-04 16:11 
GeneralPlz Clarify Pin
12-Mar-01 23:54
suss12-Mar-01 23:54 
GeneralRe: Plz Clarify Pin
19-Jul-01 3:49
suss19-Jul-01 3:49 

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.