Re: Is object created?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ed (Ed_Millis_at_NOSPAM.Hotmail.com)
Date: 06/07/04


Date: Mon, 7 Jun 2004 06:59:51 -0700

Perhaps you could use a property of the object, rather than the object
itself. I had to find a way to detect if my object had suddenly become
Nothing - that is, the user closed the file without using the Exit button
that would also close the VB app. Not being very experienced at this, I
probably went the long and tedious way around, but I set a Timer function to
set the name of the object to a string. If it errored, the file was
closed - I detected the error and shut down the VB app.

Ed

"MacDermott" <macdermott@NoSpam.com> wrote in message
news:%23h9b04zSEHA.4016@TK2MSFTNGP10.phx.gbl...
> As I understand it, if your object variable is declared using New, it will
> be instantiated whenever you reference it.
> Thus in that case
> oEmp Is Nothing
> will always evaluate to False, because the reference to oEmp instantiates
> it.
>
> If you are instantiating it some other way, this may not be a
consideration.
>
> HTH
> - Turtle
>
> "eagletender" <eagletender2001@yahoo.com> wrote in message
> news:10c3tq1dlde3n59@corp.supernews.com...
> > How can you tell if an object has been initialized? I have tried
> > isempty(oEmp), isnull(oEmp), isobject(oEmp), isMissing(oEmp) and none of
> > them work yet I still get the error Object variable or With Variable not
> > set, yet it should have not even gotten that far. I used Isempty
> > successfully with ASP but doesn't work with VB. Thanks.
> >
> >
>
>



Relevant Pages

  • Re: Separation of API and implementation
    ... by not passing 'y' as a reference to B::foo at all. ... Here some Client accesses B::foo. ... virtual void doIt; ... When whoever instantiates the R3 association provides a reference when invoking B::setR3, that reference must be a B or else the compiler will have a kitten. ...
    (comp.object)
  • Re: Getting a reference to an object instantiated by doClick()
    ... instantiates it, post this stripped-down code. ... the action listener creates the dialog. ... > a reference to that dialog. ... The API says that doClick() is a method from ...
    (comp.lang.java.gui)
  • Re: Getting a reference to an object instantiated by doClick()
    ... me into my logic for handling a 'Change Preferences' click in the GUI's ... instantiation of my Preferences dialog and a reference to that dialog. ... the doClick() caused me to go to the 'Change Preferences' logic. ... > instantiates it, post this stripped-down code. ...
    (comp.lang.java.gui)
  • Re: Class in separate add in?
    ... You can add a property to the module that instantiates and returns a ... Eg the addin called XXX has a class called clsPBar; ... Then any module with a reference to the addin can use ...
    (microsoft.public.word.vba.general)
  • Re: ActiveX EXE Not Execute
    ... it in Windows Explorer. ... Only the main app that instantiates the ActiveX EXE should do this. ...
    (microsoft.public.vb.general.discussion)