| View previous topic :: View next topic |
| Author |
Message |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Tue Jul 01, 2003 12:03 pm Post subject: |
|
|
Yes, it looks like an effect of bad code taken from a very early DLL programming example. I personally haven't used that code in any of my DLLs, hence I never encountered the problem. I can't quite figure out what's going wrong, but Tommy's solution certainly seems to fix it. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Tue Jul 01, 2003 1:49 pm Post subject: |
|
|
The example source code in question is still being distributed:
http://www.dialogscript.com/dl/extdoc10.zip
Most of all VDS DLLs written in Delphi are based upon this example.
However I've heard from Commercial Research Ltd. (unofficially) that this SDK is being
updated. |
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Wed Jul 02, 2003 2:13 am Post subject: |
|
|
Excellent news!
I just made the changes Tommy told me to... And VDSMEDIA is now compatible with VDS 5, and will be available real soon!
All my other extensions will be modified also. For those who paid for any of my extensions, you will receive the new version of the DLL by email... of course free of charge
Also VDSXSHOW isn't freeware anymore, it will be updated with new commands and functions... but that is more for the future....
Thanks. 
Last edited by marty on Thu Apr 12, 2012 1:53 am; edited 1 time in total |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jul 02, 2003 11:48 am Post subject: |
|
|
Really excellent, great job, Marty! I'm very happy to hear this news!
Thanks for taking the time for this!  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Wed Jul 02, 2003 2:06 pm Post subject: |
|
|
| jules wrote: | | Tommy's solution certainly seems to fix it. |
What is Tommy's solution? I see all these post back and forth and I have downloaded his example that points out the problem with the MaxPar varaible being used instead of a real errorcode but I must be blind or something be cause I don't see any solution being posted.
Here is what I have found to be the problems with my DLL's. The Init function returns this for most Delphi DLL's
Result:='MYCOMMAND';
This should be a pointer to an actual character array and not to something volitile like this code. If this string that is returned has to be read by the runtime again then that memory may no longer be valid or worse garbage.
IMHO You really should put the name of your command/function in a global or static character array and return a pointer to that character array as the result of the Init function. Also for that matter you should do the same for the FuncProc function since it returns the same variable type.
As for my DLL's I did not have to do anything with the MAX_PAR variable or anything like that and the DLL's are working and returning the error codes that I have defined. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jul 02, 2003 2:08 pm Post subject: |
|
|
| mindpower wrote: | | What is Tommy's solution? I see all these post back and forth and I have downloaded his example that points out the problem with the MaxPar varaible being used instead of a real errorcode but I must be blind or something be cause I don't see any solution being posted. |
Check out http://developer.vdsworld.com/  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Wed Jul 02, 2003 2:21 pm Post subject: |
|
|
| marty wrote: | ...VDSMEDIA is now compatible with VDS 5, and will be available real soon!
All my other extensions will be modified also. For those who paid for any of my extensions, you will receive the new version of the DLL by email... of course free of charge  |
Woohoo! Right on Marty... thank you very much for updating your excellent extensions!  _________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Wed Jul 02, 2003 2:31 pm Post subject: |
|
|
| FreezingFire wrote: | | mindpower wrote: | | What is Tommy's solution? I see all these post back and forth and I have downloaded his example that points out the problem with the MaxPar varaible being used instead of a real errorcode but I must be blind or something be cause I don't see any solution being posted. |
Check out http://developer.vdsworld.com/  |
Thanks FF _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jul 02, 2003 2:33 pm Post subject: |
|
|
No problem.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Thu Jul 03, 2003 3:08 am Post subject: |
|
|
| mindpower wrote: | | What is Tommy's solution? I see all these post back and forth and I have downloaded his example that points out the problem with the MaxPar varaible being used instead of a real errorcode but I must be blind or something be cause I don't see any solution being posted. |
The problem in the Delphi based DLLs seems a bad NextParam function. This doesn't
apply to DLLs made in C/C++ as they use a whole new NextParam function anyway.
| mindpower wrote: | Here is what I have found to be the problems with my DLL's. The Init function returns this for most Delphi DLL's
Result:='MYCOMMAND';
This should be a pointer to an actual character array and not to something volitile like this code. If this string that is returned has to be read by the runtime again then that memory may no longer be valid or worse garbage.
IMHO You really should put the name of your command/function in a global or static character array and return a pointer to that character array as the result of the Init function. Also for that matter you should do the same for the FuncProc function since it returns the same variable type. |
This code is fine. The "MYCOMMAND" string constant will be compiled in the code.
It will never be changed during the execution of the DLL. Of course if this would be
a dynamic value, such as in FuncProc, this would be different.
| mindpower wrote: | | As for my DLL's I did not have to do anything with the MAX_PAR variable or anything like that and the DLL's are working and returning the error codes that I have defined. |
The problem isn't really related to the maxpar value, but it's what makes the problem
confusing. VDS would never return errorcode 27 anymore if there's an exception
error in the DLL, instead it would return the maxpar based value. Errors returned
explicitely by the DLL, of course, will work just fine. |
|
| Back to top |
|
 |
|