Help on ActiveX properties ... PLEASE !! 8°)) 
Author Message
 Help on ActiveX properties ... PLEASE !! 8°))

Hi,
I've got a problem to solve with ActiveX developpement and I think you
could help me. Here's the topic:

I'm developping an ActiveX control as a sort of interface to provide datas
to
an HTML page (Client side only, so no ASP).
What i've done since now is "publishing" basic properties, methods and
events from my ActiveX component. It works perfectly and it's really easy
to do with Visual C++ 5 (add event, add property, add method!).
The problem is that I can only give access to properties wich have simple
types, as an "int" for example.
What I want to do is to write a property, or a method that returns complex
types, like a C structure or so. Publishing a class instance could do
the job too.
I know that this is possible, because for example with the "ListView"
control
from Microsoft, there's a method that gives you the ColumnHeader, wich
is an object with properties and methods you can access in your scripts.
But HOW to implement this mecanism ?
Basically, so, what I want to do, with an ActiveX instance called for
example
"MyOCX" is work in my script like this:

alert(MyOCX.aProperty); // I've done this, this work
MyOCX.aMethod(); // this lauch the method called aMethod, no problem

//then what I don't know how to do
X=MyOCX.aProperty;
alert(X.anXProperty);
X.anXMethod();

See what I mean ?
If you can help, tnx a lot !
CU 8)

ps : Im pretty sure that type libraries are involved in this problem. Here
s what I tried, I think Im not to far : I did an ATL project to generate a
.dll type library. Then I did an ActiveX control (.ocx). I imported the Type
library with class wizard in this ActiveX Control. As a result, I got an
 IMyClass ? that match the ATL object I created in the type library. Then,
the problem is how to link an instance of this class to a property that my
control shares or how to make a method that my control shares return an
instance of this class, so that this object can be used in my JavaScript
code ?
The IMyClass as got 3 constructors :
 IMyClass() {}  // Calls COleDispatchDriver default constructor
 IMyClass(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
 IMyClass(const IMireTelCom& dispatchSrc) : COleDispatchDriver(dispatchSrc)
{}
Wich one must I use ?
The property that my control can share (according to the wizard) are only of
simple types, but can be of the LPDISPATCH type. So I made my control share
a LPDISPATCH property (visible from IE4), and used the second constructor
with the internal property as a parameter. I though that it would enable IE4
to work directly, through the LPDISPATCJ interface, with the IMyClass
instance created by the control.
Not really, this crashes !
I think im not far of the solution, but I can find any good explanation on
the net... So thanks again to help me 8))

--
                     \ \_/ /
                      ( , , )
- - - - - oOOo - (_) - oOOo - - - - - - - - - -
|       Guillaume APOSTOLY  |


|                                                       |
|   visit the Quake II secrets at:                |
|www.geocities.com/TimesSquare/Arena/5538/Quake2Secrets.htm
-------------------------------------------------



Mon, 01 Jan 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

2. ActiveX Control Property Help Please!

3. ActiveX Control Property Help Please!

4. ActiveX Control Property Help Please!

5. Invalid use of property please, please, please help!!!

6. List Property in Property Pane (PLEASE HELP!)

7. Can anyone HELP me PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE

8. Please, Please help with OwnerInfo ActiveX Control

9. PLEASE HELP PLEASE HELP PLEASE HELP

10. Please help: Supplying context sensitive help within ActiveX controls

11. REQ : How to create an activex (VB5) with property like mycontrol.array(x).properties

12. Help: ActiveX control does no store properties?

 

 
Powered by phpBB® Forum Software