FreeUDFLib and developing UDFs in Delphi XE5

I've used FreeUDFLib (from Gregory Deatz, et al) extensively with D7, and managed to compile extra functions within its framework which have proved invaluable (thanks to these developers for this library!!) Now, I'm looking at compiling the same library in XE5 - but it would appear to be in need of an overhaul! Yes, it does compile in XE5, but there are problems...

1. Firstly, I gather there is no contemporary equivalent/port of FreeUDFLib (ie it stopped being developed long ago) - is that true?

2. With all the changes in data types and unicode etc, I guess this old code is running into a few issues. For example, a simple function that no longer works is StringLength:

function StringLength(sz: PChar): Integer;
begin
  Result := StrLen(sz);
end;

Compiled in D7 on Win7, the DLL correctly returns eg 6 for string = 'abc123'. (IB XE3 32 bit). The same code compiled in an XE5 DLL returns 3 (but the function run in XE5 IDE returns 6). Why might that be?

3. The XE5 DLL is almost 10x larger (100k to 990k). Using strings (with TCharHelper functionality etc) is a problem here, but identifying Letter, Digit, WhiteSpace, Punctuation chars etc is pretty useful for the functions I want. Obviously, smaller is better, but, as Windows and Delphi advance, everything seems to get inevitably bigger... In perspective, how much of a problem is a larger DLL with IB? How large is too large?

Is it even possible to generate a practical UDF dll in Delphi these days???

4. As an alternative, can anyone recommend a good (maintained) UDF library for IB with some good string functions? With Delphi source code? 

Having all the tricky thread-safe and memory-safe code handled (like it was in FreeUDFLib) would be great - but the big problem, of course, is simply that unless you can extend the library with your own custom functions, you're stuck with whatever happens to be included... which is a bit hit and miss!

Thanks
0
Brent
1/17/2014 7:43:16 AM
embarcadero.interbase.general 923 articles. 0 followers. Follow

4 Replies
1658 Views

Similar Articles

[PageSpeed] 12

Brent Rose wrote:
> I've used FreeUDFLib (from Gregory Deatz, et al) extensively with D7, and managed to compile extra functions within its framework which have proved invaluable (thanks to these developers for this library!!) Now, I'm looking at compiling the same library in XE5 - but it would appear to be in need of an overhaul! Yes, it does compile in XE5, but there are problems...
> 
> 1. Firstly, I gather there is no contemporary equivalent/port of FreeUDFLib (ie it stopped being developed long ago) - is that true?
> 

Closest is FreeAdhocUDFLib.  But it was FreeUDFLib ported to C and has 
additional DLL requirements and for one client last year we found that some of 
its functions could corrupt a database.

> 2. With all the changes in data types and unicode etc, I guess this old code is running into a few issues. For example, a simple function that no longer works is StringLength:
> 
> function StringLength(sz: PChar): Integer;
> begin
>   Result := StrLen(sz);
> end;
> 
> Compiled in D7 on Win7, the DLL correctly returns eg 6 for string = 'abc123'. (IB XE3 32 bit). The same code compiled in an XE5 DLL returns 3 (but the function run in XE5 IDE returns 6). Why might that be?
> 

Because in Delphi 7 PChar is a pointer to an AnsiString, in XE5 it is a pointer 
to an UnicodeString.  All PChars need to become PAnsiChar, all Strings need to 
be made into AnsiString.

> 3. The XE5 DLL is almost 10x larger (100k to 990k). Using strings (with TCharHelper functionality etc) is a problem here, but identifying Letter, Digit, WhiteSpace, Punctuation chars etc is pretty useful for the functions I want. Obviously, smaller is better, but, as Windows and Delphi advance, everything seems to get inevitably bigger... In perspective, how much of a problem is a larger DLL with IB? How large is too large?
> 

The DLL size is insignificant.  Windows uses a msart loader, it only loads the 
code pages touched, not the whole thing.  Even the whole thing is next to 
nothing compared to the rest of hte RAM requirements of a DB.  Just don't 
release it with debug information and that will greatly reduce the size.

> Is it even possible to generate a practical UDF dll in Delphi these days???

