Application Not Responding while doing a long task

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Application Not Responding while doing a long task

Post by sudip »

esgici wrote:Hi Sudip

Good sample, clean and easy to understanding code :)
Very happy to hear this from my Coding Style Guru. :)

Regards.

Sudip
With best regards,
Sudip
CCH4CLIPPER
Posts: 140
Joined: Tue Mar 03, 2009 8:59 am

Re: Application Not Responding while doing a long task

Post by CCH4CLIPPER »

Hi Esgici

>Only one point : Loop() function / procedure call line.
>Although the () implied that is a UDF, the LOOP is a standard Clipper statement. If your Loop() line works as LOOP statement, lines between >this and ENDDO newer will be executed.

CCH: Renamed to ProcessBody() but still same result ie task Bar shows 100 % CPU usage but the app is definitely running

>You are using keywords as identifier, such as BREAK. This isn't a good way and will be dangerous.

CCH : Hmm... I don't see BREAK in the pasted codes :-)


CCH
http://cch4clipper.blogspot.com
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Application Not Responding while doing a long task

Post by esgici »

Hi CCH
CCH4CLIPPER wrote:Renamed to ProcessBody() but still same result
LOOP and LOOP() have different implementation. Important point is : what happening in Loop() / ProcessBody() ?
Task bar shows 100 % CPU usage but the app is definitely running
Probably you have another loop in Loop() or anywhere else and this loop doesn't have DO EVENTS statement.
I don't see BREAK in the pasted codes :-)
Sorry, this is my mistake by hastiness, it was Begin

And my thoughts about using keywords as identifier are only humble suggestions, not directly about your problem.
in the pasted codes
BE wrote:your code have many unknown things for me.

If possible, please send a problem concentrated code.
Or, if there isn't any inconvenience send your code to my private e-mail.

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
CCH4CLIPPER
Posts: 140
Joined: Tue Mar 03, 2009 8:59 am

Re: Application Not Responding while doing a long task

Post by CCH4CLIPPER »

Hi Esgici

TQ for your speedy response :-)

I have already solved the problem which was caused by my mistake of including in ON INIT a function which had references to the Progress Bar before it was created. I moved all these codes to before DEFINE WINDOW MainForm and the problem went away.

One thing still bothers me as I need to have a MsgInfo() activated before I can see the Progress Window with the Progress Bar in it.
Before this confuses you, my HMG app is actually launched from my Delphi Apps. If a Windows API function such as MsgInfo() or MsgYesNo() is not called, the HMG app just doesn't work :-(

Is there any special coding needed if my HMG EXE is launched from say a Delphi Apps.

TIA

CCH
http://cch4clipper.blogspot.com
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Application Not Responding while doing a long task

Post by esgici »

Hi CCH

Sorry, I'm confused :?
mistake of including in ON INIT a function which had references to the Progress Bar before it was created.
In this case definition of progress bar must be out of this window ( that is window of ON INIT )
I moved all these codes to before DEFINE WINDOW MainForm and the problem went away.
For any code BEFORE defining Main Form must don't include any GUI control.

In summary :

- Every HMG appl must one only one Main Window

- The message functions ( MsgXXXX() ) are only exceptions of this rule, as explained in one of HMG Help topics .

- Since the message functions are special cases, there isn't any way to add another control such as Progress Bar. A messages window with such control may be only an user defined form or control and so must depend to main form ( by a direct or indirect way )

- Code placed BEFORE defining and activating Main Form must don't have any GUI control.

- Code between DEFINE WINDOW and END WINDOW are definitions statement only.

- Form and controls included in a form will be realized by ACTIVATE command, not when defined.

- ON INIT is a event definition and will be fired first when ACTIVATE command executed. So you can reference a control defined in this window in a ON INIT procedure / function / code block.

As far as know there isn't any special case when an appl launched by another one ( except any communication betwwen them ). An appl work rightly stand alone must also work by calling another one.

Perhaps I told all about you know.

This is because I can't find differentiate point between us, I think.

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Application Not Responding while doing a long task

Post by sudip »

Hi Esgici,
esgici wrote:- The message functions ( MsgXXXX() ) are only exceptions of this rule, as explained in one of HMG Help topics .

- Since the message functions are special cases, there isn't any way to add another control such as Progress Bar. A messages window with such control may be only an user defined form or control and so must depend to main form ( by a direct or indirect way )
Thank you very much. :)

IMHO, like Msgxxx functions there is at least another function GetFile(), which can be used before Main window definition.

So, can we say Native Win32 Common Dialog Windows can be used before main window defination?

With best regards.

Sudip
With best regards,
Sudip
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Application Not Responding while doing a long task

Post by esgici »

Hi Sudip
sudip wrote: IMHO, like Msgxxx functions there is at least another function GetFile(), which can be used before Main window definition.
I had don't know ( and anyone has don't warn me up to now :( ), tried and verified; thank you very much. :)

I have correct my very first simple tutorial !
So, can we say Native Win32 Common Dialog Windows can be used before main window definition?
May be. If we know what are Native Win32 Common Dialog Windows in HMG ?

Thanks a lot again.

With best regards.

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: Application Not Responding while doing a long task

Post by sudip »

Hi Esgici,
esgici wrote:Hi Sudip
sudip wrote: IMHO, like Msgxxx functions there is at least another function GetFile(), which can be used before Main window definition.
I had don't know ( and anyone has don't warn me up to now :( ), tried and verified; thank you very much. :)

I have correct my very first simple tutorial !
So, can we say Native Win32 Common Dialog Windows can be used before main window definition?
May be. If we know what are Native Win32 Common Dialog Windows in HMG ?
Your "first simple tutorial" is excellent!!! (CCH already placed it in his blog!!!)

I regard you and Rathi as my "teachers" in my HMG learning journey :)

Yesterday, I did some experiments with GetOpenFileName() and GetSaveFileName() Win32 functions (with xHarbour+gtwvw). But I don't know whether GetFile() HMG function actually uses GetOpenFileName() Win32 function or not :(

With best regards.

Sudip
With best regards,
Sudip
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Application Not Responding while doing a long task

Post by esgici »

Hi Dear Sudip
sudip wrote: I regard you and Rathi as my "teachers" in my HMG learning journey :) I learned (and shall learn) many things from you.
My idea is a little different : who teach me anything, he/she is my teacher !

Since I'm just learned from you that MsgXXX() functions aren't ONLY exception, you too are my teacher :)

In other hand, since we are all friends, we are all both teachers and students for each other; this isn't meaning of friendship ?

Viva HMG Community, viva our maestro Roberto !!!

Regards

--

Esgici
Viva INTERNATIONAL HMG :D
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Application Not Responding while doing a long task

Post by esgici »

Hi All

On 10 May 2009 15:50 :
esgici wrote:
- The message functions ( MsgXXXX() ) are only exceptions of this rule, as explained in one of HMG Help topics .
Sorry, I have a fault in this sentence: please extract the word "only"

Many thanks to my friend Sudip for this correction.

As denoted in my humble web page Please don't forgive my faults !

Hi CCH

Thanks a lot for assuming "code tricks" my humble words by placed its to your blog :)

Would you like applying this correction to your page ?


Regards

--

Esgici
Viva INTERNATIONAL HMG :D
Post Reply