Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all 1888 articles
Browse latest View live

Converting AnyDAC to FireDAC

$
0
0

I'm in process of updating an application from Delphi XE3 to 10.2.  The XE3 version used the AnyDAC database components and I need to convert to FireDAC.  I used the reFind utility and it addressed some of the changes, but many I'm having to address manually.

Right now I'm stuck at three references to AnyDAC in a form's USES clause that I can't find a FireDAC equivalent for:

uADDAptManager

uADCompDataMove

uADPhysManager

Any ideas?

 


Rad Studio IDE bricked on splash screen in Windows Insider Build 16184, 16188

$
0
0

Windows Insider build starting from 16184 are not compatible with Delphi IDE, staying locked on splash screen forever.

 

Yes, Windows Insider Build are Beta version(s), however Delphi is the one and only software I am aware of that bricked under those builds.

I suspect a Delphi issue, probably the protection and online activation module that is again at fault trying to protect itself.

As it is reasonable to think Microsoft is not the culprit here, and as being in Windows Insider program is sometine not an option for software vendors, Embarcadero/idera should at least investigate the issue and report - ideally provide a quick fix. 

 

If one's answer is "don't use Windows Beta", then just don't waste the time to write it.

Connecting to https sites

$
0
0

Hello all,

 

I tried to download a web page (using WinInet, not using INDY components) by the following code (I found similar in StackOverflow):

function DownloadPage(const aURL, aFileName:string):boolean;

const BufferSize = 1024;

var hSession, hURL:HInternet; Buffer:array[1..BufferSize] of Byte;  BufferLen:DWORD; f:file;

begin Result:=false;      hSession:=InternetOpen(PChar(ExtractFileName(Application.ExeName)),

                               INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);

   // Establish the secure connection with real username and password

 if Copy(aURL, 1, 8) = 'https://' then 

    InternetConnect(hSession, PChar(aURL),    INTERNET_DEFAULT_HTTPS_PORT, PChar('MyUsername'),    PChar('MyPass'), INTERNET_SERVICE_HTTP, 0, 0); 

 

     try if Assigned(hSession) then begin

             hURL:=InternetOpenURL(hSession, PChar(aURL), nil, 0,

                                   INTERNET_FLAG_RELOAD, 0);

             if Assigned(hURL) then

                try try AssignFile(f, aFileName); Rewrite(f, 1);

                        repeat InternetReadFile(hURL, @Buffer, SizeOf(Buffer), BufferLen);

                               BlockWrite(f, Buffer, BufferLen);

                         until BufferLen = 0;

                        Result:=True;

                    except Result:=false; end;

                finally CloseFile(f); InternetCloseHandle(hURL); end;

          end; // if Assigned(hSession)

      finally InternetCloseHandle(hSession); end;

end;

 

It works OK with http sites, but with https sites sometimes I can not establish connection, sometimes the download goes fine. What's the matter?
Thanks in advance for eventual hints or clarifications!

 

Andrey

Embedded framework

$
0
0

Hello, 

basically I'm able to use static ios library in firemonkey project. It is not problem.

Now I found embedded framework included in one iOS project and I'd like to use this framework in firemonkey.

The structure of this embedded framework is 

-embeddeded framework

--Resources folder with bundle files

--framework file

If I add framework file as a static library into firemonkey project i will get some strange error [DCC Error] E2597 ld: 64-bit LDR/STR not 8-byte aligned: from .... but I think it has something to do with missing Resources. How can I add those .bundle files into firemonkey project?

Thank you

Iot.Family.BluetoothLE.pas -- Can't debug IoT BLE

$
0
0

The LifeTrak sample for LifeTrak can't detect/discover the Lifetrak device even with it paired.

For this (or any similar BLE) application, Iot.Family.BluetoothLE.pas is needed to debug with any hope of completing a real application.

Iot.Family.BluetoothLE.pas is not provided in version 10.2 so there is little hope of making progress with BLE IoT development.

Is there an update (or other) support coming to make it possible to debug these BLE/IoT samples and other applications ?

Clark

 

 

XCode 8.3?

$
0
0

Hi,

As always, starts aligned like each previous releases... RAD Studio is out, and a few days later, the new XCode is there too.
Did anybody try XCode 8.3 with RadStudio 10.2?
Is anything broken?
Thanks for any clue.

TMapMarkerDescriptor.snippet is not an InfoWindow?

$
0
0

Hello,

As I know, an InfoWindow of a Marker in the GoogleMaps can have HTML code and it can show 'everything' (Texts, Images, Buttons, etc., as a little webpage).

