As dan said it should be ... myclass OF myclassfile.vcx, ideally with the full path to the vcx/vct file pair.
Besides, as the VFP task pane registers web services, it also registers intelllisense for the web service methods by adding to foxcode.dbf.
You can add your own classes, too, via Intellisense manager, it will generate the needed record(s) in foxcode.dbf for you.
1. Start Intellisense Manager from Tools->Intellisense Manager
2. Activate the tab "Types".
3. Click the button "classess..."
4. Add your vcx.
5. Now in any code editor, type LOCAL loMyVar AS
at this point intellisense will offer you a list of types, the standard base types and now also including your own classes of the vcx added in step 4.
6. In the end if you choose "myclass" you will have a line like that:
Code:
Local loMyVar AS myclass OF "c:\users\youraccount\own documents\...etc. etc...\myclasslib.vcx"
You could also do this on your own but it's much easier this way, isn't it? Intellisense Manager knows your locations this way and you don't have to remember.
7. Now after you have that, typing loMyVar. does display your class methods etc. via intellisense.
It does so even before you set loClass = CreateObject("myclass"), but you show you know this already, as you posted the essential SET CLASSLIB and CREATEOBJECT() as proof of having an understanding of vcx classes, even if you say this is your first visually created class - you've got that correctly, yes!
So you know you're still responsible to do that and to SET CLASSLIB in advance, or use NEWOBJECT() instead. This way of "strong typing" variables is indeed only helping with intellisense, nothing else.
Just one thing: You don't need set classlib before
every createobject(), you set this in main.prg for all VCXes of your project in one go, typically.
So to summarize: You have to SET CLASSLIB and you have to CREATEOBJECT("theclass"). I just clearly mention this for anyone else reading and thinking this is a way of writing safer code, unfortunately it's not. It has to stand the test of runtime, still. It's jsut an intellisense helper.
Last not least there is no such syntax as classlib.class for a class name or type of a variable. This nameing convention is just a default for OLE Public classes, but doesn't start with vcx name, it starts with EXE or DLL file name containing the OLE public class after build. Well, this is going off topic now. Just follow steps 1-6 above and you'll get your intellisense in step 7.
Bye, Olaf.