[Qt-interest] Problem using QWidget::winEvent
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Tue Jun 16 08:23:53 CEST 2009
Ok.. so have you figured out what the problem is yet?
Its right in front of you...
Here is a hint.. look at the memory address of param1 and param2 going
into the SendMessage
Then look at the memory address inside winEvent..
Are the addresses the same? If no why?
Are they pointing to the same data? If no why?
Heck.. Im feeling generous.. and bored.. your problem, your apps don't
share memory space.. You cant do what you are trying to do... You need
to look at more sophisticated IPC methodologies.
Scott
From: anjani gupta [mailto:anjanigupta_dce at yahoo.com]
Sent: Monday, June 15, 2009 10:43 PM
To: QtInterest; Scott Aron Bloom
Subject: Re: [Qt-interest] Problem using QWidget::winEvent
Hi Scott,
bool QMainWindow::winEvent ( MSG * msg, long * result )
{
if(msg->message == WM_USER)
{
char* param1 = (char*)(msg->wParam);
char* param2 = (char*)(msg->lParam);
//Process message
}
...
}
I tried using SendMessage( ), now also 'param1' and 'param2' show
garbage values when msg->lParam and msg->wParam are type casted to
char*.
Actually, msg->lParam and msg->wParam contain some numerical values
which when type casted to char* give garbage characters.
Thanks a lot for your time!
Regards,
Anjani
--- On Mon, 6/15/09, Scott Aron Bloom <Scott.Bloom at sabgroup.com> wrote:
From: Scott Aron Bloom <Scott.Bloom at sabgroup.com>
Subject: Re: [Qt-interest] Problem using QWidget::winEvent
To: "QtInterest" <qt-interest at trolltech.com>
Date: Monday, June 15, 2009, 5:37 PM
I would look into the fact that PostMessage returns immediately, try
SendMessage
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of anjani gupta
Sent: Monday, June 15, 2009 4:02 AM
To: QtInterest
Subject: [Qt-interest] Problem using QWidget::winEvent
Hi All,
I have a Windows application that sends message to already running Qt
application like this:
{
char* file_path;
//Assign some value to file path.
PostMessage( hwnd, WM_USER, (WPARAM)(file_path), (LPARAM)(file_path)
);
}
This message is handled by Qt application by overriding 'winEvent'
method as below:
bool QMainWindow::winEvent ( MSG * msg, long * result )
{
if(msg->message == WM_USER)
{
char* param1 = (char*)(msg->wParam);
char* param2 = (char*)(msg->lParam);
//Process message
}
return false;
}
Here issue is that 'param1' and 'param2' are not populated with values
passed in WPARAM and LPARAM of 'PostMessage( )'. I am using Qt-4.4.3 on
Windows.
I think I am missing something here. Please help me out in this.
Thanks in advance!
Regards,
Anjani
-----Inline Attachment Follows-----
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
<http://lists.trolltech.com/mailman/listinfo/qt-interest>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090615/dd6de3c9/attachment.html
More information about the Qt-interest-old
mailing list