Is it possible to have an Image on a Marker's snippet in Delphi, or it is only a text area?

Thanks

 

Problem with template in ide

$
0
0

Form of the template being resized when it is opened in the IDE. How to avoid this?


TMapMarkerDescriptor.snippet is not an InfoWindow?

$
0
0

Hello,

As I know, an InfoWindow of a Marker in the GoogleMaps can have HTML code and it can show 'everything' (Texts, Images, Buttons, etc., as a little webpage).

Is it possible to have an Image on a Marker's snippet in Delphi, or it is only a text area?

Thanks

TeeChart for RAD Studio 10.1

$
0
0

The feature list for RAD Studio 10.1 indicates it includes TeeChart but it is not installed in the Tool Palette and I cannot find a design time package to install.  The GetIt Manager doesn't list TeeChart as an option.  What do I need to do to install TeeChart in RAD Stuation 10.1?

Compiling HiRedis, the official C Client of the Windows port of Redis with C++ Builder

$
0
0

Hi all,

I'm in the process of building Hiredis, the official C client library for Redis (Windows port of course) using C++ Builder.

Windows port of Redis is a fork maintained by Microsoft Open Tech community and is of course tight to MS compiler and libraries. In fact, there is no luck in trying to compile the source just "out of the box" as Visual Studio does, even if the source is straight standard C (well, at last the original Redis code).

The source can be found here: Windows port of Redis 

I know there is a Delphi client available, but it really sounds sad (and frustrating) to me having to import the Delphi code because the "native C source" cannot be used. No way. That's why I decided to give it a try. 

To compare sources an libraries involved, I'm using C++ Builder 10.1.2 (Berlin Update 2) on one side and Visual Studio Community 2017 on the other side. The basic steps using C++ Builder are:

