Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OCX and object property
Message
De
02/04/1998 05:34:39
 
 
À
02/04/1998 02:56:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00088535
Message ID:
00088889
Vues:
36
>>>>I work on a list ocx control for VFP (too). I have no problem with it, except the OLE public properties. I can make simple type properties (like short, bool, string) and these works fine even with VFP :) But I have no idea how to implement object properties. I use VC++4.2 and I didnot find any documenation about it.
>>>
>>>Use the project wizard to generate an OCX project. After that, use the wizard to add properties/methods. Don't even think about writing the ocx from start to end by hand. There's a lot to be known in order to do it properly and it's almost useless to do it this way (because the wizard is pretty good).
>>>
>>>>(Except aggregate objects, but in this case the aggregate object is an OLE object and thus has to be registered. )
>>>
>>>I'm not sure what you want to say here, but if it's ocx, than it's ole anyway.
>>>
>>>BTW, don't use SHORT for properties, method returns or parameters. There are problems with this type from VFP.
>>>
>>>Vlad
>>Hello Vlad!
>>
>>I use Class Wizzard to make the OCX and it works fine. I made a listbox ocx.
>>I have o problem with VFP, abd also I have no problem to make commen type properties with Class Wizzard. (e.g. I mean I can make an OLE public ItemNumbers property, and I can set it in VFP and in my OCX.) But I want to make a property that is an object. E.g. I want to make an font property which is an object and thus, it has a name, bold, size etc. properties. And here comes the problem. In class wizzard, to make an integer or BOOL type OLE public property it is no doubt which type to choose for the property. But if I have an object property, which type should I use. LPUnknow or LPDispatch or ...?
>>I have not found doc. about to make an object property.
>>
>>BB
>
>The ClassWizard can add for you Stock properties like Font and all you need is to implement the OnFontChanged event in your VCX to create a new CFont and redraw your OCX. You can acces the Font property of the OCX from VFP with the Object property of your OLEControl (e.g. lbItems.Object.Font.Size=11, supose lbItems is your listbox OCX).
>If the object property you wanna add is not a stock object you must create a interface with its properties and methods and make it a IDispatch or IUnknown property of your OCX.
>
>Best regards,
>Remus

Hello Remus!

Thank you for your answer. It is very valuable. Where did you find the info, that the properties of a stock font property can accessed by its object property?
I read an article about LUnknown, so I understand the interface concept. But I dont know what IDispatch does.

BB
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform