472,975 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,975 software developers and data experts.

RE: Can anyone suggest a better design approach?

You should never WaitForMultipleObjets or WaitForSingleObject on a GUI thread
(unless there's a very short timeout).

Creating another thread to perform the blocking (calling WaitFor...) is the
recommended approach.

Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
Microsoft MVP, Visual Developer - Visual C#
"vi***@gmail.com" wrote:

I have a forms application which hosts an unmanaged dll. This dll
exposes some simple c style functions which I just call using pinvoke.
But all native functions call WaitForMultiple\singleObject and wait
for a particular event to come. The problem is, this event can fire
only when messages on the windows message queue gets processed. Hence
if I call these blocking functions from native DLL directly from .NET
code they just block the application forever.
The solution I thought is to start a new thread and make this thread
call the dll method. I shall also create an event and pass its handle
into the thread created, so that this newly created thread can wait
for this event to happen. But then I would end up creating thread each
time for every native dll API call(every native DLL APi call does a
waitforsingle\multiple objects). This is not good..
Can anybody suggest a better design approach?

Jun 27 '08 #1
0 923

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

Similar topics

by: vic | last post by:
My manager wants me to develop a search program, that would work like they have it at edorado.com. She made up her requirements after having compared how search works at different websites, like...
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
by: msnews.microsoft.com | last post by:
Hello, I have the scenario. I m building an application either in asp.net or window application. This application is base on n-tier application model. Let us take example of Northwind Database in...
by: Jim Hubbard | last post by:
I am downloading the REALbasic 5.5 demo and was just wondering if anyone else had tried it. I am tired of Microsoft constantly changing things and breaking backward compatibility ON PURPOSE. ...
by: windandwaves | last post by:
Hi Folk I have to store up to eight boolean bits of information about an item in my database. e.g. with restaurant drive-through facility yellow windows
by: rAinDeEr | last post by:
Hi, I have a table with the following 2 Fields - one is the description name and the second is its description to be stored in a table. description name description...
by: yang__lee | last post by:
Dear Gurus, I have been programming since 4 years and I am not a computer science literate. I am basically a Mechanical engineer. I am working in GIS field I do c++, C and VC++ programming well...
by: mike3 | last post by:
Hi. (Xposted to both comp.lang.c++ and comp.programming since I've got questions related to both C++ language and general programming) I've got the following C++ code. The first routine runs in...
by: MyRedz | last post by:
hi i just got into my first class and the prof already ask me to suggest a project for database structure and algorithm design can anyone suggest me some topics that i can make into a project like...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.