Hi Jay,
unfortunately, C# is like C++ in this regard, there is no inbuilt help for calling IDispatch (one of the COM concepts, if you need some further explanation on this, just drop me another email). What you are having to do in C# is similar to what VB (and Activate) has to do under the covers to make this work. You will also find that you have to do a similar thing from Delphi8.
As I said, this is kinda tedious as of now, but will disappear with the new .NET binding. Unfortunately, I cannot tell you when this will be available either :(
Alex
Jay Ayliff wrote:
Hi Alex,
Sorry to butt in, but is this a difference in the way Cach� COM Interop works with C# and VB.NET (no InvokeMember in VB, just call the method)?
I've given up waiting for native .NET binding now they've pulled it from 5.1.
Regards
Jay Ayliff Stalis Ltd
"Alex Schaefer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
The syntax you tried to use will work fine with the native .NET binding that we're currently working on.
However, as of now you unfortunately have to use the InvokeMember() method every time you want to access a property or method from Cache. So it'll be something like myPatient.InvokeMember("firstName",...)
If you can't get it to work, throw it at support with a specific sample, they will be able to help.
[EMAIL PROTECTED] wrote:
Hello,
Having a bit of a hitch here and am a bit lost on how to proceed.
I managed to get an object opened using the OpenID method in C#
so something like ...
object myPatient = new object(); myPatient = factory.OpenId("PatientDB.patientInfo", "1", 0);
Now, the annoying thing is that I cannot get any information about myPatient. So I cannot get ....... myPatient.firstName or myPatient.Lastname
so if I add this line: System.Console.WriteLine(myPatient.firstName);
the program won't even compile...
I can sort of understand why.....since .NET would have no idea of the existance of firstName and lastName attributes.
To try fixing that, I even created a PatientInfo object that would have the same attributes as the PatientDB.patientInfo table and then tried typecasting it as such..
PatientInfo myPatient = new PatientInfo(); myPatient = (PatientInfo)factory.OpenId("PatientDB.patientInfo", "1", 0);
but at that point, it gives an "Invalid typecast" error
.....................
So....I'm quite lost at this point. I tried googling for examples, but I couldn't find even one....where VB .NET or VC# .NET and Cache were used together. most of them seem to use VB6 which seems to be slightly different in handling objects.
Would really appreciate if..someone could guide me on the right path about the above problem
Regards,
Himanshu
