PC Review


Reply
Thread Tools Rate Thread

API to wait until an object is created properly??

 
 
raghudr@gmail.com
Guest
Posts: n/a
 
      21st Oct 2008
Hi all,

I have created lot of controls on a form

what i want to do is for wait until handles are created.

how can we do this??

say rag=new label();

i want to wait until the rag handle has been created.This is necessary
when i restart my system since all my app will be launched as a
windows service and i am getting expections like

"Invoke or begininvoke cannot be called on a control until the window
handle has been created".

Please help me in this i want to know which are the API's used for
this and how to do it??

I want to avoid sleep

thanks in advance,
RAGHU

 
Reply With Quote
 
 
 
 
Kerem Gümrükcü
Guest
Posts: n/a
 
      21st Oct 2008
Hi Raghu,

have a look at these:

Control..::.HandleCreated Event
Control..::.HandleDestroyed Event
Control..::.IsHandleCreated Property
Control..::.OnHandleCreated Method


Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Latest Project: http://www.codeplex.com/restarts
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
<(E-Mail Removed)> schrieb im Newsbeitrag
news:35f45751-4134-4757-85c8-(E-Mail Removed)...
> Hi all,
>
> I have created lot of controls on a form
>
> what i want to do is for wait until handles are created.
>
> how can we do this??
>
> say rag=new label();
>
> i want to wait until the rag handle has been created.This is necessary
> when i restart my system since all my app will be launched as a
> windows service and i am getting expections like
>
> "Invoke or begininvoke cannot be called on a control until the window
> handle has been created".
>
> Please help me in this i want to know which are the API's used for
> this and how to do it??
>
> I want to avoid sleep
>
> thanks in advance,
> RAGHU
>


 
Reply With Quote
 
raghudr@gmail.com
Guest
Posts: n/a
 
      21st Oct 2008
On Oct 21, 5:48*pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
> On Tue, 21 Oct 2008 02:55:41 -0700, <ragh...@gmail.com> wrote:
> > [...]
> > i want to wait until the rag handle has been created.This is necessary
> > when i restart my system since all my app will be launched as *a
> > windows service and i am getting expections like

>
> > "Invoke or begininvoke cannot be called on a control until the window
> > handle has been created".

>
> > Please help me in this i want to know which are the API's used for
> > this and how to do it??

>
> There is probably some reasonable, high-level way to structure your *
> program so that it doesn't try to access Control instances until after *
> their window handle is created, even notwithstanding the events Kerem *
> mentions.
>
> But, an actual service shouldn't be doing GUI stuff anyway. *Either you're *
> misusing the term service, or there's a broader design problem going on *
> here.
>
> A concise-but-complete code sample would probably clear things up a lot *
> better than a general description.
>
> Pete


Hi pete,

Main problem is:


1)I have created a thread.which shows a splash screen(which is nothing
but a form with borders taken out).

2)now i do rag=new form();
then rag.showdialog();

3)And my application is very big.
all my application will be launched as a windows service

4)By the time my thread initilizes and rag has a valid value.A call
will be made from other application to end the splash

so i will be call invoke method to end the splash screen and then end
the thread.

but since the handle is not having proper value i get an exception.

this problem happens only during the restart of a system rest all
times it is working fine

please reply on this

thanks,
RAGHU
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please Wait While Domain List Is Created =?Utf-8?B?S2Vu?= Windows XP Networking 4 22nd Aug 2006 02:53 AM
Please wait while domain list is created Rich Windows XP General 5 26th Apr 2006 03:35 AM
Please wait while the domain list is created. =?Utf-8?B?c2Vhbg==?= Windows XP Networking 6 26th Apr 2005 11:08 PM
Re: Screensaver wait time does not work properly Rehan Windows XP Video 0 23rd Sep 2004 12:19 AM
Screensaver wait time does not work properly =?Utf-8?B?Tm9ybSBCLg==?= Windows XP Video 0 22nd Sep 2004 10:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:54 PM.