Talwyn,

I am not sure if this will help any and I haven't had much luck in understanding the Win32:GUI docs on the matter either, but in the absence of any other reply it might help.

In the underlying api's communication between the dialog proc and the calling program is through so-called "window words". When the Dialog is created a number of "extra" window words (32-bit values if I remember correctly) are requested. Inside the dialog procedure, these values can be modified. Once the call to ShowDlg() or its variants return, the main window proc can then access these window words to retrieve the "answers" from the dialog. Often, a single 'extra' 32-bit word is requested, and a pointer to a data structure allocated in the main proc is placed in there before calling. The dialog proc reteives the pointer, fills in the values accordingly. Once the ShowDlg returns, the main proc can use the pointer to retreive the information.

How faithful the Win32::GUI is to the method of working I can only speculate, but the description (which shouldn't be relied upon for accuracy. Its been a while!) may help you understand the docs and what is going on.

Good luck.

Update:After I submitted, I went to check something and came across this which you have probably seen and isn't very helpful as it refers you to the 'underlying API docs', but the Get/SetWindowLong() calls are the ones you need. You'll see from the calls you can have multiple, indexed WindowLongs. It also strikes me that if your main window proc and the dialog proc (or its controls callbacks) are in the same file, the Perlish way maybe to simply use package globals for this.


In reply to Re: win32::Gui -- Paradigm problem...How do you get info back from a dialog? by BrowserUk
in thread win32::Gui -- Paradigm problem...How do you get info back from a dialog? by talwyn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.