Web Connection
OnLoad in AppMain.prg Not Firing
Gravatar is a globally recognized avatar based on your email address. OnLoad in AppMain.prg Not Firing
  Steve
  All
  Jan 26, 2018 @ 05:08am

Hi Rick,
Playing around still. Not sure if you recall, but my one laptop got hosed by a Win10 Update, and have not fixed it yet. I did setup a 2nd Dev Laptop and installed WWWC v6.18 along with VFP 9 SP2. My original laptop is running WWWC v6.10 I think.

Anyway, in the OnLoad Function of the ServerMain.prg, I set the THIS.oServerForm.Caption = "Message Board - Virtual: " + THIS.oConfig.oMsgboardProcess.cVirtual

Recall that I want to run multiple copies of the Message Board, and this helps me identify which server form is handling which site. This (ServerForm.Caption = Virtual) worked fine on my old laptop, with WWWC v6.10, and it still does. It's only IIS that got hosed, so I can still fire up VFP and WWWC Apps on the old laptop, it's just I cannot hit the local site.

I noticed with v6.18 on the new laptop, the ServerForm.Caption does not change until I hit the website the first time. Didn't think much of it, thought maybe it was a Refresh issue on the ServerForm or something.

This morning I added a WAIT WINDOW 'Set Form Caption Code' under the IF THIS.lShowServerForm construct where I set the caption, and it did not fire. Hmmmm. I then added another WAIT WINDOW to see if the OnLoad Function fires, and it appears it does not. Maybe I am doing something wrong, but thought I would run it by you to double check. It seems the OnLoad Function is not getting called when the WebAppServer is first started.

Thanks,
Steve

Gravatar is a globally recognized avatar based on your email address. re: OnLoad in AppMain.prg Not Firing
  Rick Strahl
  Steve
  Jan 26, 2018 @ 01:58pm

In 6.15+ .OnLoad() fires on the first request, not when the server starts. This was added to improve load performance of servers. So most likely the title will change as soon as you hit it for the first time.

Just noticed that this happens for the demo server and all other servers as well. It's a side effect of the recent change I didn't think about. Nothing I can do about it though - the server window isn't alive in OnInit() yet, so it can't be set there and there's currently no other hook you can punch into.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: OnLoad in AppMain.prg Not Firing
  Steve
  Rick Strahl
  Jan 26, 2018 @ 05:08pm

Ok, good to know.

Thanks,
Steve

© 1996-2024