Yep, I have FreeUDFLib running fine in both 32 and 64 bits for a client compiled 
with XE5 (took about 4 hours then another 8 for unit test and stress tests on 
it, so should be doiable in under 2 days if you go to all that work).

I also have an example of a 32/64 bit UDF dll in my codecentral page.  It is 
just a  translation of the shipped X version but shows you how to do things.


-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)
0
Jeff
1/17/2014 8:03:38 PM
Thanks Jeff, that's very helpful.

> {quote:title=Jeff Overcash (TeamB) wrote:}{quote}
> Brent Rose wrote:
> > I've used FreeUDFLib (from Gregory Deatz, et al) extensively with D7, and managed to compile extra functions within its framework which have proved invaluable (thanks to these developers for this library!!) Now, I'm looking at compiling the same library in XE5 - but it would appear to be in need of an overhaul! Yes, it does compile in XE5, but there are problems...
> > 
> > 1. Firstly, I gather there is no contemporary equivalent/port of FreeUDFLib (ie it stopped being developed long ago) - is that true?
> > 
> 
> Closest is FreeAdhocUDFLib.  But it was FreeUDFLib ported to C and has 
> additional DLL requirements and for one client last year we found that some of 
> its functions could corrupt a database.
> 
> > 2. With all the changes in data types and unicode etc, I guess this old code is running into a few issues. For example, a simple function that no longer works is StringLength:
> > 
> > function StringLength(sz: PChar): Integer;
> > begin
> >   Result := StrLen(sz);
> > end;
> > 
> > Compiled in D7 on Win7, the DLL correctly returns eg 6 for string = 'abc123'. (IB XE3 32 bit). The same code compiled in an XE5 DLL returns 3 (but the function run in XE5 IDE returns 6). Why might that be?
> > 
> 
> Because in Delphi 7 PChar is a pointer to an AnsiString, in XE5 it is a pointer 
> to an UnicodeString.  All PChars need to become PAnsiChar, all Strings need to 
> be made into AnsiString.
> 
> > 3. The XE5 DLL is almost 10x larger (100k to 990k). Using strings (with TCharHelper functionality etc) is a problem here, but identifying Letter, Digit, WhiteSpace, Punctuation chars etc is pretty useful for the functions I want. Obviously, smaller is better, but, as Windows and Delphi advance, everything seems to get inevitably bigger... In perspective, how much of a problem is a larger DLL with IB? How large is too large?
> > 
> 
> The DLL size is insignificant.  Windows uses a msart loader, it only loads the 
> code pages touched, not the whole thing.  Even the whole thing is next to 
> nothing compared to the rest of hte RAM requirements of a DB.  Just don't 
> release it with debug information and that will greatly reduce the size.
> 
> > Is it even possible to generate a practical UDF dll in Delphi these days???
> 
> Yep, I have FreeUDFLib running fine in both 32 and 64 bits for a client compiled 
> with XE5 (took about 4 hours then another 8 for unit test and stress tests on 
> it, so should be doiable in under 2 days if you go to all that work).
> 
> I also have an example of a 32/64 bit UDF dll in my codecentral page.  It is 
> just a  translation of the shipped X version but shows you how to do things.
> 
> 
> -- 
> Jeff Overcash (TeamB)
>        (Please do not email me directly unless  asked. Thank You)
> And so I patrol in the valley of the shadow of the tricolor
> I must fear evil. For I am but mortal and mortals can only die.
> Asking questions, pleading answers from the nameless
> faceless watchers that stalk the carpeted  corridors of Whitehall.
>               (Fish)
0
Brent
1/19/2014 7:58:05 PM
> > Yep, I have FreeUDFLib running fine in both 32 and 64 bits for a
> > client compiled with XE5 (took about 4 hours then another 8 for
> > unit test and stress tests on it, so should be doiable in under 2
> > days if you go to all that work).
> > 
> > I also have an example of a 32/64 bit UDF dll in my codecentral
> > page.  It is just a  translation of the shipped X version but shows
> > you how to do things.
> > 
> > 
> > -- 
> > Jeff Overcash (TeamB)
> >        (Please do not email me directly unless  asked. Thank You)
> > And so I patrol in the valley of the shadow of the tricolor
> > I must fear evil. For I am but mortal and mortals can only die.
> > Asking questions, pleading answers from the nameless
> > faceless watchers that stalk the carpeted  corridors of Whitehall.
> >               (Fish)


