Link to home
Start Free TrialLog in
Avatar of coldfusionguy
coldfusionguy

asked on

visual foxpro spellchk.app doesn't work

Here's the code.

Use inventory
define window memo1 name oSpellCheck title "Spell Checker" from 7,44 to 24,92 double zoom
oSpellCheck.autocenter=.T.
Modi memo inventory.ocr window memo1 nowait
do 'c:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\spellchk.app
Close memo inventory.ocr
release window memo1

when it executes the line spellchk.app it says source is not available.

This is Windows 7.  spellchk.app is from a VFP5 install. However this is VFP9. It was working on a different XP computer before. I've tried the compatibility box for XP service pack 2 and 3. No luck.

Please advise. Thanks!

Avatar of Cyril Joudieh
Cyril Joudieh
Flag of Lebanon image

Maybe it is designed to call a 32-bit function which is now 64-bit in Windows 7? Or maybe it does not have access privileges to a certain folder.
SOLUTION
Avatar of Cyril Joudieh
Cyril Joudieh
Flag of Lebanon image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
VFP is backward compatible, but you can't expect objectcode of VFP5 to work in VFP9. I'd say you need sources and need to recompile in VFP9.

Cyril points you to a completely new and different spell checker done by Craig S- Boyd. You should perhaps go that route. VFP9 does still have the _spellchk system variable, so in principle it would support a spell checker for the vfp text editor, but there is neither spellchk.app, nor is there a spellchecker source code in the xsource directory or in tools. Spellcheckíng is no part of vfp9 anymore.

Bye, Olaf.
I also use Word's spell checker but I have done it in a different way using RTF controls.
Avatar of coldfusionguy
coldfusionguy

ASKER

Thanks for the comments, but as I mentioned before, this did work in VFP9 on an XP computer. I'm running this on a 32 bit Windows 7 machine and  I've shared the folder where the spellchk.app is located. I've tried the Word spell checker but can't get it to work either. I don't think Craig Boyd's spell checker lets you type in different spellings that are not already in his dictionary. It seems pretty limited.

Any other ideas?
Then I would check what the spellchk.app is accessing and allow those folders. Windows 7 is very stringent with access privileges. It could also be the temporary folders where the spellchk is using.
Well, I'd say you should set the _spellchk system variable at runtime, and for sure endusers won't have a VFP program folder, that is not legal to distribute, so the spellchk.app file needs to be in your applications folder or in some extra folder, eg in appdata or c:\Users\Public\

User will just need read and execute rights on the app file, so your application directory should be sufficient, but it does not automatically install, does it?

Bye, Olaf.
Windows XP is very forgiving if you create files in Program Files or execute an app in any folder. Windows Vista and 7 are sure not.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To eliminate one possibility in the Win XP vs Win7 comparison, try turning off Win 7 User Account Controls  to see if it makes a difference.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've did more investigations...

VFP 6 SpellChecker works in my Vista under VFP 9 SP2 executed under Admin account. Vista has similar restrictions as W7, so it should be fasible.

BUT, read this: http://support.microsoft.com/kb/175620/en-us?fr=1
You will need VFP 6 installed on every computer which uses SpellChecker...
Yes, I understand the limitations re: distribution. That's no problem as we only have one workstation that uses it. But why VFP 6?
Why VFP6? It is the last VFP version delivered together with spellchk.app. I cannot say if this version differs from the one delivered together with VFP 5 because I don't have it at hand just now.

You should also check whether all C libraries necessary for the spellchecker are present on the W7 computer.
I'll give that a shot. thanks.
Ok, I'm kinda back to the best place I've been with this, but it's still not working 100%.

The spell checker works, then when the spell check dialog box is closed I get 5 messages that say there are syntax errors. No other code is running. I've shared the c:\devstudio and c:\devstudio\vfp folder with everyone.

SET PATH TO c:\devstudio\vfp
RELEASE WINDOWS
CLOSE all
USE table2
DEFINE WINDOW SpellChecker FROM 0,0 TO 50,50 NOZOOM float
ACTIVATE WINDOW SpellChecker
MODIFY MEMO abstract WINDOW spellchecker nowait
DO c:\devstudio\vfp\spellchk.app

What should I try next? Thanks.
This is installed on yet another windows 7 test computer. I installed VFP5 first (I don't have a VFP6) and then I installed VFP9 with Security Pack 2 installed.

Yes, I know about the Word alternative. But I haven't been able to focus on reprogramming it. I'm so close to getting the original solution to work.
DO these error messages say something about Method and Line number?
No, just syntax error, 5 times. It does finish the spell check properly though. It replaces misspelled words and everything seems fine. It's just when it closes down the spellchk.app that these errors occur. This did happen before on the XP computer.
Probably cleanup deleting stuff.
If you change ON ERROR then it could tell more (or suppress the message completely).
I've been successful in suppressing the error messages! However, I'd like to see what messages I can get out of it though. So far, only Syntax Error. How would I get more verbose errors to show? Thanks.
ON ERROR WAIT WINDOW "Error: " + TRANSFORM(ERROR()) + " " + MESSAGE() + ;
   CHR(13) + "Line: " + TRANSFORM(LINENO()) + " " + MESSAGE(1) + ;
   CHR(13) + "Module: " + SYS(16)

To provide an output LINENO() and MESSAGE(1) requires debug info in compiled code. Spellchk.app does not contain it most probably.

BTW, did you hear about Refox?
Refox looks great. We don't package software though; we just use it for in house programs such as a home grown book cataloguing system for Mail Order Manager.

I'll give the On Error a shot later today or tomorrow and will report back.
Hard to decide... I would recommend to split points:
https:#a36979177
https:#a36977652
https:#a36979958
Split points just as pcelba suggests.