Board index » delphi » Passing TTreeView as a param using OLE Automation Server

Passing TTreeView as a param using OLE Automation Server

Hi All,

I hope this isn't a recent question, cause i've just got onto this
newsgroup, and don't have the time to read through everything - this issue
is relatively urgent ... so PLEEEZE HELP !.

I have an out of process OLE Automation Server written to handle my DB
access - looping through 3 result sets, each one depending on the previous
result set. (sort of MASTER-DETAIL-DETAIL). I want these results loaded into
a treeview to be displayed in my main app window, which is the client
calling the OLE Server, I however cannot seem to find out what I must pass
as a return value of the function in the OLE Server, so that I can do
everything (query DB, and Build Treeview) in the server, while simply
setting the result to the visible Treeview on the client.

I ran into this problem with TQuery's, and was advised to use the IProvider
interface to do the comms. What can i do here ?

Please help.

Regards

Robert Lofthouse
robert.loftho...@spl.co.za

 

Re:Passing TTreeView as a param using OLE Automation Server


Robert,

You really should do the tree loading on the client (where the tree is).
Automation does not support passing around window handles or delphi
components.

If the server was an in-proc automation server than you could cheat
and pass in the tree as an integer. Just remember I said *cheat*. This
only works since you are in the same address space (very advisable to
be built with packages as well to avoid any vtable/version issues).

If it is out-of-process and must remain that way then you really need to
provide automation compatible interfaces for all of the tree view
objects (not a trival task).

Net: just load the tree in the client from your client datasets.

Ryan VanIderstine
Run-Time Systems

Quote
Robert Lofthouse <robert.loftho...@spl.co.za> wrote in message

news:7l86bk$mot10@forums.borland.com...
Quote
> Hi All,

> I hope this isn't a recent question, cause i've just got onto this
> newsgroup, and don't have the time to read through everything - this issue
> is relatively urgent ... so PLEEEZE HELP !.

> I have an out of process OLE Automation Server written to handle my DB
> access - looping through 3 result sets, each one depending on the previous
> result set. (sort of MASTER-DETAIL-DETAIL). I want these results loaded
into
> a treeview to be displayed in my main app window, which is the client
> calling the OLE Server, I however cannot seem to find out what I must pass
> as a return value of the function in the OLE Server, so that I can do
> everything (query DB, and Build Treeview) in the server, while simply
> setting the result to the visible Treeview on the client.

> I ran into this problem with TQuery's, and was advised to use the
IProvider
> interface to do the comms. What can i do here ?

> Please help.

> Regards

> Robert Lofthouse
> robert.loftho...@spl.co.za

Re:Passing TTreeView as a param using OLE Automation Server


You can also create an ActiveX TreeView with Delphi and pass the associated
interface to the client. I think that will do

Re:Passing TTreeView as a param using OLE Automation Server


I don't think that the TTreeNodes and TTreeNode properties get exposed doing
this (I remember seeing quite a bit about this in the groups a long time
ago,
perhaps a search of the archives would help).

Ryan VanIderstine
Run-Time Systems

Quote
C.Ballester <c...@ctv.es> wrote in message

news:7lanjb$p7e10@forums.borland.com...
Quote
> You can also create an ActiveX TreeView with Delphi and pass the
associated
> interface to the client. I think that will do

Re:Passing TTreeView as a param using OLE Automation Server


Thanks guys,

Great of you to help, but it appears that I'm going to have to go with Ryans
original answer - my problem is that it's not only Treeviews that I'm
building according to the data, it's also popup menus, and listviews. But,
trust me, I'll not be giving this effort up, and I'll post my findings in
the future (if any)

Regards

Robert

Quote
Ryan VanIderstine <r...@run-time-systems.com> wrote in message

news:7lbkkp$q2s12@forums.borland.com...
Quote
>I don't think that the TTreeNodes and TTreeNode properties get exposed
doing
>this (I remember seeing quite a bit about this in the groups a long time
>ago,
>perhaps a search of the archives would help).

>Ryan VanIderstine
>Run-Time Systems

>C.Ballester <c...@ctv.es> wrote in message
>news:7lanjb$p7e10@forums.borland.com...
>> You can also create an ActiveX TreeView with Delphi and pass the
>associated
>> interface to the client. I think that will do

Re:Passing TTreeView as a param using OLE Automation Server


Take a look at the March 98 issue of Delphi Informant. There's an
article about passing VCL components from server to client there.
Source should be available at www.informant.com too. It's not true
distributed computing, but it may prove valuable to you.
--
Dan Miser
http://www.execpc.com/~dmiser
(TeamB cannot answer questions received via EMail)

Other Threads