15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Property Value retrieval in OCX

SBERTRAN.US.ORACLE.COM -- SBERTRAN@us.oracle.com
Wednesday, September 25, 1996

Environment: VC++ 2.0, Windows 95 
 
I am developing a common dialog OCX that contains properties, events, and 
methods.  I have a CDialog implementation for each common dialog in its own 
file.  The look and feel of these dialogs can be modified by changing the 
values of certain properties, but I cannot figure out how to retrieve and set 
the values of my properties from outside the COleControl class implementation. 
 
If you've been there before, please let me know at the below e-mail address.  
Many thanks in advance, 
 
Shawn Bertrand, Developer 
Oracle Corporation-OLAP Products Division 
Fifth Floor, SouthWest Corner 
200 Fifth Avenue    |  mail:  sbertran@us.oracle.com 
Waltham, MA  02154  |  phone: (617) 768-5600 x7809 
 
"If you drink, don't drive.  Don't even putt."  - Dean Martin



SBERTRAN.US.ORACLE.COM -- SBERTRAN@us.oracle.com
Friday, September 27, 1996

I hate to answer my own question, but I figured it out.  Many thanks to Tom 
Armstrong, I retrieved the following from the OLE Control FAQ at 
http://www.sky.net/~toma/faqprop.htm#DDP (note the disclaimer at the end of 
this message, retrieved from the site): 
 
"You can also get a pointer to your COleControl derived class by using the 
FromIDispatch method of CCmdTarget like this:  
 
   // Get the property page's IDispatch array 
   ULONG ulObjects; 
   LPDISPATCH* lpObjectArray = GetObjectArray( &ulObjects ); 
   ASSERT( lpObjectArray != NULL ); 
 
   // I'm assuming there is but one control, mine 
   LPDISPATCH lpControl = lpObjectArray[0]; 
 
  // Get a pointer to the control object 
   CMyCtrl* pControl = (CMyCtrl*) CCmdTarget::FromIDispatch( lpControl ); 
 
   // Call a public method in CMyCtrl 
   long x = pControl->SomeMethod( 100 ); 
 
 
 
Typical Disclaimer: This FAQ is copyright (c) 1996 by Tom Armstrong 
(toma@sky.net). You have the right to copy and distribute this file in any way 
you see fit as long as this paragraph is included with the distribution. No 
warranties or claims are made as to the validity of the information contained 
herein. So use it at your own risk..." 
 
 
Shawn Bertrand, Developer 
Oracle Corporation-OLAP Products Division 
Fifth Floor, SouthWest Corner 
200 Fifth Avenue    |  mail:  sbertran@us.oracle.com 
Waltham, MA  02154  |  phone: (617) 768-5600 x7809 
 
"If you drink, don't drive.  Don't even putt."  - Dean Martin





| Вернуться в корень Архива |