BUG: "String is too long to fit" Error Passing Variables to COM (188888)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a

This article was previously published under Q188888

SYMPTOMS

The error message "String is too long to fit." is received when a character variable is passed by reference to a Visual FoxPro COM server, either a DLL or EXE.

CAUSE

This error is received if the character variable exceeds 255 characters.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Place the following code into a new program file and save it as Test.prg:
          DEFINE CLASS test AS custom OLEPUBLIC
             Name = "test"
             PROCEDURE vartest
                Parameters xx
                xx=xx+"ddd"
                RETURN "Hello"
             ENDPROC
          ENDDEFINE
  2. Create a new project and add the program from step 1 above to the project. Name the project Test.pjx.
  3. From the Project Manager, build either an Executable or an OLE DLL. Name it Test.exe or Test.dll.
  4. Place the following code into a new program file and run it:
          CLEAR
          x=CREATEOBJECT("test.test")
          IF TYPE("x")!="O"
             RETURN
          ENDIF
          z=REPLICATE("z",256)
          ? x.vartest(@z)
          ? z
          RETURN

Modification Type:MajorLast Reviewed:12/11/1999
Keywords:kbbug KB188888 kbAudDeveloper