Re: Multithreaded COM DLL

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: David Younger (david_at_ATproware.com.au)
Date: 04/22/04


Date: Thu, 22 Apr 2004 12:41:31 +1000

Thanx Craig.

In my case, the procedures are already included in an OlePublic custom class
in a .VCX file. This class is very large and has been developed over a long
period of time.

How would I incorporate this class into the session?

Cheers
David

"Craig Berntson" <iamcraig@craigberntson.com> wrote in message
news:OBS%23tM7JEHA.644@tk2msftngp13.phx.gbl...
> DEFINE CLASS MyClass AS Session OLEPUBLIC
>
> MyProperty1 = "String"
> MyProperty2 = 12
>
> PROCEDURE MyProc1
> * Code goes here*
> RETURN SomeValue
> ENDPROC
>
> PROCEDURE MyProc2
> LPARAMETERS Param1, Param2
>
> *Code goes here
> ENDPROC
>
> ENDDEFINE
>
> Then compile the code into a DLL
>
> You will then invoke it just as you previously had.
> --
> Craig Berntson
> MCSD, Visual FoxPro MVP
> Author, CrysDev: A Developer's Guide to Integrating Crystal Reports
> www.craigberntson.com
> email iamcraig@craigberntson.com (remove iam)
> Salt Lake City Fox User Group
> www.slcfox.org
>
>
> "David Younger" <david@ATproware.com.au> wrote in message
> news:eCAcfq0JEHA.1760@TK2MSFTNGP10.phx.gbl...
> > Thank you Craig - I was not aware of the Session Class!
> >
> > The base class is the Custom Class.
> >
> > I have looked at the documentation and can understand how to invoke this
> > session class from within a VFP application program but am a bit
confused
> as
> > to how to implement it from my VB Application.
> >
> > Could you please provide an example of how to do this so that all
methods
> > within the Com Object are in a private session.
> >
> > Cheers
> > David
> >
> >
> > "Craig Berntson" <iamcraig@craigberntson.com> wrote in message
> > news:eHyTL%23hJEHA.1392@TK2MSFTNGP09.phx.gbl...
> > > What base class was used to create the VFP COM object? You should be
> using
> > > the Session Class as it will give private data sessions...and that
will
> > give
> > > you the behavior you desire.
> > >
> > > --
> > > Craig Berntson
> > > MCSD, Visual FoxPro MVP
> > > Author, CrysDev: A Developer's Guide to Integrating Crystal Reports
> > > www.craigberntson.com
> > > email iamcraig@craigberntson.com (remove iam)
> > > Salt Lake City Fox User Group
> > > www.slcfox.org
> > >
> > >
> > > "David Younger" <david@ATproware.com.au> wrote in message
> > > news:OeycEAaJEHA.2652@TK2MSFTNGP12.phx.gbl...
> > > > I have a VB application that is spawning off multiple VFP tasks
using
> a
> > > > multi threaded VFP COM DLL I have created.
> > > >
> > > > The code is something like this:
> > > >
> > > > oTest1 = CREATEOBJECT("foxole.person")
> > > > oTest2 = CREATEOBJECT("foxole.person")
> > > >
> > > > (This is not the real syntax but gives you an idea)
> > > >
> > > > There could be a varied number of objects created from 1 to many.
> > > >
> > > > This seems to work fine except that the 2 objects seem to share
> certain
> > > > elements.
> > > >
> > > > Changing a record in a table in one object changes it in the other,
> > > setting
> > > > fiters in one sets the filter in the other, closing a table in one
> > closes
> > > it
> > > > in the other etc.
> > > >
> > > > What I want is for the 2 objects to run in completely separate
memory
> > > > spaces.
> > > >
> > > > I have created a multi-threaded DLL and my Project Server tab has
the
> > > > classes set to Single Use instancing.
> > > >
> > > > How can I ensure that the 2 objects oTest1 and oTest2 run in
> completely
> > > > separate memry spaces with no interraction between them at all?
> > > >
> > > > Cheers
> > > > David Younger
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: U.S. Constitution could clear Craig
    ... So, if we take this idea to its extreme, a member of congress commits murder, and while "travelling to and from sessions of Congress" that person cannot be arrested. ... So, that person can avoid arrest for as long as he remains in Congress, and is onsidered to be "traveeling to and from session of Congress"? ... U.S. Constitution could clear Craig ...
    (soc.retirement)
  • Re: Multithreaded COM DLL
    ... You'll need to copy and paste the code from the custom class into the ... > How would I incorporate this class into the session? ... > "Craig Berntson" wrote in message ... CrysDev: A Developer's Guide to Integrating Crystal Reports ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Unhandled errors; public vars/classes lose scope??
    ... My custom class module's class_terminate event doesn't even fire, ... Public Session As clsSession ... Public Function SessionInit() ... Rick Brandt, Microsoft Access MVP ...
    (comp.databases.ms-access)
  • Re: Retrieving Session Data from a Base Page Class
    ... >I normally work on WinForms projects, but have been recently thrust into ... > We've apparently got an object (custom class) that's stored in session for ... > stylesheet reference, I was thinking about having all pages inherit from ...
    (microsoft.public.dotnet.framework.aspnet)
  • Unhandled errors; public vars/classes lose scope??
    ... My custom class module's class_terminate event doesn't even fire, ... Public Session As clsSession ... Public Function SessionInit() ...
    (comp.databases.ms-access)