Just a quick question about the threading that the Visual basic 6 function 'CallByName' uses.
I'm basically using the CallbyName to involke a number of different subroutines in a Class module. The problem is, that when i call a series of subroutines in a batch... i.e. Sub1, Sub2, Sub3 etc... The Sub routines are all getting mixed up because they are using the same variables which are changing before i call each routine.
The object of my question is to find out if there is any way to wait for the function that the CallbyName calls, too finish, before calling the next subroutine?
By that i mean something like the 'WaitForSingleObject' API that you'd use for processes etc.
Looking at all my debug infomation, it seems that the Class that is being called is running off in another thread, and instead of waiting for that thread to return, the calling routine is going off and getting the next routine straight after :/
What i don't want to do is add something at the end of each subroutine to signify its been finished (i.e. an event etc), its a lot of work and i'd rather just wait for the thread to finish and retun if there is a way?