Re: Multithreaded COM DLL
From: David Younger (david_at_ATproware.com.au)
Date: 04/22/04
- Next message: Frank Dreyfus: "Tracing code in a form (VFP6)"
- Previous message: Neil Waterworth: "Re: Printing a test page with VFP"
- In reply to: Craig Berntson: "Re: Multithreaded COM DLL"
- Next in thread: Craig Berntson: "Re: Multithreaded COM DLL"
- Reply: Craig Berntson: "Re: Multithreaded COM DLL"
- Messages sorted by: [ date ] [ thread ]
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
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Next message: Frank Dreyfus: "Tracing code in a form (VFP6)"
- Previous message: Neil Waterworth: "Re: Printing a test page with VFP"
- In reply to: Craig Berntson: "Re: Multithreaded COM DLL"
- Next in thread: Craig Berntson: "Re: Multithreaded COM DLL"
- Reply: Craig Berntson: "Re: Multithreaded COM DLL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|