Robs Programming Junk
Welcome to my programming blog!With some luck you will find some tasty nuggets of information here. If you do find something please post a comment on where or how you used it. I like to see what sort of impact my work has on others.
Friday, September 15, 2006
VFP: User interface not allowed at this time
While trying to use a foxpro COM object in .NET for a project I'm working on I ran into this little problem.
VFP: User interface not allowed at this time
Intresting enough it makes sense. The .DLL by law cannot have interfaces to it. VFP 6 at least doesnt suppress this when it compiles a DLL. I don't know about future versions such as 9 installed on my machine, but our production code is stuck in 6.0 for the moment.
The easiest work around for this was to compile it as a COM EXE server. This allows for the wait windows to show up in the upper right of the machine on the desktop window.
Which is a very intresting point. I'm quite surprised that the same EXE that you compile for any other foxpro application can also act as a com server. Simply exposing the class via OLE PUBLIC specification seems to be more than enough to use any EXE as a COM server and allow another application to use that server.
While I can use the work around, I don't really agree with it. VFP should have supressed the calls to the WAIT WINDOW in the DLL Compile and compeltely ignored that output. I can see if I was making a MESSAGEBOX call, but with a wait window it should have just been surpressed. Ultimately I'd remove the wait windows and make it a true DLL but I'd have to bust open too much legacy code.
On the other side of things, one additional note about this project. When using a COM object made in foxpro from within .NET, make sure youre cleaning up your objects. As anyone who's used foxpro for any great amount of time knows, it makes for lazy programmers. V ariables are often not cleaned up . Foxpro doesnt care and thus you can get some unpredictable results as part of you com object use.
I suggest that you use the .NET System.Runtime.InteropServices and call the Marshall.ReleaseComObject() at the end of each call to you com object. You can avoid this by writing really good foxpro code, but few people do that.
VFP: User interface not allowed at this time
Intresting enough it makes sense. The .DLL by law cannot have interfaces to it. VFP 6 at least doesnt suppress this when it compiles a DLL. I don't know about future versions such as 9 installed on my machine, but our production code is stuck in 6.0 for the moment.
The easiest work around for this was to compile it as a COM EXE server. This allows for the wait windows to show up in the upper right of the machine on the desktop window.
Which is a very intresting point. I'm quite surprised that the same EXE that you compile for any other foxpro application can also act as a com server. Simply exposing the class via OLE PUBLIC specification seems to be more than enough to use any EXE as a COM server and allow another application to use that server.
While I can use the work around, I don't really agree with it. VFP should have supressed the calls to the WAIT WINDOW in the DLL Compile and compeltely ignored that output. I can see if I was making a MESSAGEBOX call, but with a wait window it should have just been surpressed. Ultimately I'd remove the wait windows and make it a true DLL but I'd have to bust open too much legacy code.
On the other side of things, one additional note about this project. When using a COM object made in foxpro from within .NET, make sure youre cleaning up your objects. As anyone who's used foxpro for any great amount of time knows, it makes for lazy programmers. V ariables are often not cleaned up . Foxpro doesnt care and thus you can get some unpredictable results as part of you com object use.
I suggest that you use the .NET System.Runtime.InteropServices and call the Marshall.ReleaseComObject() at the end of each call to you com object. You can avoid this by writing really good foxpro code, but few people do that.
View my portfolio at iFreelance.com
Hire MechSoftware for Quality Assurance (QA), Database Programming, and Security Design/Programming
Find QA Freelance Jobs at iFreelance.com
Hire MechSoftware for Quality Assurance (QA), Database Programming, and Security Design/Programming
Find QA Freelance Jobs at iFreelance.com
Recent Posts
VFP: Inserting Nodes with XML Object
Linux: Dell Latitude LM, XWindows, Neomagic Magicg...
CIO Blogs - Could "Found Code" Cripple Your Compan...
Links for .NET security info
TechToolBlog 195 Free Online Programming Books
Convert String to Byte Array
Sql Server Row Size Limit - Rick Strahl's WebLog
Visual Studio Express
VB.NET: Base 36 Function
BLOGGER: You can use GeSHi in your blogger posts
Archives
01/01/2005 - 02/01/200502/01/2006 - 03/01/2006
03/01/2006 - 04/01/2006
04/01/2006 - 05/01/2006
05/01/2006 - 06/01/2006
09/01/2006 - 10/01/2006
10/01/2006 - 11/01/2006
11/01/2006 - 12/01/2006
12/01/2006 - 01/01/2007
04/01/2007 - 05/01/2007
05/01/2007 - 06/01/2007
01/01/2008 - 02/01/2008
02/01/2008 - 03/01/2008
05/01/2008 - 06/01/2008
06/01/2008 - 07/01/2008
08/01/2008 - 09/01/2008
09/01/2008 - 10/01/2008
11/01/2008 - 12/01/2008
12/01/2008 - 01/01/2009
01/01/2009 - 02/01/2009
02/01/2009 - 03/01/2009
04/01/2009 - 05/01/2009
05/01/2009 - 06/01/2009
07/01/2009 - 08/01/2009
01/01/2010 - 02/01/2010
My Software
Blinky - GBPVR PluginPhotoCopy - GBPVR Plugin
QTC - Quick Test Case
rBoop - Rob's Timers
Programming Links
C# FormatterNSIS
Other Links
Damn Small LinuxSites I Manage
Do it yourself SEO. Cheap.Pet Supplies
Dog toy of the month club
SqueakerZ pet Deals
Geocaching Community
Hitch hiker Tracking