[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Can I return an Interface.?

Lord2702

9/2/2004 5:15:00 AM

Wed. Sep. 01, 2004 10:10 PM PT

I have a remoting server, on which I host a Business Object Component, I
want to return an Interface IDbConnection as follows...

IDbConnection *GetConnection() {
// code
return dbConnection; //as an interface
}

Thanks.


2 Answers

Henrik de Jong

9/2/2004 7:48:00 AM

0

It is in fact a common way to talk to remote objects by interfaces. You
can also return interfaces wich are remote-objects. By example, if you
've got the Advanced .Net Remoting from Ingo Rammer, you can read a nice
example about an IRemoteFactory wich returns a IRemoteObject based on
some parameters.

kind regards,
Henrik


Lord2702 schreef:
> Wed. Sep. 01, 2004 10:10 PM PT
>
> I have a remoting server, on which I host a Business Object Component, I
> want to return an Interface IDbConnection as follows...
>
> IDbConnection *GetConnection() {
> // code
> return dbConnection; //as an interface
> }
>
> Thanks.
>
>

Lord2702

9/2/2004 6:38:00 PM

0

Thu. Sep. 02, 2004 11:35 AM PT

It seems you didn't get my query, I already host a COM+ object and returning
its interface, now, let say in this COM object I have two methods,
DataSet *GetDataSet();
IDbConnection *GetConnection();

In first I return DataSet object, but have a problem while returning the
second one, the interface connection. It says, something like the object
cannot be marshalled, may be, the Interfaces are not by MBRO, and also not
marked by ISerializable. Hence, my question is How do I return an Interface
? Although, I will not JUST return the interface, within GetConnection I
will assign the interface variable with full object.

Thanks for your reply.


"Henrik de Jong" <hj.de.jong@planet.nl> wrote in message
news:ehDCoHMkEHA.3016@tk2msftngp13.phx.gbl...
> It is in fact a common way to talk to remote objects by interfaces. You
> can also return interfaces wich are remote-objects. By example, if you
> 've got the Advanced .Net Remoting from Ingo Rammer, you can read a nice
> example about an IRemoteFactory wich returns a IRemoteObject based on
> some parameters.
>
> kind regards,
> Henrik
>
>
> Lord2702 schreef:
> > Wed. Sep. 01, 2004 10:10 PM PT
> >
> > I have a remoting server, on which I host a Business Object Component, I
> > want to return an Interface IDbConnection as follows...
> >
> > IDbConnection *GetConnection() {
> > // code
> > return dbConnection; //as an interface
> > }
> >
> > Thanks.
> >
> >