NEWOBJECT problem

Of the 10,000 or so installations of our program, I have a problem with ONE client.   We do a program call:

ortb = NEWOBJECT(rtf1, rtf1.vcx)

That normally returns a VARTYPE(ortb) = "O"  (object)

But on this one clients machine it return an "L" (logical)

I tried for a lark to allow "L" types to pass, but now a get an object error.  Any idea why this program sees the VARTYPE as an "L" instead of an "O"?

Frank
FrankatGoldenOmegaCEOAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gheistCommented:
ortb = cast(NEWOBJECT(rtf1, rtf1.vcx) as O) ?
0
pcelbaCommented:
If you declared the ortb variable as LOCAL or PUBLIC  then it has the logical data type initialized to .F. value prior to the NEWOBJECT() function call...

So the logical value indicates the object creation failure.

The reason can be whatever and the simplest solution is to reinstall the client's workstation. More sophisticated solution would be to fix/reinstall just the RTF component which the rtf1.vcx class probably uses but I cannot say more as I don't know what rtf1.vcx really does.

You should test the object creation from VFP.EXE directly on that PC.

Possible work around:
1) You could try to execute  DO EVENTS FORCE  before the NEWOBJECT(). It allows to process pending Windows events and RTF object creation does not need to wait for necessary resources.
2) Call the NEWOBJECT() three times in a loop (with DO EVENTS FORCE inside). If it fails three times then something is wrong with the PC... and we are back in the PC reinstallation...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.