Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Can I use user-defined messages to communicate between modeless dialog

telstels Member Posts: 3
I'd like to update database table information in several
modeless dialog boxes when one edit box in one modeless
dialog box changed. Do we have an efficient way to do this?

Thanks in advance!

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : I'd like to update database table information in several
    : modeless dialog boxes when one edit box in one modeless
    : dialog box changed. Do we have an efficient way to do this?
    :
    : Thanks in advance!
    :
    [blue]If all these modeless boxes are in the same process, just do some interface work - example: let your application know about all these dialogs, so you can communicate anything. When you create a modeless dialog you get back HWND of that dialog. Define your own messages with WM_USER+xxx or WM_APP+xxx and then just send the information across. Better way is to attach the data structures (C++ object pointers) to the HWND using 'SetWindowLong()'. Then you do not need to send any messages. Just call 'GetWindowLong()' to get a pointer back and move the data across dialogs.

    To communicate between processes use WM_COPYDATA.[/blue]
  • telstels Member Posts: 3
    : : I'd like to update database table information in several
    : : modeless dialog boxes when one edit box in one modeless
    : : dialog box changed. Do we have an efficient way to do this?
    : :
    : : Thanks in advance!
    : :
    : [blue]If all these modeless boxes are in the same process, just do some interface work - example: let your application know about all these dialogs, so you can communicate anything. When you create a modeless dialog you get back HWND of that dialog. Define your own messages with WM_USER+xxx or WM_APP+xxx and then just send the information across. Better way is to attach the data structures (C++ object pointers) to the HWND using 'SetWindowLong()'. Then you do not need to send any messages. Just call 'GetWindowLong()' to get a pointer back and move the data across dialogs.
    :
    : To communicate between processes use WM_COPYDATA.[/blue]
    :


    Thanks.
    I'd like to update all related control items in other modeless
    dialoges box when one data changed in a modeless dialog box!
    It seems those WM_USER_*** messges can not be catched at all.
    Would you mind tell me the reason?
    Thanks again.


  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : : : I'd like to update database table information in several
    : : : modeless dialog boxes when one edit box in one modeless
    : : : dialog box changed. Do we have an efficient way to do this?
    : : :
    : : : Thanks in advance!
    : : :
    : : [blue]If all these modeless boxes are in the same process, just do some interface work - example: let your application know about all these dialogs, so you can communicate anything. When you create a modeless dialog you get back HWND of that dialog. Define your own messages with WM_USER+xxx or WM_APP+xxx and then just send the information across. Better way is to attach the data structures (C++ object pointers) to the HWND using 'SetWindowLong()'. Then you do not need to send any messages. Just call 'GetWindowLong()' to get a pointer back and move the data across dialogs.
    : :
    : : To communicate between processes use WM_COPYDATA.[/blue]
    : :
    :
    :
    : Thanks.
    : I'd like to update all related control items in other modeless
    : dialoges box when one data changed in a modeless dialog box!
    : It seems those WM_USER_*** messges can not be catched at all.
    : Would you mind tell me the reason?
    : Thanks again.
    :
    :
    :
    [blue]Try using 'RegisterWindowMessage()' -> MSDN. It appears that WM_USER has some restrictions... my bad - did not research MSDN before posting...[/blue]
  • Shawn CarterShawn Carter Member Posts: 0

    _________ // http://forcoder.org // free ebooks and video tutorials about / MATLAB Scratch C++ Delphi Visual Basic Objective-C Java Python Swift C PL/SQL Ruby Go PHP R JavaScript C# Visual Basic .NET Perl Assembly SAS Awk Alice VBScript D Bash Rust Clojure Lua Fortran Hack ABAP Julia Scheme Crystal Dart Logo Prolog Erlang Scala COBOL Ada FoxPro LabVIEW Kotlin Lisp Apex Transact-SQL F# ML / _____

Sign In or Register to comment.