Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Ewald
On 17 Jan 2014, at 21:14, Fred van Stappen wrote: > >Ha, then you use/compiled a different version. Since a `extern "C"` preserves > > the symbol name (that is the trick I use to link in a lot of external C++ > > code: > >just put extern "C" in front of the symbol). or it could be that I am > >

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
> That routine is defined in SoundTouchDLL.cpp which is the windows dll > wrapper. Do you have the linux equivalent? Oops, im full of doubt now... Do you think the SoundTouchDLL.h wrapper is for Windows only ( and, yes, the old wrapper uses stdcall (who is windows only)). And for linux how does

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
>Ha, then you use/compiled a different version. Since a `extern "C"` preserves > the symbol name (that is the trick I use to link in a lot of external C++ > code: >just put extern "C" in front of the symbol). or it could be that I am >completely >missing something here. [for example: is the symbo

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Ewald
On 17 Jan 2014, at 20:40, Fred van Stappen wrote: > > Yep, there is a brand new wrapper from trunk : Ha, then you use/compiled a different version. Since a `extern "C"` preserves the symbol name (that is the trick I use to link in a lot of external C++ code: just put extern "C" in front of th

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
> Yep, there is a brand new wrapper from trunk : Of course, all the tests i have done are with that new wrapper... ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/m

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
> Note one detail: it is declared there as __stdcall, not as __cdecl, so > perhaps this has something to do with it? > > @Fred: Also note that the type HANDLE is defined there as a pointer, so [as a > sanity test of sorts] sizeof(Handle {in pascal}) should be equal to > sizeof(HANDLE /*in C/C+

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
> That routine is defined in SoundTouchDLL.cpp which is the windows dll > wrapper. Do you have the linux equivalent? > > Ludo PS : For new new arriving : SoundTouchDLL.cpp is part of SoundTouch, a audio processing library : >> http://www.surina.net/soundtouch/download.html @ Ludo : In /sourc

Re: [fpc-pascal] win64 / zipper & fphttpclient

2014-01-17 Thread Philippe
I have implemented web access and unzipping of archives in my program. Compiling perfectly targetting win32. But when I wanted to mail a win64 version ... using ppcrossx64 ... it did not find zipper & fphttpclient units ... Could anyone tell me how to make those units (and related ones if an

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Ewald
On 17 Jan 2014, at 17:25, Ludo Brands wrote: > On 01/17/2014 05:09 PM, Fred van Stappen wrote: >> >>> I don't know if the Handle type in the header is defined by the C++ >> compiler >>> or by the package itself. Consult their respective documentation for more >>> info. >> >> Here declaration of

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Ludo Brands
On 01/17/2014 05:09 PM, Fred van Stappen wrote: > >> I don't know if the Handle type in the header is defined by the C++ > compiler >> or by the package itself. Consult their respective documentation for more >> info. > > Here declaration of create instance : > > // Create a new instance of Soun

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
> I don't know if the Handle type in the header is defined by the C++ compiler > or by the package itself. Consult their respective documentation for more > info. Here declaration of create instance : // Create a new instance of SoundTouch processor. SOUNDTOUCHDLL_API HANDLE __cdecl soundtouch_c

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
> Writeln(sizeof(THandle)); // for console apps FHandle := soundtouch_createInstance(); writeln(FHandle); Writeln(sizeof(FHandle)); Gives that result : 10321232 4 > I don't know if the Handle type in the header is defined by the > C++ compiler or by the package itself. > Consult their respect

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Marco van de Voort
In our previous episode, Fred van Stappen said: > > Handle is not defined on Linux. Many libraries emulate some handle type, but > > it depends on the vendor if they make handle 32-bit or 64-bit. > > > > Make sure that sizeof(HANDLE) in C++ matches sizeof(THandle) in FPC. Adjust > > the type you

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
> What is the value of the handle that was returned? > > Ludo Re-hello Ludo. That code : if ST_Load('/home/fred/dynlib_vs_windows/libSoundTouch.so') then writeln('libSoundTouch.so loaded'); if FHandle <> NilHandle then soundtouch_clear(FHandle); FHandle := soundtouch_createInstance();

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
> On 01/17/2014 03:55 PM, Fred van Stappen wrote: > > > >> > I run nm and find the name of the procedures ( PS : without > > nm-Ewald's tip, you must be a high soothsayer to find it) > >> > For example, a C called procedure : soundtouch_getVersionString() > > becomes : _ZN10soundtouch10SoundTouch

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Ludo Brands
On 01/17/2014 03:55 PM, Fred van Stappen wrote: > >> > I run nm and find the name of the procedures ( PS : without > nm-Ewald's tip, you must be a high soothsayer to find it) >> > For example, a C called procedure : soundtouch_getVersionString() > becomes : _ZN10soundtouch10SoundTouch16getVersionS

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
> Subject: Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress() > > In our previous episode, Fred van Stappen said: > > I have only a problem with one procedure: > > > > This c procedure is declared as this : > > SOUNDTOUCHDLL_API void __cdecl soundtouch_setSampleRate(HANDLE h, u

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Marco van de Voort
In our previous episode, Fred van Stappen said: > I have only a problem with one procedure: > > This c procedure is declared as this : > SOUNDTOUCHDLL_API void __cdecl soundtouch_setSampleRate(HANDLE h, unsigned > int srate); > > And i translate it like that : > > soundtouch_setSampleRate : pro

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
> I only have problem with : > _ZN10soundtouch10SoundTouch16getVersionStringEv()... Ooops, have to read : I only have problem with : Pointer(soundtouch_setSampleRate):= GetProcAddress(LibHandle, Pchar('_ZN10soundtouch10SoundTouch13setSampleRateEj'));

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
> > I run nm and find the name of the procedures ( PS : without nm-Ewald's tip, > > you must be a high soothsayer to find it) > > For example, a C called procedure : soundtouch_getVersionString() becomes : > > _ZN10soundtouch10SoundTouch16getVersionStringEv() !!! > > > > The _ZN10soundtouch10S

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Ludo Brands
On 01/17/2014 03:16 PM, Fred van Stappen wrote: > > I run nm and find the name of the procedures ( PS : without nm-Ewald's tip, > you must be a high soothsayer to find it) > For example, a C called procedure : soundtouch_getVersionString() becomes : > _ZN10soundtouch10SoundTouch16getVersionStri

Re: [fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

2014-01-17 Thread Fred van Stappen
Hello. Thanks to Mister Hinst, i was able to load and run, in Windows, with dynlib.pas, SoundTouch.dll. Perfect and re-thanks. Now, i begin a other hard battle : load and run in Linux, libSoundTouch.so. With the extremely helpful message of Mister Ewald :> Try to find the names of the symbols

Re: [fpc-pascal] Can Delphi load a small function of a shared lib written in Free Pascal 2.6.2?

2014-01-17 Thread hinst
I suggest you use COM interfaces to use FPC objects from Delphi code. While FPC class instance memory layout differs from Delphi class instance memory layout, COM interface instances should have identical memory layouts; so they should be accessible from Delphi code 17.01.2014, 04:31, "silviopr

Re: [fpc-pascal] DecimalSeparator automatic change ?

2014-01-17 Thread LacaK
Michael Van Canneyt wrote / napĂ­sal(a): On Fri, 17 Jan 2014, LacaK wrote: Hi, I have strange problem, I have application on Windows 2012 Server, where is set locale to Slovak (DecimalSeparator is comma) In my application in DataModuleCreate I explicitly set FormatSettings.DecimalSeparator=

Re: [fpc-pascal] DecimalSeparator automatic change ?

2014-01-17 Thread Michael Van Canneyt
On Fri, 17 Jan 2014, LacaK wrote: Hi, I have strange problem, I have application on Windows 2012 Server, where is set locale to Slovak (DecimalSeparator is comma) In my application in DataModuleCreate I explicitly set FormatSettings.DecimalSeparator='.' (dot) All works as expected (decimal n

[fpc-pascal] DecimalSeparator automatic change ?

2014-01-17 Thread LacaK
Hi, I have strange problem, I have application on Windows 2012 Server, where is set locale to Slovak (DecimalSeparator is comma) In my application in DataModuleCreate I explicitly set FormatSettings.DecimalSeparator='.' (dot) All works as expected (decimal numbers are formated with "dot"), but