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

SELECT TOP n sample population query in FireDAC

$
0
0

Hello - I'm developing 32-bit Windows applications using Delphi XE7 Enterprise, on a 64-bit Windows 7 machine. I'm in the process of updating an application's data access components from ADO to FireDAC, connecting to MS Access database. All is working well, except in the case of SELECT TOP n queries. Most times, in design mode, I can successfully run the query. However, at run time, and sometimes during design, I get a message mentioning "[SamplePop]" not being supported. I understand that refers to a sample population, but I cannot find any reason for it, let alone a workaround. Any ideas, other than keeping those queries in ADO components? Thanks! Teri


Websocket client

$
0
0

Hello everybody!

 

I really need help: I can't find anywhere any guide to connect a FMX application to a websocket server. In my specific case, I have done a little WS server in PHP and Ratchet and it works fine. Now I need to send and get datas through this WS in my Firemonkey project. I have found some components, but still it's not clear how to use them, becouse I cannot find any guide for Berlin (and because I'm new to Delphi language). Can you help me please? Thank  you in advance!

What changes will Sencha acquisition bring to C++ builder?

$
0
0

I've read the news that "Idera acquires Sencha to strengthen developer tools business".

I am a bit concerned about what changes it will bring to C++ Builder.I don't want to use Javascript or Java...

When I set Target Platform to Android my TFDPhysMySQLDriverLink became gray

$
0
0

Hi,

When I set Target Platform to Android my TFDPhysMySQLDriverLink became gray.

Does it mean that I can't use FireDAC components to develop Android application with MySQL database operations?

Thanks,

Alexander

Tokyo android MessageDlg

$
0
0

the MessageDlg Function in Tokyo version for android.... dosn't work

Error Access Violation in Delphi XE7

$
0
0

I worked with Form and loaded few pictures.Run the program.After that errors appeared.And when i try to do smth with my pictures these errors also may appeare.

Error :

"Invalid pointer operation"

"Access Violation at address 5059DCDD in module 'vcl210.bpl' .Read of address 00000000"

Details:

 

[5059DCDD]{vcl210.bpl  } Vcl.Graphics.TResourceManager.FreeResource (Line 1860, "Vcl.Graphics.pas" + 15) + $2

[5005F000]{rtl210.bpl  } System.TObject.FreeInstance (Line 15650, "System.pas" + 2) + $2

[50059E92]{rtl210.bpl  } System.ErrorAt (Line 5324, "System.pas" + 3) + $4

[50059ED6]{rtl210.bpl  } System.Error (Line 5335, "System.pas" + 1) + $7

[5005F000]{rtl210.bpl  } System.TObject.FreeInstance (Line 15650, "System.pas" + 2) + $2

[5005F85A]{rtl210.bpl  } System.@ClassDestroy (Line 16993, "System.pas" + 0) + $2

[5059E531]{vcl210.bpl  } Vcl.Graphics.TFont.Destroy (Line 2427, "Vcl.Graphics.pas" + 5) + $6

[5005F108]{rtl210.bpl  } System.TObject.Free (Line 15718, "System.pas" + 1) + $4

[5059F74D]{vcl210.bpl  } Vcl.Graphics.TCanvas.Destroy (Line 3708, "Vcl.Graphics.pas" + 4) + $3

[505BF7B8]{vcl210.bpl  } Vcl.Controls.TControlCanvas.Destroy (Line 5022, "Vcl.Controls.pas" + 2) + $6

[5005F108]{rtl210.bpl  } System.TObject.Free (Line 15718, "System.pas" + 1) + $4

[505CD5ED]{vcl210.bpl  } Vcl.Controls.TCustomControl.Destroy (Line 13818, "Vcl.Controls.pas" + 1) + $6

[5005F108]{rtl210.bpl  } System.TObject.Free (Line 15718, "System.pas" + 1) + $4

[520F1E1A]{vcldesigner210.bpl} VCLSurface.TVclDesignSurface.CancelDragHint (Line 4374, "VCLSurface.pas" + 9) + $0

[520F182B]{vcldesigner210.bpl} VCLSurface.TVclDesignSurface.DragHintMouseMessage (Line 4242, "VCLSurface.pas" + 27) + $2

[520EFC0A]{vcldesigner210.bpl} VCLSurface.TVclDesignSurface.IsDesignMsg (Line 3456, "VCLSurface.pas" + 56) + $14

[5005F532]{rtl210.bpl  } System.@CallDynaInst (Line 16299, "System.pas" + 4) + $0

[520EF8AA]{vcldesigner210.bpl} VCLSurface.TVclDesignSurface.IsDesignMsg (Line 3401, "VCLSurface.pas" + 1) + $9

[5005F3E6]{rtl210.bpl  } System.@IsClass (Line 16131, "System.pas" + 1) + $8

[505C299B]{vcl210.bpl  } Vcl.Controls.TControl.WndProc (Line 7145, "Vcl.Controls.pas" + 4) + $21

[5005F3E6]{rtl210.bpl  } System.@IsClass (Line 16131, "System.pas" + 1) + $8

[505C299B]{vcl210.bpl  } Vcl.Controls.TControl.WndProc (Line 7145, "Vcl.Controls.pas" + 4) + $21

[5005F87D]{rtl210.bpl  } System.@AfterConstruction (Line 16999, "System.pas" + 2) + $5

[5006B55C]{rtl210.bpl  } System.Types.TRect.Contains (Line 1423, "System.Types.pas" + 0) + $0

[505C6DB0]{vcl210.bpl  } Vcl.Controls.GetControlAtPos (Line 9773, "Vcl.Controls.pas" + 4) + $13

[505C6EDA]{vcl210.bpl  } Vcl.Controls.TWinControl.ControlAtPos (Line 9796, "Vcl.Controls.pas" + 13) + $E

[505C2850]{vcl210.bpl  } Vcl.Controls.TControl.Perform (Line 7010, "Vcl.Controls.pas" + 10) + $8

[505C6FA8]{vcl210.bpl  } Vcl.Controls.TWinControl.IsControlMouseMsg (Line 9820, "Vcl.Controls.pas" + 15) + $29

[505C755E]{vcl210.bpl  } Vcl.Controls.TWinControl.WndProc (Line 9989, "Vcl.Controls.pas" + 104) + $6

[5016E218]{rtl210.bpl  } System.Classes.StdWndProc (Line 16600, "System.Classes.pas" + 8) + $0

[5070CE98]{vcl210.bpl  } Vcl.Forms.TCustomForm.WndProc (Line 4427, "Vcl.Forms.pas" + 206) + $5

[520F870F]{vcldesigner210.bpl} VCLFormContainer.TControlSizer.ControlWndProc (Line 313, "VCLFormContainer.pas" + 33) + $C

[505C6D1C]{vcl210.bpl  } Vcl.Controls.TWinControl.MainWndProc (Line 9750, "Vcl.Controls.pas" + 3) + $6

[5016E218]{rtl210.bpl  } System.Classes.StdWndProc (Line 16600, "System.Classes.pas" + 8) + $0

[5071635B]{vcl210.bpl  } Vcl.Forms.TApplication.ProcessMessage (Line 10352, "Vcl.Forms.pas" + 23) + $1

[5071639E]{vcl210.bpl  } Vcl.Forms.TApplication.HandleMessage (Line 10382, "Vcl.Forms.pas" + 1) + $4

[507166D1]{vcl210.bpl  } Vcl.Forms.TApplication.Run (Line 10520, "Vcl.Forms.pas" + 26) + $3

Adding SDK for IOS gets 'Did you install Command line tools".

$
0
0

When I try to ADD an SDK for IOS 32 or 64 I get the error message NO SDK files could be found... did you install command line tools.

I have, but it looks like they cannot be found.

 

I have Xcode 7.1.1 installed on my Mac - running 10.10.5 Yosemite

- and see it in the default location of Macintosh HD/Applications/Utilities

  

I separately installed command line tools 7.1.dmg and see that it installed by default to Library/Developer/commandlinetools 

When I type xcode-select -p  it answers  /Library/Developer/CommandLineTools

I cannot see any folder called xcode.app/contents

If I type sudo xcode-select -s /Application/Xcode.app/Content/Developer  I get "error: invalid developer directory (as it is of course in Library/Developer/commandlinetools.

What am I supposed to do please ?   How do we link to an SDK file please ?

John

 

 

Castalia settings in XE10.2

$
0
0

Hi,

In Castalia there used to be a setting called "smart slash" which allowed you to toggle comments with the forward slash key.

How can I turn this on in XE10.2 Tokyo?

Thank you.


AndroidManifest not updating

$
0
0

Hi Im having trouble with the AndroidManifest.xml file. It is generating when i compile/build my project but the version and package names are not updating. How can i correct this problem?   I am running delphi berlin 10.1 update 2 is installed.

Error on IndexName of ClientDataSet

$
0
0

After the installation of RAD Studio 10.2 Tokio, and not in the previous version, my code give me an error.

When i assign a valid index string to the property IndexName of a ClientDataSet (not always but often, but i don't understand why) the code give me this error:

Access violation at address 4DB0D009 in module 'midas.dll'. Read of address 00000000.

These are the the steps before the error:

4db0d009 +000 midas.dll
0079489a +062 ... Datasnap.DBClient TCustomClientDataSet.SwitchToIndex
00794a72 +07e ... Datasnap.DBClient TCustomClientDataSet.SetIndex
0079516e +002 ... Datasnap.DBClient TCustomClientDataSet.SetIndexName

What could be the reasons be?

Tokyo: Simultaneous use of stored procedure on MariaDB database fails with "Commands out of sync". No problem on Berlin.

$
0
0

Why is the following code working flawlessly in Delphi 10.1 Berlin, while 'fdquery2.open' fails in 10.2.1 Tokyo with an error "Commands out of sync; you can't run this command now'. I need similar code in a real program eg. showing records in a dbgrid and in a separate process printing these records on a report.

Database MariaDB 10.1 (but also 10.2).

  lblInfo.Caption:= 'Started, but not finished';
  fdconnection1.Connected:= True;
  fdquery1.open;
  fdquery2.open;
  lblInfo.Caption:= 'Started and correctly finished !!';

Fdquery1 and fdquery2 both uses the same connection FDConnection1.

Both queries calls the same stored procedure.

object FDConnection1: TFDConnection
    Params.Strings = (
      'User_Name=xxxxx'
      'Password=xxxxx'
      'DriverID=MySQL')

  object FDQuery1: TFDQuery
    Connection = FDConnection1
    SQL.Strings = (
      'call db.Test')

stored procedure test:
BEGIN
select
    patient.nr from patient;
END

Note: Solutions like setting FetchOptions.Mode:= fmAll are due to performance issues not practical

Note: On different connections it works

How to fix TMemo's firemonkey problems?

$
0
0

I have problems using TMemo component in android applications. FMX TMemo shows a strange behaviour editing in Samsung S7 (Android 7.0), the lines changes their order while they are entered and is impossible to arrange (RSP-18614).

I don't know if anybody else has the same issue and how to work around to fix it until Embarcadero publish an updating or patch that corrects this bug.

Any ideas?

Where's My Canvas?

$
0
0

I broke some working code, but can't figure out how I could have caused this particular problem.

I have a TImage in a scrollbox.  If I build a bitmap from an array of data and Image1.picture.bitmap.assign(the_constructed_image), everything works as it has for quite a while.  But either AFTER I have successfully done that or on a FIRST CALL to the image/scrollbox-containing window, 

   Image1.picture.bitmap.assign(a_different_bitmap_image);  {a_different_bitmap_image is a tbitmap}

   Image1.width := image1.picture.bitmap.width; {debugger confirms the value is as expected}

   Image1.height := image1.picture.bitmap.height;  {debugger confirms value}

   Image1.picture.bitmap.pixelformat := pf32bit;  {same as the image that was just assigned}

  {use debugger and evaluate assigned(image1.canvas).  Result : true}

the very next instruction has an access violation ($C0000005).  And the command?

  Image1.canvas.pixels[0,0] := clblack;

How can an image and picture exist without a canvas?  Before doing the assignment, I used scanline to go through a_different_bitmap_image (a tbitmap) that was about to be copied to ensure that it was there and the size I expected -- it is.  Ever seen something like this?

App increases Android/iOS storage data size!

$
0
0

App increases Android/iOS storage data size!


Hello!

have a app with a feature using WebBrowser (Firemonkey). It opens a simple web page, with disabled cache.
So, every time I open a simple page , the apps storage data size increases!


How can I clear Storage Data?


Thanks!

Listview ScrollViewPos

$
0
0

hello

how to get the max value of ScrollViewPos for listview?


Extremely large win32 exe file size 10.2 Delphi

$
0
0

I've decided to learn Delphi since I found it perfect for my needs, however while taking a first look at the IDE I've fired up a "VCL Forms Application - Delphi" resized the form and added a button, nothing more. After compiling it, I was socked that I found in the Debug folder the EXE file was INSANLY large!! A 10MB file with NOTHING on it. just a blank button(no code) and a blank form. Even tried removing the button, nothing changed.

Thought it could be the application icon, found that it was the one IDE provided, 56KB in size. 

I've tried the Release config, which helped putting it down to 2MB which is still VERY unacceptable for a blank application.

I've tried googling found some complains about file sizes but nothing of my situation (blank app, no code, no tools etc), and also tried editting some configuration settings(Debug info OFF etc) in Debug and Release and in both nothing changed. 

Delphi Starter 10.2 is the one I'm using.

Is this supposed to be a normal thing or am I supposed to do something?

 

Apple App store firemonkey static library problem

$
0
0

I wanted to publish an ios firemonkey application and got the following rejection reason from apple.

"Your app contains static libraries but static libraries are not allowed in apps. Please remove those files and resubmit your app."

 

Has anybody met this? Do they mean static library a ".a" file? Because I use a third party component and it has such a file I added to the deployment file list.

Galaxy Tab 7 shows up in DevicePresets.xml but not in View Selector in IDE (Berlin C++ Pro)

$
0
0

I am trying to target a Samsung Galaxy Tab 3 7" for screen design in the IDE.

In the Form Designer I can select Android as the Style, but the View selector lists generic Android entries:

Android 3.5" Phone

Android 4" Phone

Android 5" Phone

Android 7" Phone

Android 7" Tablet

Android 10" Tablet

I have looked on many sites to see how to add a View to the View selector which have led me to discover that they need to be listed in the DevicePresets.xml hidden away in apadata. I located the file opened it to find a multitude of Samsung Galaxy phones and Tablets defined, but cannot find them in the View selector within the IDE

 

Does anyone know what packages I need to import to have these show?

On lots of Embacadero youtube videos from the likes of Jim Mckeith et al, whenever they demo Android and show Views, it always shows more entries than I get in mine

 

Cheers

RAD Server Custom API Documentation

$
0
0

I have just started experimenting with RAD Server.  One of the features that make the investment attractive is the self documenting API’s feature, which would save a lot of work in supporting external partners connecting to our REST interfaces, and obviate the need to maintain a separate interface specification document, that would invariably falls behind the development.

I have followed the the tutorial in the wiki for creating one's first EMS resource all the way to deployment to a test EMS server. This works fine, without a hitch.

However, when I reach the custom API documentation tutorial, its just simply does not work.

When I call http://localhost:8080/api/apidoc.yaml the server returns:

{
  "error":"Error",
  "description":"Error: No Responses defined for: get "
}

 

The EMS development server has the following corresponding log entries:

{"Request":{"Resource":"API","Endpoint":"GetAPIYAMLFormat","Method":"GET","User":"(blank)","Time":"2017/08/11 12:59:46 AM","Thread":1732}}
{"Error":{"Type":"HTTP","Code":"500","Reason":"Error","Error":"","Description":"Error: No Responses defined for: get ","Thread":1732}}

 

Here is a snippet of my code from the tutorial:

unit Unit1;

// EMS Resource Unit

interface

uses
  System.SysUtils, System.Classes, System.JSON,
  EMS.Services, EMS.ResourceAPI,
  EMS.ResourceTypes, APIDocumentationEndPointObjectsDefinitions;

type
  [ResourceName('Test')]
  [EndPointObjectsYAMLDefinitions(YAMLDefinitions)]
  [EndPointObjectsJSONDefinitions(JSONDefinitions)]

  {$METHODINFO ON}
  TTestResource = class
  published
    // Declare the function
    function MakeJSON(I: Integer): TJSONObject; //It takes an integer as a parameter and returns a JSON Object.
    [EndPointRequestSummary('Items', 'Get items', 'Used to retrieve all the items', 'application/json', '')]
    [EndPointRequestParameter(TAPIDocParameter.TParameterIn.Path, 'Test', 'Path Parameter item Description', false, TAPIDoc.TPrimitiveType.spString, TAPIDoc.TPrimitiveFormat.None, TAPIDoc.TPrimitiveType.spString, '', '')]
    [EndPointResponseDetails(200, 'Ok', TAPIDoc.TPrimitiveType.spObject, TAPIDoc.TPrimitiveFormat.None, '', '#/definitions/items')]
    procedure Get(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse);
    [ResourceSuffix('{item}')]
    procedure GetItem(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse);
  end;
  {$METHODINFO OFF}

implementation
const
  TestValues: array [0 .. 2] of string = ('a', 'b', 'c'); // It creates an array of string values.

procedure TTestResource.Get(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse);
var
  LJSON: TJSONArray;
  I: Integer;
begin
  LJSON := TJSONArray.Create;
  for I := Low(TestValues) to High(TestValues) do
    LJSON.Add(MakeJSON(I)); //[{"index":0,"value":"a"},{"index":1,"value":"b"},{"index":2,"value":"c"}]
  AResponse.Body.SetValue(LJSON, True) // True causes AResponse to free JSON
end;

procedure TTestResource.GetItem(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse);
var
  I: Integer;
begin
  if not TryStrToInt(ARequest.Params.Values['item'], I) then //{"index":I,"value":value}
    AResponse.RaiseBadRequest('Index expected');
  if (I < 0) or (I >= Length(TestValues)) then
    AResponse.RaiseBadRequest('Index out of range');
  AResponse.Body.SetValue(MakeJSON(I), True);
  // True causes AResponse to free JSON
end;

function TTestResource.MakeJSON(I: Integer): TJSONObject;
begin
  Result := TJSONObject.Create;
  Result.AddPair('index', TJSONNumber.Create(I)); //Adds to the JSON object a pair {"index": I}, the index number.
  Result.AddPair('value', TJSONString.Create(TestValues[I])); //Adds to the the JSON object a pair {"value":String}, the string corresponding to the index number.

end;

procedure Register;
begin
  RegisterResource(TypeInfo(TTestResource));
end;

initialization
  Register;
end.

 

Has anybody else experienced this? I looks like the get method has not been fully implemented. Is there a fix for this (I have just updated to RAD Studio 10.2.1)?

 

Thanks in advance,

Simelane

Components tooltip?

$
0
0

Hi,

For years, when I hover the mouse cursor above a component in the component toolbar 

(I use the classic undocked editor setting with components on the horizontal toolbar)

I never get any tooltip showing me the name of the component if a project is open. I have

them only when there are no open project.

Any one with the same problem? Or better, a way to fix this? Sometimes it's convenient

to know which component you're going to click instaed of going through the search field.

 

 

Thanks for any help.

Viewing all 1888 articles
Browse latest View live


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