(Edit: I edited the post and removed all code formatting features because I had problems with it. Also, for the same reason all #include in the post has standard parenthesis instead of "minor and major" chars. Sorry for that.)

  1. Download of source version redis-win-3.2.100
  2. Create a new Static Library project called Hiredis and add some files contained in the "redis-win-3.2.100\deps\hiredis" subfolder:
    async.c
    hiredis.c
    net.c
    sds.c

    There is a solution project available for Visual Studio under "redis-win-3.2.100\msvs\hiredis" ready to compile, that's where I took the list of files to add. Headers are also added to the MS project, but as far as I can see, there is no difference if you keep them off.
    Anyway headers are:
    async.h
    fmacros.h
    hiredis.h
    net.h
    sds.h
    win32_types.h

  3. Setup the project to use Clang based compiler (not really needed as this should be standard C code, but see later)
  4. Build

The project fails to compile as I said, here is a step by step description of the issues and fixes I used. After each fix I usually compile the single unit or directly build the whole project. Each fix provided must not break the original source which still compiles using MSVC, this will be eventually a requirement when talking about pushing the code to the MSOpen Tech community.

  • First error: [bcc32c Error] Win32_Error.h(37): unknown type name 'size_t'
    Fix: added a conditional block and the relative include to the header that contains that type. 

    #ifdef __BORLANDC__
    #include (stdlib.h)
    #endif

    This error is due to the fact that inside Win32_Error.h there is another include and this header in MS C Runtime Library version contains another include to a Visual C header. (Kudos to Embarcadero C Runtime Library version)

  • Second error: 
    [bcc32c Error] _stddef.h(45): typedef redefinition with different types ('int' vs 'long') 
    Win32_types_hiredis.h(44): previous definition is here

    Fix: added conditional block wrapper to avoid type re declaration. 

    #ifndef __BORLANDC__
    typedef long              ssize_t;
    #endif

    _stddef.h already contains that type (int instead of long, but it's quite good for now)

  • Third error: [bcc32c Error] stdio.h(56): typedef redefinition with different types ('long' vs 'long long')
    This error is due to the re-definition of the type off_t inside the file win32_types.h provided in the hiredis source.

    Now, according to the info in "win32_types.h" they need to re-define both off_t and _off_t types to match Posix version of Redis.
    But, in order to use this definition without conflicts you need to include this header before any other inclusion of the original header "sys\types.h", which contains the original types definitions under a conditional define (_OFF_T_DEFINED). 

    Win32_types.h will also define _OFF_T_DEFINED to avoid subsequent types re-definitions. (anyway MSVC has an additional conditional define _OFF_T_DEFINED at project level.)

    Now, on MS Visual Studio C Runtime Library, "stdio.h" does not contain "off_t" type definition, that's why it everything works. Moreover, Embarcadero C Runtime Library has no conditional defs to skip off_t and _off_t definitions inside "sys\types.h" as MS does.

    First Fix: I'd rather not modify C Runtime Library headers at all, but at the moment I have no other options. To minimize modifications on such files, I choose to "cut off" stdio.h definitions by adding a define just above the header inclusion, inside the file "Win32_FDAPI.h":

    #ifdef __BORLANDC__
    #define __STDC__ 1
    #endif
    #include (stdio.h)

    Luckily (..well, hopefully) _off_t is wrapped in a conditional #if !defined(__STDC__), that's why the definition just above the include does the job. Unfortunately this solution cuts away some other options (#pragma warn -nak for example) and others, but it seems to be OK, for now anyway.

    Second Fix: I have no other option here than modifying Embarcadero C Runtime Library header file "sys\types.h" and wrap the off_t type definition with the above mentioned _OFF_T_DEFINED, just as in MS Visual Studion C Runtime headers:

    #ifndef _OFF_T_DEFINED
    #define _OFF_T_DEFINED
    typedef long off_t;
    #endif

     

  • Fourth error: [CLANG Error] sds.h(53): expected identifier
    The file contains an helper macro to pack structs. The macro uses __pragma() compiler extension to allow the usage of pragma "in-a-macro". According to the compiler documentation, also thanks to this answer on StackOverflow from Remy Lebeau, old BCC32 does not support this statements. But Clang based compilers do. This is the first fix that is tight to Clang compiler, even if we could build a different solution by using #pragma as stated in stakoverflow post by Remy to have BCC32 working.
    Anyway, I was not able to make __pragma() work that way, so I created another macro using _Pragma() instead and that worked fine.

    #if defined(__BORLANDC__) && defined(__clang__)
    #define PACK( __Declaration__ ) _Pragma( "pack(push, 1)" ) _Declaration__ _Pragma( "pack(pop)" )
    #else
    #define PACK( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
    #endif

     

  • Fifth and sixth errors: 
    [CLANG Error] win32_types.h(37): typedef redefinition with different types ('long long' vs 'long') 
    stdio.h(56): previous definition is here
    First Fix: same solution used for "third error". Add __STDC__ definition just above the include inside "net.c"
    Second Fix: according to the remark near stdio.h include, that header is included only to provide "size_t" type. Actually on Embarcadero C Runtime Library, that type is defined in "stdlib.h".
    Therefore I added a conditional block to include "stdlib.h" instead of "stdio.h" inside "hiredis.h" source.

    #ifdef __BORLANDC__
    #include (stdlib.h) /* for size_t */
    #else
    #include (stdio.h) /* for size_t */
    #endif

     

  • Seventh error. Here is where I stuck.
    [CLANG Error] hiredis.c(1041): conflicting types for 'redisConnectWithTimeout'
    hiredis.h(184): previous declaration is here

    As sometime happens the compiler message is not really helpful. In fact the problem is not 'redisConnectWithTimeout' function prototype but rather one of the parameter types used in it, timeval which is defined in "winsock2.h".
    For some strange reason, on MSVC this type definition is known in hiredis.h at function declaration, even if winsock2.h is not included by any of the include entries, nor in any sub-includes. Unfortunately, any inclusion of winsock2.h leads to an incredible amount of other errors which make me think about searching for another solution.

Here is where I lay by now, welcome contributions from anyone can help.

Thanks.

Alex B.



Context help not installed

$
0
0

I have an installation of Rad Studio 10.2 installed on my PC that was installed for me, when I press F1 to invoke the context help I get the following error:

'RAD Studio's help is not installed. Please Re-install RAD Studio's documentation.'

Also, when using the drop down help menu there are no options under 'Help -> Delphi Help'.

I've tried to run the installer to add the help files but the only option I have is to uninstall and re-install RAD Studio which I don't want to do.

I've also downloaded the help files and copied them to  C:\Program Files (x86)\Embarcadero\Studio\19.0\Help\Doc which hasn't resolved the issue.

Is there a method to install the help files so that RAD Studio recognises them without having to reinstall the entire product?

Thank you.

FMX C++ Builder App on MacOS crash on start with 10.2

$
0
0

Have a project that worked fine with 10.1 Berlin for the three target environments: Win32, Win64, and MacOS/OSX.

Load the project up in 10.2 Win32 and Win64 work fine, but MacOS/OSX version crashes during startup (before executing any of the .cpp files in the project). Thus have been unable to debug it.

As a further test: I created a blank project which works fine in all 3 (just to make sure everything is correct) started adding the same components to the FMX Form on the test project--everything worked...

2nd test: Create a blank FMX application and then add all the files from the original project to it. This results with the same crash as with the original application.

Looking at the stack trace the crash appears to be related to styles (there is no stylebook associated with the form, and even if one is added the application still crashes in MacOS/OSX).

 My 10.2 is up to date (including the latest patch recently released).

Android multi languages app - playstore

$
0
0

Hello I have written an app for Android which supports German, English, French, Spanish and four other languages. No problem it works.  The problem is, that the playstore analyse the app and thinks that there is only one language. Is there a method (e.g. in the manifest) to declare that this app has more languages ? I'm using Delphi Seattle (Update 1). Thanks for any help Michael        

bcbie250.bpl package for RAD Studio 10.2 IDE

$
0
0

I am migrating legacy code from Codegear C++Builder2007, which had a Tool Palette category of Internet with the TCppWebBrowser component, to C++Builder 10.2, which does not have this category or the component in any other category.  On the EDN forum, I was told to install the relevant package (bcbie250.bpl) into the IDE.  Where do I download this?  I have searched Embarcadero and did not anything.  Thanks.

Bill

 


Retrieving real gps status

$
0
0

Hi, how can i retrieve the real status of a gps sensor on android or ios?

TSensorManager returns a LocationSensor

With a timer i'm printing the TSensorState flag, but it returns every time a Ready State even if i disable the Gps and/or the Wifi option on the device.

Thank you

Error when compiling for 64 bit windows: frxClass not found. For 32 bit windows it's working well

$
0
0

Hi,

 

I get an error message when compling for 64-bit windows: [dcc64 Fatal Error] uFormRekeningschema.pas(7): F2613 Unit 'frxClass' not found.

 

But if I compile for 32 bit windows this error don't appear. Do you hav any idea how to fix this for the 64-bit windows?

 

Kind regards,

 

Jacques Kuipers

 

How to determine why the compiler is so slow when working on some of my units?

$
0
0

We have an old project that has been growing over the time. Right now a build will compile around 700,000 lines of code. Total process is around 9 minutes to complete.

The build process is very fast compiling the first units, so 400,000 lines of code are compiled in 20 seconds, and you can see the line counter moving very fast. Then the process slows down, always in the same set of units, and the line counter freezes and updates not so frequently. Compiling this group of units takes 6 or 7 minutes. When they are done, process speeds up again to complete the process.

Obviously, we are checking this group of around 10 units looking for something different from the rest, but we have not seen anything special.

We have used also CnPack wizards to clean unnecessary uses. Some uses have been removed, but the process speed has not been improved.

Any ideas on what to check? How to find out why these units are so slow to compile?

Delphi v6 exe size 2.3MB, migrated to v10 and exe size 4.6MB

$
0
0

I have recently migrated from Delphi v6 to Delphi 10 Starter edition. I loaded a v6 project to v10 and found it very easy to get it working fine. But the executable file created by v6 was 2.3 MB, and that created by v10 is 4.6 MB. I only made a few trivial changes. Is this something to do with the units I am including in the "Uses" clauses? I did find somewhere that Embarcadero were offering an app to "clean up" the uses declarations, but cannot relocate it now. Any suggestions would be very much appreciated.

Windows 10 64 bit, Delphi v10 Starter edition.

 

Is this valid Delphi code?

$
0
0

I played around how I can best wrap a Class (TBase) inside a Container that I have limited access to change.

Is this valid Delphi Code? It seems to work.

 

type
  TForm1 = class(TForm)
    procedure FormShow(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

  TBase = class
    public
      bar: Integer;
  end;

  TSpecial = class(TBase)
    public
      foo: Integer;
  end;

  TBaseContainer = class
    public
      base: TBase;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormShow(Sender: TObject);
var
  baseContainer: TBaseContainer;
begin
  baseContainer := TBaseContainer.Create;
  baseContainer.base := TBase.Create;
  baseContainer.base.bar := 5;

  TSpecial(baseContainer.base).foo := 3;

  ShowMessage(baseContainer.base.bar.ToString);
  ShowMessage(TSpecial(baseContainer.base).foo.ToString);
end;

 

What does the Compiler do in line "TSpecial(baseContainer.base).foo := 3;"? What memory is used?

Viewing all 1888 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>