Passing Classes thru OLE... Possible? 
Author Message
 Passing Classes thru OLE... Possible?

I've recently read how to use OLE. Well, it seems that private
types of data are all byte() data and it IS documented not
to pass anything else (for example, my own classes).

The thing is: It would be very useful to "drag" a class from
a user control and "drop" that class into another user control.

For example, if my case I am building a sound app, ant it would be
useful to have a tree for exploring the sounds and a list with the
props of a sound being dropped into it.

They way I may implemnt it is:

To have a global var such as "Global DraggedSound as CSound"
and set a reference to the sound I wish to "send" into the global
reference instead of passing the data within the DataObject, and
use this reference instead of the data in the dataobject. I would
also send "somenthing" dummy into the dataobject to raise
the events in the proper order.

The thing is... Is this correct? I mean, for example it will not
work into a cross-application environment, and perhaps there is
a better solution than this dirty trick.

Any suggestions are welcome.

--
Xavier Montero - Digital Sound Items, scp
Tel: 93 589 71 91 - Fax: 93 590 10 96 - Cell: 630 59 01 62



Sat, 31 Jan 2004 20:33:25 GMT  
 Passing Classes thru OLE... Possible?
Xavier,

Aside from using an object to wrap up the drag-n-drop functionality
instead of a global variable, I did the exact same thing you did.
If you'd like a more 'proper' way of doing it, you need to use the
functions along the lines of RegisterClipboardType (or something
similar) and create your own clipboard datatype and then use that
with the dataobject.  Unless cross-application is important to you
I wouldn't bother.

Tom

Quote:

> I've recently read how to use OLE. Well, it seems that private
> types of data are all byte() data and it IS documented not
> to pass anything else (for example, my own classes).

> The thing is: It would be very useful to "drag" a class from
> a user control and "drop" that class into another user control.

> For example, if my case I am building a sound app, ant it would be
> useful to have a tree for exploring the sounds and a list with the
> props of a sound being dropped into it.

> They way I may implemnt it is:

> To have a global var such as "Global DraggedSound as CSound"
> and set a reference to the sound I wish to "send" into the global
> reference instead of passing the data within the DataObject, and
> use this reference instead of the data in the dataobject. I would
> also send "somenthing" dummy into the dataobject to raise
> the events in the proper order.

> The thing is... Is this correct? I mean, for example it will not
> work into a cross-application environment, and perhaps there is
> a better solution than this dirty trick.

> Any suggestions are welcome.



Sun, 01 Feb 2004 04:53:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing class events thru collection??

2. Is it possible to pass class types as arguments to a function

3. Passing a class to an OLE automation server

4. passing UDT to a class member in an ole server

5. Basic OLE Help - What is possible and can OLE do this

6. Pass Class reference of unkown class

7. Possible to Import Custom Toolbar thru Code?

8. Pass integer Value from forms Class mod to report class mod

9. Passing Classes to other classes (using user defined types)

10. Is is possible to earn thru internet?

11. Is it Possible to rename a Table thru Visual Basic 5.0

12. VB uses Lotus Notes object thru OLE

 

 
Powered by phpBB® Forum Software