What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Cannot CreateChildWnd

Pages: (2): « First [ 1 ] 2 » Last »
Cannot CreateChildWnd
Author: Message:
mathieumg
Full Member
***


Posts: 181
Reputation: 2
35 / Male / Flag
Joined: May 2004
O.P. Cannot CreateChildWnd
I would like to know why this works:

code:
var WndManageFiles = null;
var WndAddFile = null;

WndManageFiles = MsgPlus.CreateWnd("GUI.xml", "WndManageFiles");
WndAddFile = MsgPlus.CreateWnd("GUI.xml", "WndAddFile");


whereas, this does not:

code:
var WndManageFiles = null;
var WndAddFile = null;

WndManageFiles = MsgPlus.CreateWnd("GUI.xml", "WndManageFiles");
WndAddFile = MsgPlus.CreateChildWnd("WndManageFiles", "GUI.xml", "WndAddFile", 100, 40, true);


Debugging console:

Error : Type mismatch.
Line : 22. Code : -2146828275.

Is there something that must be done differently in the .xml file?

Thank you in advance!

This post was edited on 06-26-2006 at 12:30 AM by mathieumg.
Official MessengerPlus! Live French Translator
Official StuffPlug 3 French Translator

:)
06-25-2006 11:36 PM
Profile E-Mail PM Web Find Quote Report
mickael9
Full Member
***


Posts: 117
Reputation: 3
33 / Male / Flag
Joined: Jul 2005
RE: Cannot CreateChildWnd
code:
var WndManageFiles = null;
var WndAddFile = null;

WndManageFiles = MsgPlus.CreateWnd("GUI.xml", "WndManageFiles");
WndAddFile = MsgPlus.CreateChildWnd(WndManageFiles, "GUI.xml", "WndAddFile", 100, 40, true);
:D

This post was edited on 06-26-2006 at 12:55 AM by mickael9.
06-26-2006 12:54 AM
Profile PM Web Find Quote Report
mathieumg
Full Member
***


Posts: 181
Reputation: 2
35 / Male / Flag
Joined: May 2004
O.P. RE: Cannot CreateChildWnd
No error, but no window... :s
Official MessengerPlus! Live French Translator
Official StuffPlug 3 French Translator

:)
06-26-2006 01:05 AM
Profile E-Mail PM Web Find Quote Report
mickael9
Full Member
***


Posts: 117
Reputation: 3
33 / Male / Flag
Joined: Jul 2005
RE: Cannot CreateChildWnd
Can you paste the xml file ?
06-26-2006 01:17 AM
Profile PM Web Find Quote Report
mathieumg
Full Member
***


Posts: 181
Reputation: 2
35 / Male / Flag
Joined: May 2004
O.P. RE: Cannot CreateChildWnd
Did the test with that sample window, same behaviour:

code:
    <Window Id="WndTest" Version="1">
        <Attributes>
            <Caption>Example</Caption>
        </Attributes>
       
        <TitleBar>
            <Title>
                <Text>Example</Text>
            </Title>
        </TitleBar>
       
        <Position Width="180" Height="75"/>
        <DialogTmpl/>
    </Window>

Official MessengerPlus! Live French Translator
Official StuffPlug 3 French Translator

