Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: OleControl

$
0
0
Re: OleControl
FoxInCloud
Re: OleControl
06/20/2012
09:23:30 AM
3J40K4QRX Show this entire thread in new window
Gratar Image based on email address
From:
Thierry Nivelet (FoxInCloud)
To:
Attachments:
None
Here is the fixed code to be replaced in awPublic.prg
Thanks for your patience
PROCEDURE wAddObject && Ajoute un objet à un conteneur s'il n'y existe pas déjà LPARAMETERS ; toCont,; && Conteneur auquel il faut ajouter un objet tcObj,; && Nom de l'objet à ajouter tcClass,; && Classe de l'objet à ajouter t01,t02,t03,t04,t05,t06,t07,t08,t09,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20 && @ paramètres à passer à l'Init() de l'objet LOCAL lnParm, lcParm, loObj, llResult * Si le conteneur est valide llResult = loCont(m.toCont) ASSERT m.llResult MESSAGE cAssertMsg(Textmerge([<<Proper(Program())>> - ] + ICase(; cLangUser() = 'fr', [Le premier paramètre (<<cLitteral(m.toCont)>>) doit être une référence à un objet conteneur],; && copy-paste this line to add another language support [First parameter (<<cLitteral(m.toCont)>>) should be a container object reference]; ))) IF m.llResult * Si les paramètres sont corrects lnParm = Pcount() - 3 llResult = Between(m.lnParm, 0, 20) ASSERT m.llResult MESSAGE cAssertMsg(Textmerge([<<Proper(Program())>> - ] + ICase(; cLangUser() = 'fr', [Pas assez ou trop de paramètres],; && copy-paste this line to add another language support [Not enough or too many parameters]))) IF m.llResult lcParm = wcFormParms(m.lnParm) * Si l'objet existe déjà IF locObject(m.toCont, m.tcObj) * Si l'objet peut être initialisé loObj = Evaluate('m.toCont.' + m.tcObj) lcParm = Substr(m.lcParm, 2) && ôte la virgule initiale * ------------------------------ llResult = m.loObj.Init(&lcParm) * ------------------------------ llResult = Vartype(m.llResult) == 'L' AND m.llResult ASSERT m.llResult MESSAGE cAssertMsg(Textmerge([<<Proper(Program())>> - ] + ICase(; cLangUser() = 'fr', [Échec de l'initialisation de l'objet '<<m.tcObj>>' de classe '<<m.tcClass>>' ; parent: '<<m.toCont.Name>>'],; && copy-paste this line to add another language support [Could not initialise object '<<m.tcObj>>' of class '<<m.tcClass>>' in parent '<<m.toCont.Name>>']))) ELSE * Si l'objet peut être ajouté au parent IF Lower(m.tcClass) == 'olecontrol' lcParm = Strtran(m.lcParm, 't01', cLitteral(m.t01)) && VFP only accepts OLEclass as a litteral!! ENDIF * ------------------------------ llResult = m.toCont.AddObject(m.tcObj, m.tcClass &lcParm); AND locObject(m.toCont, m.tcObj) * ------------------------------ ASSERT m.llResult MESSAGE cAssertMsg(Textmerge([<<Proper(Program())>> - ] + ICase(; cLangUser() = 'fr', [Échec de l'ajout de l'objet '<<m.tcObj>>' de classe '<<m.tcClass>>' au parent '<<m.toCont.Name>>'],; && copy-paste this line to add another language support [Could not add object '<<m.tcObj>>' of class '<<m.tcClass>>' to parent '<<m.toCont.Name>>']))) loObj = Iif(m.llResult, Evaluate('m.toCont.' + m.tcObj), .NULL.) ENDIF ENDIF ENDIF IF m.llResult IF lProperty(m.toCont, 'wlContentDynamic') AND m.toCont.wlContentDynamic && Si wlContentDynamic, tout le HTML contenu est régénéré à chaque requête toCont.wlContentChanged = .T. ELSE llResult = NOT wlAJAX() OR AJAX.wAddObject(m.toCont, m.loObj) && AJAX : envoie l'ordre d'ajouter l'objet à la page HTML ENDIF ENDIF RETURN m.llResult


Here is the debug window.

Thanks.


wAddObject() just checks if objects already exists before calling .AddObject(); should not change the behavior that much ...

Could you be any chance SET STEP ON before this wAddObject() call and see what's going on?

thanks,


With wAddObject I get a "Insert control" prompt with a list of OLE controls to choose from.


<span style="{font-size: xx-small; color: red;}">Code parsing for language: "'vfp'" is not currently supported.<br></span>
wAddObject(this, "OLEcontrol1","olecontrol","OVCtl.OVCtl.1")

*-FIC- Replaced by FoxInCloud Adaptation Assistant version 1.25 (source mode) on 06/19/2012 09:00:42 AM
*-FIC- this.AddObject("OLEcontrol1","olecontrol","OVCtl.OVCtl.1")




Thierry Nivelet (FoxInCloud)


Viewing all articles
Browse latest Browse all 10393

Trending Articles