Hi Jeff, 

 I would like to talk to you about the 64-bit FreeUDFLib.dll. Can I
email you?



-- 
Steve Faleiro
0
Steve
3/9/2014 10:05:16 PM
Steve Faleiro wrote:
> 
> Hi Jeff, 
> 
>  I would like to talk to you about the 64-bit FreeUDFLib.dll. Can I
> email you?
> 
> 
> 

Yes

-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)
0
Jeff
3/10/2014 12:54:16 AM
Reply:

Similar Artilces:

Help Delphi xe5 develop Android App
Hello i have problem for develop android app and use emulator the xe5 failure [INSTALL_FAILED_DEXOPT]. how to fix the problem ...

Pure ARM development using Delphi XE5?
Greetings, Is it possible to use the new Delphi ARM compiler to do pure ARM development? I'm not looking to use FMX or anything like that. Just pure arm for SoC as can be done with fpc. Thanks, J-F > {quote:title=Jean-François Bilodeau wrote:}{quote} > Is it possible to use the new Delphi ARM compiler to do pure ARM development? I'm not looking to use FMX or anything like that. Just pure arm for SoC as can be done with fpc. I suppose it "may" be possible, if you change low level system.pas and sysinit.pas units to your own. It was possible for Win32...

SEPA components for Delphi with Source Code (Delphi 5
Hi all, in the european union change next year the Bankingformat to the SEPA Format. All peoples and companies must change the bankingssoftware and the costumer data form acountnummers in the new IBAN and BIC numbers. See: http://www.arma-it.de/shop/artikelueber.php?wgruppeid=211&wgruppe_offen=211 Functions: - generate SEPA XML'S - Calc IBAN - BIC Database (DE,AT and CH) Questions: vertrieb@arma-it.de PS: Bankinssoftware for Develpoers (Germany only) http://www.arma-it.de/shop/artikelueber.php?wgruppeid=212&wgruppe_offen=212 El 26/10/13 21:38, A...

Issues writing Interbase XE 64-bit UDFs in Delphi XE2
I am having major issues trying to convert our old UDFs to 64-bit UDFs in Delphi XE2. The *only* success I have had is in returning a constant value! {*****************************************************************} {code}library SixtyFourUDF; uses SysUtils, Classes; function ReturnFive: Integer; export; begin Result := 5; end; Exports Return_Five; begin end. {code} {*****************************************************************} I can't even get a simple multiply function to work. {*****************************************************************} ...

Converting from Delphi 2005 to Delphi XE5
I have developed a number of Windows applications in Delphi 2005. I recently purchased Delphi XE5. I have started by trying to compile an existing 2005 application. I am getting a 7 errors about FMXTeeEditor. [dcc32 Error] E1026 File not found: 'FMXTee.Editor.Brush.fmx' Not able to find a solution to this. Any help greatly appreciated. Did you open every form before compiling? The old forms get updated with new properties when they are opened. I would make a copy of the old project before doing any of this. maybe you have links to the older tchart files....i.e its not usi...

Delphi developers who are also Python developers [Edit]
I'm interested in knowing how many Delphi developers here also have expert level skills in Python/Django web-framework and use the same in production / at work? How long did it take you to get started and then up and running? What were the best resources that helped in learning learn Python/Django? What are the difficult topics to master? I'm applying for a job here in Nigeria that requires Python/Django, but have only PHP (and some Zend framework) skills. I'm wondering how quickly I will be able to pick up Python and then get up and running with Django. -- Steve...

Installing Delphi 7 and Delphi XE5 on same machine
Is there any implication installing Delphi 7 and XE5 on a same machine? Will it affect the 3rd party components, libraries, dll etc.? On 15/12/2013 23:56, Ebizit IT wrote: > Is there any implication installing Delphi 7 and XE5 on a same machine? Will it affect the 3rd party components, libraries, dll etc.? Ebizit, The usual guideline is to install in release order, Delphi 7 first, then XE5. I would also advise installing in a dedicated, security open directory such as: C:\Tools\Delphi-7 C:\Tools\Delphi-XE5 However, since I cannot afford the grossly inflated pric...

Win32 program: Delphi 7 vs Delphi XE5
How is a D7 Win32 program compared to a Delphi XE5 one in terms of stability and performance? Is Delphi XE5 good enough for a big ERP project with several DLL's and hundreds of units and forms? Thanks in advance Am 26.12.2013 15:02, schrieb lior ilan: > How is a D7 Win32 program compared to a Delphi XE5 one in terms of stability > and performance? > Is Delphi XE5 good enough for a big ERP project with several DLL's and > hundreds of units and forms? > Thanks in advance > Hello, XE5 has increased functionality. Stability seems to be ok for most ...

Delphi 2010 and Delphi XE5 shuts down when opening projects
Over the last week I have found it increasingly difficult to open projects. Even really simple projects, some more complex. For example if start Delphi 2010 Enterprise Edition. I see the list of recently opened projects. I then click on a simple existing project, I get a hour glass for about a second and then Delphi IDE has gone. In the windows task manager, there are now no applications running. I have not changed the installation, being using Delphi 2010 enterprise on the same computer for a few years. I'm not a full time developer, but do internal development of our compa...

ANN: wxForms for Delphi
We are pleased to announce the release of our wxWidgets Form Designer for Delphi - wxForms for Delphi 1.1. wxForms for Delphi is an integrated form designer plugin for Borland /CodeGear Delphi that helps to create cross platform applications for Windows, Mac OSX and Linux using single source base. The wxForms code from Delphi can be compiled in Mac OSX and Linux without much change using FreePascal. wxForms for Delphi allows you to use all the Delphi's powerful Form Designer/ Editor features (Form Alignment, Object inspector, Component Palette etc ) to quickly create Cross platfor...

Any where to offer services as Delphi/Delphi for PHP freelance developer?
Hi, I'm a freelance Software Engineer. One of many that in current difficult days, is pushing for self-employment... offering services as Business Analyst and Developer, using Delphi, Delphi for PHP, MySQL, PostgreSQL. Any where in this forum or other you might know where to offer these services to the world? Thank you, Guillermo Guillermo, The Delphi for PHP forum does have For Hire and Wanted For Hire sections if you haven't seen those yet: http://forums.delphi-php.net/ Thanks. -Phil > {quote:title=Guillermo Najar wrote:}{quote} > Hi, > > I&#...

Delphi 2010 and Delphi XE5 shuts down when opening projects
Over the last week I have found it increasingly difficult to open projects. Even really simple projects, some more complex. For example if start Delphi 2010 Enterprise Edition. I see the list of recently opened projects. I then click on a simple existing project, I get a hour glass for about a second and then Delphi IDE has gone. In the windows task manager, there are now no applications running. I have not changed the installation, being using Delphi 2010 enterprise on the same computer for a few years. I'm not a full time developer, but do internal development of our compa...

Is dll developed in Delphi 6 works on Delphi 2?
I have a one dll, whose work is to creates a form with some normal vcl controls, print selected tables and email some reports. It was developed in Delphi 6. Can any other application which was developed in Delphi 2 use that dll.? If not, please let me know in which areas i need change. The dll work is only to print and email. With regards, Srikanth Varma Srikanth varma wrote: > I have a one dll, whose work is to creates a form with some normal > vcl controls, print selected tables and email some reports. It was > developed in Delphi 6. Can any other application which was d...

Debugging DLL compiled with Delphi 7 in Delphi XE5
Dear Sirs/Madams, We are considering changing from Delphi 7 to Delphi XE5. Our project consists of a dll and an .exe file. I have begun converting the .exe file to Delphi XE5 and have successfully accessed the DLL compiled with Delphi 7. When I debug the DLL (using the "run parameters" and changing "host application" to the .exe file) in Delphi 7 I can set breakpoints etc. and they are triggered. However, when I attempt to debug the project in XE5, I get the following message: Module Load: xxx.dll. No Debug Info. Base Address: $015A0000. Process xxx.exe (2928) ...

Web resources about - FreeUDFLib and developing UDFs in Delphi XE5 - embarcadero.interbase.general

Resources last updated: 1/13/2016 4:51:39 AM