ActiveX DLL thread 
Author Message
 ActiveX DLL thread

Hi all,

Here's my scenario:

GUI App (Standard EXE) -> ActiveX DLL (Class Module - Controller Thread) ->
ActiveX DLL (Module - Worker Thread)

In my GUI App, I will CreateObject of the class in ActiveX DLL (Class
Module) which will call Worker thread to do the threading using Win32 API
SetTimer and KillTimer (TimerProc).

A logical design for implementing notification from the Worker to the
Controller is to have the Controller supply the Worker with a reference,
and create a callback function for the Worker to use.  Let's implement this,
and see what happens. But however, I do not know how to pass the reference
back to the Controller class as it must be created as an object to have
reference back to it from the Worker thread.

I just need to notify the GUI App everytime with the values in the TimerProc
that has been calculated so far so that the progress bar will increment.

So how can I solve this problem?

--
UK Time:1538

------------------------------------------------------
To Know The Road Ahead, Ask Those Who Had Returned.

Michael



Sat, 18 Sep 2004 22:39:30 GMT  
 ActiveX DLL thread
humm, r u talking about VB6?
then ur worker thread is not supported coz u have to use thread-api which
does not work in VB6


Quote:
> Hi all,

> Here's my scenario:

> GUI App (Standard EXE) -> ActiveX DLL (Class Module - Controller
Thread) ->
> ActiveX DLL (Module - Worker Thread)

> In my GUI App, I will CreateObject of the class in ActiveX DLL (Class
> Module) which will call Worker thread to do the threading using Win32 API
> SetTimer and KillTimer (TimerProc).

> A logical design for implementing notification from the Worker to the
> Controller is to have the Controller supply the Worker with a reference,
> and create a callback function for the Worker to use.  Let's implement
this,
> and see what happens. But however, I do not know how to pass the reference
> back to the Controller class as it must be created as an object to have
> reference back to it from the Worker thread.

> I just need to notify the GUI App everytime with the values in the
TimerProc
> that has been calculated so far so that the progress bar will increment.

> So how can I solve this problem?

> --
> UK Time:1538

> ------------------------------------------------------
> To Know The Road Ahead, Ask Those Who Had Returned.

> Michael



Sun, 19 Sep 2004 01:30:21 GMT  
 ActiveX DLL thread
Yes, I am using VB6, and when you say thread-api, do you mean CreateThread
API function?

Quote:

> humm, r u talking about VB6?
> then ur worker thread is not supported coz u have to use thread-api which
> does not work in VB6




--
UK Time:1932

------------------------------------------------------
To Know The Road Ahead, Ask Those Who Had Returned.

Michael



Sun, 19 Sep 2004 02:32:12 GMT  
 ActiveX DLL thread


Quote:
> Yes, I am using VB6, and when you say thread-api, do you mean CreateThread
> API function?

yezz

--
Steffen Ramlow
Enterprise Development: http://www.dev-purgatory.org/



Sun, 19 Sep 2004 03:38:17 GMT  
 ActiveX DLL thread

Quote:

> humm, r u talking about VB6?
> then ur worker thread is not supported coz u have to use thread-api which
> does not work in VB6

Duhh, I think Matthew Curland would disagree, but then, he has
access to the source code, does he not...?

--
Joe Foster <mailto:jlfoster%40znet.com>   L. Ron Dullard <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Sun, 19 Sep 2004 04:09:22 GMT  
 ActiveX DLL thread




Quote:

> > humm, r u talking about VB6?
> > then ur worker thread is not supported coz u have to use thread-api
which
> > does not work in VB6

> Duhh, I think Matthew Curland would disagree

he wouldn't

Quote:
>, but then, he has
> access to the source code, does he not...?

h???


Sun, 19 Sep 2004 14:58:39 GMT  
 ActiveX DLL thread
Okie Multi-threading gurus,

I have a question here: I am creating ActiveX DLL, in this DLL I have
multi-threading done in there by using SetTimer API. Now, why is it my GUI
still "freeze" when I try to move the GUI Program around the desktop when
the SetTimer's TimerProc is running number crunching operation? I thought
ActiveX DLL is part of COM which will handle multi-threading in the
background for me so that my GUI app would not behave as such?

Quote:





> > > humm, r u talking about VB6?
> > > then ur worker thread is not supported coz u have to use thread-api
> which
> > > does not work in VB6

> > Duhh, I think Matthew Curland would disagree

> he wouldn't

> >, but then, he has
> > access to the source code, does he not...?

> h???

--
UK Time:1831

------------------------------------------------------
To Know The Road Ahead, Ask Those Who Had Returned.

Michael



Mon, 20 Sep 2004 01:31:06 GMT  
 ActiveX DLL thread
humm? a Timer is not a Thread

again: VB6 written dlls cannot create threads, period.

ur dll objects run in the one and only thread of ur GUI

--
Steffen Ramlow
Enterprise Development: http://www.dev-purgatory.org/


Quote:
> Okie Multi-threading gurus,

> I have a question here: I am creating ActiveX DLL, in this DLL I have
> multi-threading done in there by using SetTimer API. Now, why is it my GUI
> still "freeze" when I try to move the GUI Program around the desktop when
> the SetTimer's TimerProc is running number crunching operation? I thought
> ActiveX DLL is part of COM which will handle multi-threading in the
> background for me so that my GUI app would not behave as such?






