Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I ensure only one copy of VFP is running?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00256693
Message ID:
00258292
Views:
23
>There are a couple of ways to do this. Vlad Tatavu has code here that will do this, or you could use my Is_Run32() function to check for the main form's title bar. That's also available in the download section. I prefer to use the technique I wrote about in the Nov. 98 issue of FoxPro Advisor. The URL is http://www.advisor.com/wArticle.nsf/wArticles/FA9811.TASKG05. There's also an update posted there as well. (http://www.advisor.com/wArticle.nsf/wArticles/FA9811.TASKG05UD).


I hate to bother you about this again, but I'm having problems getting your code example to run. I'm not much when it comes to object oriented programming, I just know enough to get by in FoxPro and avoid it like the plague.

I assumed the code segments (except for the last segment) belonged in a class, so I put all the code (again, except for the last segment) between:

DEFINE CLASS Mutex AS Custom
.
.
.
ENDDEFINE

Then I took the final code segment and built it into the code that I use to start my program. When I run it I get four errors, one right after another:

Property cFormCaption is not found.
Property hMutex is not found.
Property nMutexError is not found.
Property nMutexErr is not found.

Then when I exit I get one more:

Property hMutex is not found.


Right inside this class definition is:

WITH This
.cFormCaption = lcFormCaption
.hMutex = CreateMutex(0, lcInitOwner, @lcname)
.nMutexError = GetLastError()
ENDWITH

So I don't know why it can't find these properties, aren't these properties supposed to be created with the previous statement? Or am I just clueless about OOP?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform