msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ActiveX EXE as Service not sharing variables

 
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE
Author Message
Luiz Carlos Brazão



Joined: 04 Oct 2007
Posts: 1

PostPosted: Tue Jun 15, 2004 3:48 am    Post subject: ActiveX EXE as Service not sharing variables Reply with quote

Hi all,

Well, I have a ActiveX EXE thats runs as Service (using a typelib to
implements the SCM Handler) and I had declared an collection in a public
basic module
All the application runs like this:
________________________________________________________________
My App
Public Class Module: BaseClass
Runs an Winsock API functions thats listen for connections, when an
connection is requested is accepted and a new class is add to the
collection

Public Class Module: Socket
Used to controls the Winsock connection handle and is members of the
Collection

Basic Module: Main
Public variables declared like collections API's and Functions
_________________________________________________________________

There is a function in the BaseClass thats returns the Collection declared
as Public the the basic module
In another VB App I tried

Sub Form_Load()
Dim MyBaseClass
Set MyBaseClass = GetObject()
Debug.Print MyBaseClass.Socks.Count
End Sub

and this always returns 0 but I'm sure thats this var has itens becouse for
every iten added to the collection I made:
Socks.Add
App.LogEvent Socks.Count

I suspect that is becouse the service runs under the System Service
credential and probability runs another thread on the same process, I don't
know what to do

Reguards,
Luiz

Archived from group: microsoft>public>vb>ole
Back to top
View user's profile Send private message
Jens Neuhalfen



Joined: 04 Oct 2007
Posts: 55

PostPosted: Tue Jun 15, 2004 7:55 pm    Post subject: Re: ActiveX EXE as Service not sharing variables Reply with quote

[snip]

VB stores module variables in the TLS so tell your ActiveX to run in
only one thread

Jens
Back to top
View user's profile Send private message
Luiz Carlos Brazão



Joined: 04 Oct 2007
Posts: 2

PostPosted: Tue Jun 15, 2004 5:43 pm    Post subject: Re: ActiveX EXE as Service not sharing variables Reply with quote

Set the threading to "per Pool" instead of "per Object"?

"Jens Neuhalfen" escreveu na mensagem$DuUEHA.2692@TK2MSFTNGP09.phx.gbl...
> [snip]
>
> VB stores module variables in the TLS so tell your ActiveX to run in
> only one thread
>
> Jens
Back to top
View user's profile Send private message
Jens Neuhalfen



Joined: 04 Oct 2007
Posts: 55

PostPosted: Wed Jun 16, 2004 3:49 pm    Post subject: Re: ActiveX EXE as Service not sharing variables Reply with quote

> Set the threading to "per Pool" instead of "per Object"?

Yes, Thread Pool with only oner thread. Be warned that this can cause
a bottleneck.

Jens

>

>>[snip]
>>
>>VB stores module variables in the TLS so tell your ActiveX to run in
>>only one thread
>>
>>Jens
>
>
>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
creating Self-registering ActiveX OCX in VB6 I have created an OCX in VB6 and would like it to I also want to learn how to create a self registering control. How I am using the OCX: I am currently registering the OCX manually so I can use the OCX in my Script and than using the follow

VB exe using VC++ ActiveX control memory leaks I created a MFC Active X control with one dummy method which does nothing. And then I add this C++ ocx to Visual Basic exe as a component, drag it on the form. Lastly in my VB code I called this form's C++ Active control dummy method. I open VC++ MFC acti

VBA reference to a dll ActiveX I develop activeX dlls using VB. These dlls are registered in the registry using the command regsvr32.exe (we have a shell for that). They are then added as references to an application having VBA. I have a problem to install the software in our client's

ATL ActiveX control crashes VBA Hi, I created an ATL ActiveX control in VS.NET 2003 with all default options. Then open VBA in WORD, drop the control I just created into a form. Now, if I run the form, VBA will complain that it runs out of stack space and will never display the form aga

Accessing main application from ActiveX dll Message-ID: Path: Lines: 8 References: X-Newsreader: Yanoff 1.5.4 PalmPilot Hi, I just wrote my first activex dll. Everything seems to be working fine, I am able to call dll's procedures from within main applicat
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group