473,701 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange error returned by 'PostThreadMess age'...


I have encountered a strange problem: while using PostThreadMessa ge to communicate between threads of different processes, PostThreadMessa ge returns "The message can be used only with synchronous operations" (1159), I didn't find any documentation discussing this error in details, does anyone has a clue??? What am I doing wrong here? Why should PostThreadMessa ge return this kind of error

Following is the code used to post the message
int iSendCnt = 10
while(--iSendCnt > 0 && 0 == PostThreadMessa ge(dwDebuggerMs gThreadID, 1, 2300, 0)

NOTE that the thread referred to by 'dwDebuggerMsgT hreadID' has a
message pump: while(0 != GetMessage(&msg , NULL, 0, 0)) { ........ }

Nov 17 '05 #1
1 1720
"Nadav" <an*******@disc ussions.microso ft.com> wrote in message
news:68******** *************** ***********@mic rosoft.com...
I have encountered a strange problem: while using
PostThreadMessa ge to communicate between
threads of different processes, PostThreadMessa ge
returns "The message can be used only with synchronous
operations" (1159), I didn't find any documentation discussing
this error in details, does anyone has a clue???

Well, the error text reads "this message". You are posting message #1,
WM_CREATE. Why the heck is that? :-)

Seriously, Windows itself sends (it does not post) WM_CREATE messages in
response to CreateWindow[Ex](). Now I have never tried to post a WM_CREATE
so I can't be sure but my guess is that Windows is doing some sanity checks.

You should use WM_USER, WM_APP or a registered message for private
communication if windows are involved or some other IPC technique if they
are not.

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: a_bogdan_marinescu | last post by:
Hello all, I'm trying to do some COM automation from Python (using Mark Hammond's Win32 extensions, of course) and I'm getting some very strange errors. Specifically, I try to use a COM object that supports events, and I'm instantiating it like this: eventobj = win32com.client.DispatchWithEvents( crtthread, DebuggerThreadEvents )
by: Tony Wright | last post by:
Hi, I am having a problem installing an msi for a web site. The error message I am getting is: "The specified path 'http://mipdev05/features/Fas2' is unavailable. The Internet Information Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet Services Manager."
by: Rick | last post by:
Hi, Sorry, I couldn't find a better title for this post. Anyway, I got a piece of C code which only works well if I put a fprintf in it. Here's the code : unsigned int8 Port_getPortNum( char *port ) { fprintf(DB9, "port = %s\r\n", port ); // Don't know why but I need this fprintf?! if ( port == 'A' )
by: | last post by:
Please, help. Is there a PostThreadMessage equiavalent functionality in .NET framework? I have messages coming from a COM server and they are being delivered in different threads. I would like to receive these messages in one thread, thus synchronize them. I don't want to use form's Invoke method, but something similar, thread-related. Thanks for any suggestions.
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version, which I did, then reran WebSetup.msi and keeps giving me this error. "The installer was interrupted...
by: EMW | last post by:
I am busy with a program for my pocket pc. but since it is still compact famework, I'll post this here too, because I'm very much in need for some help with this: I have one form which is my main form and has 4 option buttons and two regular buttons, one for saving and the other for canceling the program. When the user select an option button, a new form is opened and he can fill
by: Gregor KovaĨ | last post by:
Hi! I have a procedure that is compiled in the database and I can also recompile it without any problems, but when I call it I get this strange error: SQL0727N An error occurred during implicit system action type "1". Information returned for the error includes SQLCODE "-206", SQLSTATE "42703" and message tokens "ARTI_ID". SQLSTATE=56098 As I read the manuals I know that SQLCODE 206 means that ARTI_ID is not
by: David | last post by:
I'm using the AxSHDocVw.WebBrowser control to download data from a webpage at work (it's an internal page on my company's intranet). The page produces a runtime error after a while and the strange thing is that until the page is refreshed with Internet Explorer, the error keeps occurring. I realize no one can debug an application that I can't even provide details about (I didn't write nor do I have access to it) but what difference...
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to update the information which is stored in a SQL database. In testing we noticed that the form was updating correctly but the update mechanism was also updating the first record of the table in the sql database every time. No error messages are on...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.