XP and Theme Support

Started by Martin Francom, December 25, 2009, 06:28:30 AM

Previous topic - Next topic

Martin Francom

I have a FF3 program that compiles and runs fine on my Windows-7 computer.  However, the GUI fails to load and the program ends when I try to run it on my XP computer.  I found that if I turn OFF (uncheck)  Enable Theme Support in the project properties and then compile the program,  it will run fine on both Windows-7 and  Windows-XP.

Has anyone else experienced this problem?

José Roca

Male sure there is call to InitCommonControls or InitCommonControlsEx before the controls are created.

Martin Francom

Jose,
   Not sure I know where to put that call.  Would I place the call in FF_AppStartup or in FF_WinMain?
   And would the call syntax simply be:
       InitCommonControlsEx

And, shouldn't this be something that FF would place in the CODE_GEN files?

José Roca

Quote
Not sure I know where to put that call.  Would I place the call in FF_AppStartup or in FF_WinMain?

In FF_WinMain.

Quote
   And would the call syntax simply be:
       InitCommonControlsEx

It can be InitCommonControls (without the Ex). InitCommonControlsEx requires that you will fill an instance of the INIT_COMMON_CONTROLSEX structure.

Quote
And, shouldn't this be something that FF would place in the CODE_GEN files?

I guess yes, but I don't know if it has done it or not. Check the CODEGEN_xxxxxxx_MAIN.BAS File to see if there is a call to InitCommonControlsEx or not.

Martin Francom

Jose,
    Thanks.  I tried your suggestion.  It made no difference.  The program still compiles and runs in Windows-7 and fails to load the GUI in XP.  It's not that it crashes.  There simply is no error message from Windows. And, using "Task Manager" no process is started for it.   I have tried the program on several XP computers and got the same results on all the XP computers. 
    But compiling without Theme Support.  Then it runs on both Windows-7 and XP.
Baffling....

Martin Francom

Well, I found a solution to my problem.  It turns out not to have anything to do with Theme Support.   After much trial and error.  I found the code that was causing the problem.
    I was doing an initial search of the SQLite DB at the end of the Form1_Create function. That search also loaded the TextBox of  Form1.    I found if I moved that code out of the Form1_Create function then the program would load it's GUI and run correctly in both Windws-7 and Windows-XP.
   Can anyone explane why this would cause the problem?

John Montenigro

Hey Marty,
I can't answer your question directly, so I'd like to find out some more info.

With regarrd to "doing an initial search of the SQLite DB", you wrote that you "moved that code out of the Form1_Create function".

OK, so where did you move it to? If a standalone SUB or FUNCTION, did you keep a call to it at the end of the Form1_Create function? Or, did you move the invocation to another place as well?

Same questions for loading the textbox.

Perhaps some code (before/after) might be helpful to see exactly the changes you made.