:)
06-26-2006 01:25 AM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Cannot CreateChildWnd
code:
    function LoadChildWindows(Wnd){
    /*
        Load Child Windows
    */
        WndGeneral = MsgPlus.CreateChildWnd(Wnd, "ss4_gui.xml", "WndGeneral", 153, 40, true);
            /*                Set option values                */
            with (WndGeneral){
                Combo_AddItem('cboFileType', 'BMP', 1);
                Combo_AddItem('cboFileType', 'GIF', 2);
                Combo_AddItem('cboFileType', 'JPG', 3);
                Combo_AddItem('cboFileType', 'PNG', 4);
                SetControlText('txtFilename', strFileName);
                Combo_SetCurSel('cboFileType', lngFileType-1);
                SetControlText('txtTimeDelay', lngTimeDelay);
                Button_SetCheckState('chkPreviewSave', blnPreviewSave);
                Button_SetCheckState('chkPreviewSend', blnPreviewSend);
                Button_SetCheckState('chkCopyImage', blnCopyToClipboard);
                Button_SetCheckState('chkShowSaveConfirm', blnShowSaveConfirmation);
                Button_SetCheckState('chkDeleteScreenshots', blnDeleteSessionImages);
                Button_SetCheckState('chkTimeDelay', blnWarnTimeDelay);
                Button_SetCheckState('txtWarnTimeDelay', lngWarnTimeDelay);
                SetControlText('txtSaveDirectory', strSaveDirectory);
            }
       
        WndAreas = MsgPlus.CreateChildWnd(Wnd, "ss4_gui.xml", "WndAreas", 153, 40, false);
        WndOverlay = MsgPlus.CreateChildWnd(Wnd, "ss4_gui.xml", "WndOverlay", 153, 40, false);
        WndCountdown = MsgPlus.CreateChildWnd(Wnd, "ss4_gui.xml", "WndCountdown", 153, 40, false);
        WndWebcam = MsgPlus.CreateChildWnd(Wnd, "ss4_gui.xml", "WndWebcam", 153, 40, false);
        WndAdvanced = MsgPlus.CreateChildWnd(Wnd, "ss4_gui.xml", "WndAdvanced", 153, 40, false);
            /*                Set option values                */
            with (WndAdvanced){
                SetControlText('txtServer', ftpServer);
                SetControlText('txtLogin', ftpLogin);
                SetControlText('txtPassword', ftpPassword);
                SetControlText('txtPort', ftpPort);
                SetControlText('txtDirectory', ftpPath);
            }
       
        WndFTPUpload = MsgPlus.CreateChildWnd(Wnd, "ss4_gui.xml", "WndFTPUpload", 153, 40, false);
            /*                Set option values                */
            with (WndAdvanced){
                Button_SetCheckState('chkStripPlusCodes', blnStripPlusCodes);
                Button_SetCheckState('chkOriginalWinFocus', blnOriginalWinFocus);
                Button_SetCheckState('chkHideUsers', blnHideUsers);
                Button_SetCheckState('chkAltSending', blnDefaultSendCommand);
                Interop.Call('user32', 'EnableWindow', GetControlHandle('txtAltSending'), blnDefaultSendCommand);
            }
        WndCurrentWnd = WndGeneral;
   
    /*
        Click Default General Button
    */
        Wnd.SendControlMessage('RadGeneral', 256 , 32, 0);
        Wnd.SendControlMessage('RadGeneral', 257 , 32, 0);
       
        WndGeneral.Visible = true;
       
        return Wnd;
    }

    function OnEvent_MenuClicked(sMenuId, nLocation, ChatWnd){
        if(sMenuId == "preferences"){
            if (WndPref){
                Interop.Call('user32', 'SetForegroundWindow', WndPref.Handle);
            }else{
                WndPref = LoadChildWindows(MsgPlus.CreateWnd("ss4_gui.xml", "WndPref"));
            }
       
        }

    }

As well ChildWnd XML should look like this

code:
    <Window Id="WndOverlay" Version="1">
        <ChildTmpl/>
        <Position Width="243" Height="193"/>
        <Controls>
            <Control xsi:type="StaticControl" Id="lblVersion3">
                <Position Top="5" Width="100" Left="5" Height="15" />
                <Caption>Overlay Text</Caption>
                <Color><GlobalColor>green</GlobalColor></Color>
                <Font><Bold>true</Bold><Size>12</Size></Font>
            </Control>
            <Control xsi:type="StaticControl" Id="lblTitle">
                <Position Top="25" Width="100" Left="15" Height="15" />
                <Caption>To be later incorporated</Caption>
            </Control>
        </Controls>
    </Window>

Thats what I use for SS4

This post was edited on 06-26-2006 at 01:26 AM by matty.
06-26-2006 01:25 AM
Profile E-Mail PM Find Quote Report
mickael9
Full Member
***


Posts: 117
Reputation: 3
33 / Male / Flag
Joined: Jul 2005
RE: Cannot CreateChildWnd
code:
    <Window Id="WndTest" Version="1">
        <Attributes>
            <Caption>Example</Caption>
        </Attributes>
       
        <TitleBar>
            <Title>
                <Text>Example</Text>
            </Title>
        </TitleBar>
       
        <Position Width="180" Height="75"/>
        <DialogTmpl/>
    </Window>


code:
var WndManageFiles = null;
var WndAddFile = null;

WndManageFiles = MsgPlus.CreateWnd("GUI.xml", "WndManageFiles");
WndAddFile = MsgPlus.CreateChildWnd(WndManageFiles, "GUI.xml", "WndAddFile", 100, 40, true);

This post was edited on 06-26-2006 at 01:30 AM by mickael9.
06-26-2006 01:29 AM
Profile PM Web Find Quote Report
mathieumg
Full Member
***


Posts: 181
Reputation: 2
35 / Male / Flag
Joined: May 2004
O.P. RE: Cannot CreateChildWnd
Sorry, I had modified the line in my script but not here, I did that simple WndTest as a proof of concept.
Official MessengerPlus! Live French Translator
Official StuffPlug 3 French Translator

:)
06-26-2006 01:30 AM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Cannot CreateChildWnd
Post the script contents and the xml contents and let me see what your doing.
06-26-2006 01:32 AM
Profile E-Mail PM Find Quote Report
mickael9
Full Member
***


Posts: 117
Reputation: 3
33 / Male / Flag
Joined: Jul 2005
RE: Cannot CreateChildWnd
Messenger Plus ! Live Documentation :
quote:
WindowId
[string] Unique identifier of the window to create. A window with the same identifier has to be found in the XML file for the function to succeed.
06-26-2006 01:34 AM
Profile PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On