Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inconsistent OLEControl / ActiveX Method Return Type

Status
Not open for further replies.

KindaLikeVFP

Programmer
Jun 5, 2000
2
US
This forum comes highly reccomended by Robert Bradley / FoxDev - A frequent poster here - who was formerly (until yesterday - sniff) my colleague.<br><br>So now that he is dearly departed to Atlanta and no longer avilable for witty banter and techincal support (sniff, sniff) I must rely on the kindness of the well-reported posters here.&nbsp;&nbsp;<br><br>Enough already, on to my problem:<br><br>(Sorry in advance if I don't state this problem clearly at first.)<br><br>When calling a method of an ActiveX control (wrapped in an olecontrol) as a relative reference from the command box ( i.e. ? form1.control1.methodname() ) it returns the proper type (numeric / 0 (Zero) to be exact), but returns the empty string when the same method is called within code of a containing custom descended class (about 3 containers deep: Custom-&gt;Form-&gt;OLEControl-&gt;ActiveX).&nbsp;&nbsp;<br><br>This happens with all calls of a similar nature. I have 3 non-visual activex controls from the same source (all closely related in function as well) on this form.<br><br>As I understand vfp, it should always return a numeric (the ActiveX control's documented behavior) no matter the context.<br><br>Any ideas of what could be going on vfp wise?
 
<b>You</b> must be doing something wrong, you Delphi-head.<br><br>Its a puzzler, sure enough.&nbsp;&nbsp;It sounds like you're saying that oCustom instantiates, or otherwise has a reference, to oForm (oCustom can't, strictly speaking, <i>contain</i> oForm, since Custom-based objects are not containers); oForm contains oOLE; and oOLE contains the non-VFP ActiveX control.<br><br>It further sounds like if cmdButton on oForm calls oOLE.Control.Method(), it works fine (returns 0), but if you call it like oCustom.oForm.Control.Method(), it returns the empty string.<br><br>Am I correct so far? <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>
 
Howdy FoxDev er Omar, uh I mean Bob!<br><br>Miss Texas yet?! &lt;g&gt;<br><br>&quot;(oCustom can't, strictly speaking, contain oForm, since Custom-based objects are not containers); &quot;<br><br>Welllll strictly speaking oCustom *is* a container, but oForm cannot be contained bu oCustom.&nbsp;&nbsp;You're right, it is a reference.<br><br>&quot;It further sounds like if cmdButton on oForm calls oOLE.Control.Method(), it works fine (returns 0), but if you call it like oCustom.oForm.Control.Method(), it returns the empty string.&quot;<br><br>Close enough, I'm actually calling the method from the command box so I get the return value echoed to the screen.&nbsp;&nbsp;So it's actually a level deeper.&nbsp;&nbsp;If that really matters.<br><br>So now that we've established this,&nbsp;&nbsp;whadaya think is up?<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top