Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class Error in Foxpro VPME6

Status
Not open for further replies.

CCHSR

Programmer
Aug 3, 2005
15
US
IF TYPE('This.oSession') <> 'O'
This.oSession = CREATEOBJECT('Session')
IF TYPE('This.oSession') <> 'O'
RETURN .F.
ENDIF
* Set the environment of the private data session.
This.SetPrivateDataSessionEnvironment(This.oSession.DataSessionID)
ENDIF
Every time I try to start the program after compile I get Class definition session not found,
what am I missing?
 
'This.oSession' = string ( quotes)

just remove the quotes in the IF

IF(This.oSession)<>'O'





When I said that I was concentrated on programming, so my state of consciousness was attenuated
 
sorry
IF TYPE(This.oSession)<>'O'


When I said that I was concentrated on programming, so my state of consciousness was attenuated
 
No, okarl, TYPE needs the quotes, that's not the error.

Session is a native class of VFP, but there are old versions not having it, check out which runtime version your EXE uses.

Chriss
 
I checked it very fast on an old version , that initially was for VFP6, but I am sure is working on 9 , so is a bit confusing ( I mean my age)

 
I never heard the introduction of a new class or even just a function in a service pack, but the version introduccing a new feature is not documented in any topic, everything that's new always has a chapter What's new in the help. VFP6 had 5 servce packs, didn't it? NOt because VFP itself needed 5 packs, but because it was part of the Visual Studio, still. Before the first .NET Studio.

If I take the availability of runtime installers from VFP6 SP5 is the latest for that. VFP5 only had one SP and VFP3, too.

On Github they only moved the RT installers for the latest versions of VFP6-9, each:
It's embedded into an EXE which runtime it needs, if it's not present it won't start. That's not part of an APP or FXP, though, and there you could get into trouble, if a VFP6 execuatable runs an FXP compiled with VFP7 or later, that could lead to that error of not finding a native class. Otherwise it's quite impossible, the runtimes always know the native VFP classes.

Chriss
 
Chriss said:
I never heard the introduction of a new class or even just a function in a service pack

I hadn't either. But I've just done a bit of searching, and I found the following in Hacker’s Guide to Visual FoxPro:

HackFox said:
Session
Until this base class was added in VFP 6 Service Pack 3, the only way to create an object with its own private data session was to base it on Form, FormSet, or Toolbar .... Fortunately, we now have the Session base class.

I was surprised as you were. But, in any case, it wasn't present in the original VFP 6.0 - or, if it was, it wasn't mentioned in the Help.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hello CCHSR,

it would really be helpful if you return to your thread and tell us whether we could help with the information. Also to clarify what VPME6 is, I can imagine it's a Foxpro framework you're using. It wouldn't matter much because the session class is a native Foxpro class and by Mike Lewis research we know it exists since VFP6 with SP3. And since then it can't be made unknown to VFP. If a class is a native part of the VFP language it always exists, unlike a class designed and defined in a PR or VCX class libarary. No matter if you talk of just pure VFP or VFP with a framework. The only reason that class would not be known is you're using an older VFP version and someone designed a class for such older Foxpro version. Perhaps based on the form class, but not using the main visual form aspect of it, just the forms datasession.

In that case you would have to include the appropriate class definition into your project to not get this error. But that would be a general problem applying to any framework class you use, of course the framework itself must be part of a project based on framework classes. Then it should also be covered by the documentation and helpfle of that framework in a getting started or how to make use of that framework, as it's a very essential and basic step to be able to compile and run an EXE you create using that framework.

Chriss
 
Hey Chris !

I came up with one of my crazy ideas.
I have a project using the session class. It is a simple tool that does nothing but creating new Procedures and controllers 'on the fly'. we can joint efforts an make it a rare specimen if you wish.

I advise you that's going to get some Haters audience, but do not worry , the community will defend us.

It is funny and crazy enough, The worst thing that could happen is that they take us for weird and we lose some friends.
Would you take the risk ?

okarl

EDIT: Sorry for trolling this thread, the appropiate one should be ... And now I don't know how to move it
 
Well, the simplest would be edit, copy into clipboard, delete here and repost there.

I just know I'll not be around to maintain something and do services/support - if you think of making it a GitHub repository. That's why I don't have a GitHub or a homepage with VFP tools or products. I rather only provide concrete help. That's less binding, but more important more to the point of what someone just needs to get on. Even if something like that can benefit from making it a more mature produc - in the end I always make the experience the more mature you make code the more there is to learn about using it and I am able to document something, but that always feels like it's never read. The laziness of many people to read documentation and instructions shows up in the need of support.

But take it and make it your own.

Chriss
 

Thank you Chris

You are right about reading manuals, people can buy a Tesla car without knowing it couldn't be charged under 0ºC, or that those tires are not for snow or.... things like that.

I also agree that GitHub is not the best site for all, you'll need to fast reach a point that is applicable for business, but is good for helping discover weaks and bugs.

I know any experimental 'thing' has a lot of risks associated, like the first 6 rockets of SpaceX, but the goal is not for selling a rocket in the next 50 years, is just to improve technology, and the only way is fail again and again.

Isnt't worth the effort and time ? truth ( that is the crazy part of it) The motivation is just one, if it sounds impossible enough, then let's try it !!

Chen/Rick and many others spent a lot of effort and time to solve and enhance doing us the life much easier, my respect and grateful, but also gave us a lesson to keep the spirit of innovation 'awake' , even if it is hard, so double respect for them.

okarl
 
Thanks for all of your help and suggestions, I found a copy of newer classes that were on another system I have,
I copied them over to the system giving me trouble and it fixed the issue,
Thanks Again
By the way VPME6 and VPM9 are framework from Visual Promatrix which is now all done,
great product and I am still using it today, only the VFP9 version.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top