Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / FoxPro / Setup / April 2004

Tip: Looking for answers? Try searching our database.

Custom Class with 17 parameter cause Visual C++ Runtime error on VFP8

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric Lim - 12 Apr 2004 12:21 GMT
Hi all,

I created a custom class with a method containing 17 parameters and
thereafter add that class onto my form. When I use the code viewer to view
my custom class method it displays

Microsoft Visual C++ Runtime Library

Buffer overrun detected!

Program : VFP8.exe

A buffer overrun has been detected which has corrupted the program's
internal state. The program cannot safely continue execution and must now be
terminated.

Any one have any idea? I use VFP7 and try the same sequence and it works
fine! If I were to reduce it to 16 parameters then it works fine too. I
thought Parameters can accept up to 26 parameter list?

---
Eric Lim
Personal: ericlim@pacific.net.sg
Business: eric@arkinfo.com.sg
Rick Bean - 12 Apr 2004 14:47 GMT
Eric,
While I can't confirm this right now, have you considered passing a single object as the parameter? It could have as many properties as you want and you could use the VFP 8.0 Empty class as it's base.

Rick

> Hi all,
>
[quoted text clipped - 20 lines]
> Personal: ericlim@pacific.net.sg
> Business: eric@arkinfo.com.sg
Eric Lim - 13 Apr 2004 04:44 GMT
Hi Rick,

If these problems cannot be resolved then I will use object or array as
parameter storage. Thanks for your suggestion.

> Eric,
> While I can't confirm this right now, have you considered passing a single
object as the parameter? It could have as many properties as you want >and
you could use the VFP 8.0 Empty class as it's base.

> Rick
Eric den Doop - 12 Apr 2004 21:10 GMT
Hello, Eric!

I can't reproduce this behavior. I tried it with a blank VFP form and a
subclassed Label control and a custom method called Dummy. Can you post the
exact steps to reproduce the error?
Signature

Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8

Eric Lim - 13 Apr 2004 04:42 GMT
Hi Eric,

Here is the step:-

1) Firstly create a custom class and within it create a method call
testmethod() with these parameters

Parameters
longVariableName1_c,longVariableName2_c,longVariableName3_c,longVariableName
4_c,longVariableName5_c,longVariableName6_c,longVariableName7_c,;
longVariableName8_c,longVariableName9_c,longVariableName10_c,longVariableNam
e11_c,longVariableName12_c,longVariableName13_c,longVariableName14_c,;
longVariableName15_c,longVariableName16_c,longVariableName17_c

NOTE : If I use shorter variable name it works fine.

2) Create a form and add the custom class into it.

3) Open the code viewer and try to view TestMethod() in the custom class.
After you view the TestMethod() move to another method and come back to
TestMethod() again, buffer overrun will occur.

"Eric den Doop"
> Hello, Eric!
>
> I can't reproduce this behavior. I tried it with a blank VFP form and a
> subclassed Label control and a custom method called Dummy. Can you post the
> exact steps to reproduce the error?
Fred Taylor - 13 Apr 2004 06:48 GMT
So why do you need these long variable names?  You can certainly use shorter
names in your COM object, long names for variables are not required.

Fred
Microsoft Visual FoxPro MVP

> Hi Eric,
>
[quoted text clipped - 4 lines]
>
> Parameters

longVariableName1_c,longVariableName2_c,longVariableName3_c,longVariableName
> 4_c,longVariableName5_c,longVariableName6_c,longVariableName7_c,;

longVariableName8_c,longVariableName9_c,longVariableName10_c,longVariableNam
> e11_c,longVariableName12_c,longVariableName13_c,longVariableName14_c,;
> longVariableName15_c,longVariableName16_c,longVariableName17_c
[quoted text clipped - 14 lines]
> the
> > exact steps to reproduce the error?
Eric den Doop - 13 Apr 2004 10:08 GMT
Hello, Eric!

OK, I was able to reproduce this in VFP8SP1.
Signature

Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.