Microsoft KB Archive/317493

= FIX: &quot;Unable to Find Visual Class Library&quot; Errors When You Build a Project with a NewObject Function =

Article ID: 317493

Article Last Modified on 3/6/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 7.0 Professional Edition

-



This article was previously published under Q317493



SYMPTOMS
When you build a project that includes a program or method that contains the NewObject function, and the program passes the NewObject function a long parameter that calls a Visual FoxPro function, the following error messages may appear:

Unable to find Visual Class Library PASSING A LONG STRING AS A NEWOBJECT EPARAMETER1,

-and-

Unable to find Visual Class Library VFP 7

This problem does not occur when the parameter does not contain a Visual FoxPro function call.



RESOLUTION
To resolve this problem, obtain the latest service pack for Visual FoxPro for Windows 7.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

316964 How to Obtain the Latest Visual FoxPro for Windows 7.0 Service Pack



STATUS
Microsoft has confirmed that this is a problem in Microsoft Visual FoxPro for Windows 7.0. This problem was first corrected in Visual FoxPro for Windows 7.0 Service Pack 1.



Steps to Reproduce Behavior
Paste the following code in a program (.prg) file named Test.prg and then run the program from the Command window.

Note: If you use the Project Manager to build the project, you receive the same error messages.
 * 1) DEFINE PROJNAME 'testxx'

CLEAR ALL SET SAFETY OFF CLEAR DELETE FILE PROJNAME+ '.pj?' DELETE FILE PROJNAME+ '.exe' TEXT to lcProgram NOSHOW

newobject(&quot;TestClass&quot;,&quot;mainxx.prg&quot;,&quot;&quot;, ; &quot;This is a test of a strange behavior of the&quot;+CHR(32)+ ; &quot;Test1 VFP7 Project Manager. Something to do with &quot;+ ; &quot;passing a long string as a NEWOBJECT eParameter1, &quot;+ ; &quot;and that string including a function call.&quot;)

newobject(&quot;TestClass&quot;,&quot;mainxx.prg&quot;,&quot;&quot;, ; PROGRAM + &quot; This is a test of a strange behavior of the &quot; + ; &quot;XFP 7.0 Project Manager. Something to do with &quot; + ; &quot;passing a long string as a NEWOBJECT eParameter1, &quot; + ; &quot;and that string including a function call.&quot;)

newobject(&quot;TestClass&quot;,&quot;mainxx.prg&quot;,&quot;&quot;, ; &quot;Note that this string is just about as long, but does not &quot; + ; &quot;generate an error in the VFP 7.0 Project Manager. &quot; + ; &quot;Something to do with &quot; + ; &quot;passing a long string as a NEWOBJECT eParameter1, &quot; + ; &quot;and that string including a function call.&quot;)

RETURN

DEFINE CLASS TestClass AS Custom PROCEDURE Init(tcString) MESSAGEBOX(tcString) ENDPROC ENDDEFINE

ENDTEXT

=STRTOF(lcProgram,'mainxx.prg') CREATE PROJECT PROJNAME NOWAIT LOCAL pj AS VisualFoxpro.IFoxProject pj=_VFP.APPLICATION.ACTIVEPROJECT pj.DEBUG = .F. pj.FILES.ADD('mainxx.prg') ? pj.BUILD(PROJNAME,1,.T.,.T.) ? pj.BUILD(PROJNAME,3,.T.,.T.) pj.CLOSE RETURN
 * Rebuild the project and display errors if there are any.
 * Build an executable and display errors if there are any.

Additional query words: kbVFP700sp1fix

Keywords: kbbug kbfix kbprojmanager kbcodesnippet KB317493

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.