Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling API asynchronously?

Status
Not open for further replies.

jsteph

Technical User
Oct 24, 2002
2,562
0
0
US
Hi,
I'm call SendMessage, sending info from one vb app to a textbox in another. I'm trying to act on this in the Change event of the target textbox, but I'm getting the error "An outgoing call cannot be made since the application is dispatching an input-synchronous call"

I'm assuming that the Target's processing of the SendMessage that it recieved--which triggers the textbox's Change event--must complete before I can make another call to some other ActiveX control. In the Change event, I'm calling another activex--not the one that sent the SendMEssage. So...is there a way to make the SendMessage call asynchronous? Thanks,
--Jsteph
 
strongm,
Thanks, I had already looked at that, but it seems that the last argument wont accept a string. The declare for the SendMessage has Any as the type for that last arg, but PostMessage had Long. I tried to change the declare to Any and to String, but couldn't get it to pass a string.

This brings another question: When an api declare has a long-pointer to string as an argument, how do I pass a vb string to this? I've tried bizzare convolusions of using the AddressOf operator to point to a function that returns a string, but I'm just not sure how I can get VB to pass a string pointer to deal with this type of argument. Tnanks for any more insight on this,
--jsteph
 
You can't pass strings as parameters to windows that don't belong to your process as the process can't access variables within your address space. A solution would be allocating memory within the other process memory space and storing the string there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top