> > > > humm, r u talking about VB6?
> > > > then ur worker thread is not supported coz u have to use thread-api
> > which
> > > > does not work in VB6

> > > Duhh, I think Matthew Curland would disagree

> > he wouldn't

> > >, but then, he has
> > > access to the source code, does he not...?

> > h???

> --
> UK Time:1831

> ------------------------------------------------------
> To Know The Road Ahead, Ask Those Who Had Returned.

> Michael



Mon, 20 Sep 2004 03:55:43 GMT  
 ActiveX DLL thread

Quote:





> > > humm, r u talking about VB6?
> > > then ur worker thread is not supported coz u have to use thread-api
> which
> > > does not work in VB6

> > Duhh, I think Matthew Curland would disagree

> he wouldn't

he would

 URL:http://groups.google.com/groups?selm=uD8ThNLABHA.1952%40tkmsftngp03

Quote:
> >, but then, he has
> > access to the source code, does he not...?

> h???

Stand by for...  Haaaaaah!

"The resources are written back using standard APIs
(BeginUpdateResource,UpdateResource,EndUpdateResource)
that happen to be available only on NT/2000. I did
mention that I had gotten the source code for these
APIs from MS, and I have modified it to run on the 9x
platforms, but I haven't posted it yet (UpdateResource9x.dll
will be redistributable when I do, but I don't have
permission to post the source for it)." -- Matthew Curland 2001-06-19

--
Joe Foster <mailto:jlfoster%40znet.com>  DC8s in Spaace: <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Mon, 20 Sep 2004 17:10:06 GMT  
 ActiveX DLL thread
I don't quiet understand the last sentence => ur dll objects run in the one
and only thread of ur GUI

Do you mean that one ActiveX DLL is consider as one Thread for the Standard
EXE?

Quote:

> humm? a Timer is not a Thread

> again: VB6 written dlls cannot create threads, period.

> ur dll objects run in the one and only thread of ur GUI

> --
> Steffen Ramlow
> Enterprise Development: http://www.dev-purgatory.org/



> > Okie Multi-threading gurus,

> > I have a question here: I am creating ActiveX DLL, in this DLL I have
> > multi-threading done in there by using SetTimer API. Now, why is it my GUI
> > still "freeze" when I try to move the GUI Program around the desktop when
> > the SetTimer's TimerProc is running number crunching operation? I thought
> > ActiveX DLL is part of COM which will handle multi-threading in the
> > background for me so that my GUI app would not behave as such?






> > > > > humm, r u talking about VB6?
> > > > > then ur worker thread is not supported coz u have to use thread-api
> > > which
> > > > > does not work in VB6

> > > > Duhh, I think Matthew Curland would disagree

> > > he wouldn't

> > > >, but then, he has
> > > > access to the source code, does he not...?

> > > h???

> > --
> > UK Time:1831

> > ------------------------------------------------------
> > To Know The Road Ahead, Ask Those Who Had Returned.

> > Michael

--
UK Time:

------------------------------------------------------
To Know The Road Ahead, Ask Those Who Had Returned.

Michael



Mon, 20 Sep 2004 21:32:07 GMT  
 ActiveX DLL thread

Quote:

> Okie Multi-threading gurus,

> I have a question here: I am creating ActiveX DLL, in this DLL I have
> multi-threading done in there by using SetTimer API. Now, why is it my GUI

Only ActiveX EXEs can start threads in VB code, unless you're suicidal
and use the CreateThread API.  Matthew Curland has written a book and
some articles about how it might be done, but he has access to Windows
source code.  Tellingly, his voodoo has needed significant revisions
with new Windows releases...

 URL:http://groups.google.com/groups?selm=uD8ThNLABHA.1952%40tkmsftngp03

 URL:http://groups.google.com/groups?selm=uqSq47rOAHA.253%40cppssbbsa05

Dunno about XP "issues".  Is this really where you want to go today?

--
Joe Foster <mailto:jlfoster%40znet.com>  DC8s in Spaace: <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Tue, 21 Sep 2004 04:44:53 GMT  
 ActiveX DLL thread

Quote:
> I don't quiet understand the last sentence => ur dll objects run in the
one
> and only thread of ur GUI

> Do you mean that one ActiveX DLL is consider as one Thread for the
Standard
> EXE?

ur standard exe uses one thread for your code
ur dll's code runs in the same thread not in another

--
Steffen Ramlow
Enterprise Development: http://www.dev-purgatory.org/



Tue, 21 Sep 2004 16:49:46 GMT  
 ActiveX DLL thread


Quote:
> he would

damned, right - even in his book..


Tue, 21 Sep 2004 17:03:43 GMT  
 
 [ 13 post ] 

 Relevant Pages 

1. GURU/SEMI-GURU please help with ActiveX DLL threading question

2. ActiveX DLL Threading model

3. ActiveX DLL Threading model

4. ActiveX DLL Threading model

5. ActiveX DLL Threading model

6. ActiveX DLL Threading model

7. Threading and Unattended Activex Dll

8. ActiveX Dll: Should it be multi-threaded?

9. ActiveX DLL: Single and Apartment Threaded?

10. VB ActiveX DLL & Threading

11. What happened to the old Apartment threaded ActiveX dll

12. VB ActiveX DLL & Threading

 

 
Powered by phpBB® Forum Software