...interrupt the thread with mouseclicks (e.g. when trying to open modal form). Can someone tell me if I'm missing something in this code snippet?
'**********************************************************************************************************
' WaitForThread: waits for thread while...
Don't feel sorry, I just hoped someone else experienced the same situation where doing a redesign would take more than a month or so, and who found a workaround for it... Is there any change I could suspend the current event handler, give some time to the main GUI thread, and resume the event...
And what if the variables that are used in de spawned thread are dependent on the state of the function that spawns the thread. I would not call it a "little" redesign...
Let me explain in more detail:
Public Function Function4() As Whatever
...
'do something that takes a very long...
What if I put the waiting in a seperate thread? How could i possibly get back to the place in code where I started the waiting?
Lets say we have a lengthy nested procedure:
Sub Foo()
... 'lots of nested calls
...
.......'start a thread
.......'start waiting for thread
.......'how...
I won't take no for an answer :)
There must be a way to suspend the current event handler and wait for the Thread within a Timer event and than when the Thread has ended give control back to the suspended event handler. I just need to find out how... Anyone?
Thx all for your replies,
but my problem still remains. Is there any chance I can make DoEvents return? What I try to do is create a thread from a c++ dll and wait for that thread (by checking the returned ThreadID) while the GUI is still responsive by adding the DoEvents in the waiting loop...
That would indeed be a solution, but I want the user to be able to navigate through the GUI, even if the thread is running. So being selective in which messages to Dispatch is not an option here. Any other ideas? I was wondering if its possible to save the current call stack and than put it back...
I haven't found any wait function yet where the DoEvents is NOT being used... Since the DoEvents method is causing serious problems, I hope someone can point me to a good alternative without telling me to search somewhere else coz that's what I've been doing for the last 2 days now...
Dear Programmers,
I'm experiencing a problem that is a real pain in the ass. As VB doesn't support threading, our project uses a VC++ dll that starts some thread for heavy load processes. This is how we wait for the thread to finish:
...
While WaitForSingleObject(ThreadID,200) = WAIT_TIMEOUT...
Hi,
I am wondering if its possible to implement an interface made with the good old unmanaged C++ in C# and than use that implementation from unmanaged C++? Lets say I have a pure virtual class in the file "Idata.h". I want to implement it in C#, but I want to use the implementation from C++...
Hi,
I made a C++ library with an interface (header-file with pure virtual function) that needs to be implemented in order to get another class from the library to work. The implementation is up to a third party user, but they seem to use the .NET environment. What would be the best way to make...
The .lib's are made by myself. But I can't find a way to compile them in one lib. I don't even know if it's possible...
are you sure all the dependant libs will be compiled in the dll?
So if I want to create a library that can be used by a third party, there's no other choise than to give them the separate files and tell them to link them all with there new program?
Hi,
This may be a stupid question, but I'll ask it anyway. Is it possible to merge a bunch of lib-files into one static library that has no dependencies? Let's say I have two libraries lib1.lib and lib2.lib. Lib1 uses lib2 to function correctly. Can I merge lib1 and lib2 into lib3 which has...
Thx for you reply timmay. Can you explain why passing the this pointer to a thread is not thread safe? I have seen alot of examples on the net doing the same. Imo that is not what is causing the problem...
...= __FILE__;
#endif
//this is the thread that calls the waiting function
UINT CUSBWaitDlg::ThreadWaitInstalling(LPVOID params){
CUSBWaitDlg * me = (CUSBWaitDlg *)params;
me->WaitInstalling();
return 0;
}
//this is the waiting function
void CUSBWaitDlg::WaitInstalling(){
HINSTANCE...
Hi,
Our company uses USB drives to distribute new software updates for our machines. The problem with the USB drives on the XP embedded systems is that they are either detected very slow (I guess the driver installation is taking long...) or even not detected at all. In the first case we want...
Hi,
I'm using DAO to open an excel file as a database (I know, it can be done much better...) with the OpenDatabase method. The problem is that this method sometimes fails with the error message "Workgroup File is missing or file is opened in exclusive mode by other user". I downloaded a...
I already set the recordset to Nothing at the end. Thats not the problem. The problem is I keep searching in the same recordset in a loop and everytime update is called the memory usage increases...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.