473,575 Members | 3,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange error returned by 'PostThreadMess age'...

Hi

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)
Sleep(0)

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

Thanks
Nadav
Nov 17 '05 #1
1 1709
"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.

Regards,
Will
Nov 17 '05 #2

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

Similar topics

1
2525
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 )
5
16237
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...
6
2102
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' )
6
8991
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. ...
7
4994
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,...
0
880
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...
11
11251
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"....
4
2611
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...
2
2623
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...
0
7845
marktang
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...
0
7775
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8120
Oralloy
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. ...
0
8143
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6515
agi2029
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...
0
3778
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...
0
3797
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2286
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1107
bsmnconsultancy
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...

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.