forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


VDS 5 extension exceptions

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Tue Jul 01, 2003 3:41 am    Post subject: VDS 5 extension exceptions Reply with quote

If any exception occurs in an extension DLL, VDS is supposed to return error 27:
Untrapped error in an external command or function.

VDS 5 doesn't return error 27 in such cases, unlike older VDS versions. Instead it
will return an error based on the extension's maxPar value, increased by 1.

The following slightly modified version of the DLL in extdoc10.zip clearly illustrates
the problem:
http://www.vdsworld.com/files/vds5extbug.zip

The only line that is added in it, is this one:

raise EConvertError.Create('Error 27 should be returned now, but instead maxPar + 1 is returned.');
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue Jul 01, 2003 8:33 am    Post subject: Reply with quote

Thanks for posting this example, Tommy. I have tested it, and reported to Commercial Research what I think the problem is.

Incidentally, I was wrong when I stated in an earlier post that the maxpar value is no longer needed. It is. It is only the bufsize value that is ignored.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Tue Jul 01, 2003 11:45 am    Post subject: Reply with quote

I would like to personnaly thank Tommy for his research on this problem. Hope this will help resolve the VDS 5 problems that has been encountered with lots of extensions.


Hope Commercial Research will resolve this problem soon. Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Tue Jul 01, 2003 12:27 pm    Post subject: Reply with quote

Yes Tommy, thank you for finding what the exact problem is. Thumbs Up
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Tue Jul 01, 2003 3:23 pm    Post subject: Reply with quote

Tommy rocks! Cool
_________________
"ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player...
Back to top
View user's profile Send private message Send e-mail
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Wed Jul 02, 2003 1:24 pm    Post subject: Reply with quote

jules wrote:
Thanks for posting this example, Tommy. I have tested it, and reported to Commercial Research what I think the problem is.

Incidentally, I was wrong when I stated in an earlier post that the maxpar value is no longer needed. It is. It is only the bufsize value that is ignored.


Hi All,
I don't know if Delphi has limitations when it comes to the length of character arrays but most C/C++ compilers for Win32 do have a limitation to the number of characters that can be in a character or byte array and that is 4096. All DLL developers should consult their documentation to see what the limits are. I just wanted to throw in my 2cents.

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Alex
Newbie


Joined: 29 Jan 2004
Posts: 2
Location: Germany

PostPosted: Thu Jan 29, 2004 8:02 am    Post subject: Reply with quote

jules wrote:

Incidentally, I was wrong when I stated in an earlier post that the maxpar value is no longer needed. It is. It is only the bufsize value that is ignored.


I'am using my own external dll and up to now I have used the bufsize Parameter. But if this is ignored, how do I know the size of the buffer I get from VDS.
As an example:

If I set maxpar to 20 and I call a funktion with only one Parameter are there 19 empty strings in the buffer, so I just have to receive all 20 Parameters with getNextParm without needing to know the buffsize?


javascript:emoticon('Very Happy') Every help is welcome!
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Thu Jan 29, 2004 9:21 am    Post subject: Reply with quote

Maxpar is only used by VDS so it can pad out every string passed to an extension with extra empty strings in order that an error does not occur when the params/arguments are read. In fact, maxpar is a global value for VDS so all extensions will receive strings padded to the largest value of maxpar specified by any of the extensions that have been loaded. (It just means the addition of extra null bytes on the end of the string.) The reason is to avoid the access violation that would occur if the extension called NextParam more times than the number of values that were actually supplied by the calling script.

Bufsize was required by earlier versions of VDS which reserved a block of memory to receive the string passed from the return value of a function back to VDS. VDS 5 has been improved so that you can pass any length of string or PChar it is reasonable to return as the return value of a function, therefore it is not necessary to specify a maximum size.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Alex
Newbie


Joined: 29 Jan 2004
Posts: 2
Location: Germany

PostPosted: Thu Jan 29, 2004 9:28 am    Post subject: Reply with quote

Very Happy

Many thanks for that very quick and great answer. Now I'm sure, that I use the parameterbuffer in the right way.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group