Quantcast
Channel: Recent Topics - Forum - Embarcadero Community - Embarcadero Community
Viewing all 3677 articles
Browse latest View live

Delphi TColor formats - by: Keith

$
0
0
Could someone explain to me the color strategy in Delphi? It seems very unusual compared to everything else I've worked in. I don't understand the numeric designations. I know I can say this:

var myColor: TColor;
myColor := rgb(158,54,210)
or
myColor := clYellow;

I get all that.

But I wanted to set up some color constants and it for obvious reasons can't use the rgb function. It has to be like this:

const myColor := $651541;

It's clearly not a hex color. I tried that. I used all sorts of converters online and on my system to convert an rgb code to some sort of numeric value I could use but it never came out right.

I even tried this to figure out the code:

var x: TColor;
x := TColor(rgb(158,54,210))
and then put a break point on x so I could see what it was. That didn't work either. What I expected to be beige turned out to be some sort of blue.

How do I convert something like rgb(158,54,210) to a $ color code that I can use in code? This is very annoying sometimes. Like I said, I've used all sorts of other systems and this seems quite different and I'm not finding anything useful online to help me understand this even in the Embarcadero Delphi documentation pages.

And when I go into a color setting in the properties window of a control and try using what's supposed to be hex according to Delphi documentation, that doesn't work right either. None of this really makes any sense. I ended up bailing on my constants and just used variables that I set to rgb colors in the startup routine of my application but I'd really like to know how this is supposed to work.

Thanks,

Keith

Firemonkey/Delphi Listbox Multiselect Help - by: Gord

$
0
0
Hello,

I am using Delphi 10.2 Version 25.0.29039.2004.

I need help finding out which items in a TListbox are selected when multiselect:=True;

I've Googled this to death, and every help article suggests that I use this code:

for loop := 0 to Listbox1.Items.Count -1 do
if Listbox1.Selected[loop] = True then ; //Do Something?

This doesn't compile, it gets a "Class does not have a default property" error.

Does anyone have any way of getting a list of selected items in a TListbox in Firemonkey (Delphi)

Thanks

Active Directory in C++ Builder - by: Gabe

$
0
0
Has anyone here have any experience with Microsoft's Active Directory with C++ Builder?

I've found Delphi projects and there's possibly a Visual Studio project, but just wanted to see if anyone has done it with Tokyo before I dive into the other solutions.

It would be great if anyone had any sample projects as well! Thanks!

calling MDI Child gives debug output message - by: W.

$
0
0
When calling a MDI Child form from a MDI Form, debug output shows:
windows\dwm\dwmapi\attribute.cpp(92)\dwmapi.dll!73013CF4: (caller: 709D90ED) ReturnHr(2) tid(1fb8) 80070006 De ingang is ongeldig.

Can it do any harm? Can it be solved?

Linux Paserver Mismatch Error - by: Chris

$
0
0
trying to setup connection to linux. Deployed and running but I have a version mismatch.
Tokyo 10.2.3
Connection refused. Platform Assistant Server Mismatch - expecting version '10.3.1.10'
The only linux PA server online and in my install are version 10.2.1.13
Where can I find the version I need?

RAD Studio XE10.2.3 and Push Notification Android Dont Woking - Debug Mode - by: Emailx

$
0
0
hi Friends,

Here my problem with "trying" to do one simple apps to "Push Notifications" using:
-> RAD Studio XE10.2.3
-> Firebase service (GCM) by Google.

First, I have my account in Google, and, on Firebase services, I have my project created and one apps defined.
I have my ID and Key to my project/apps! Its ok, for while!

My project in RAD Studio, is very simple:
--> 1 form FMX (in blank)
--> 1 component EMSProvider (without any changes, all default property for tests)
--> 1 component PushEvents, bind in EMSProvider, without any changes, too!
--> there is not any code in my project! Just this components above.

In my project OPTIONS, I have: (for all config Android (Release or Debug)
--> Entitlement List -> Receice Push notifications = True
--> Verions Info -> apiKey = (Nothing) for test of compiling not for Firebase service (GCM) message

Here my Unit.pas
*****************
unit uFrmMainAppPush;

interface

uses
System.SysUtils, System.Types, System.UITypes, System.Classes,
System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics,
FMX.Dialogs, IPPeerClient, REST.Backend.PushTypes, System.JSON,
REST.Backend.EMSPushDevice, System.PushNotification, Data.Bind.Components,
Data.Bind.ObjectScope, REST.Backend.BindSource, REST.Backend.PushDevice,
REST.Backend.EMSProvider;

type
TFrmMainAppPush = class(TForm)
EMSProvider1: TEMSProvider;
PushEvents1: TPushEvents;
private
{ Private declarations }
public
{ Public declarations }
end;

var
FrmMainAppPush: TFrmMainAppPush;

implementation

{$R *.fmx}

end.

my projec with 10KBytest: https : / / oload . site / f / RssdHI9eVO4 / MobileAndroidPushNotification.rar
*****************
The project compiled and was sent to my smartphone, however, when trying to run I got the error message on the Debug screen of RAD Studio (not on the smartphone):

"Can not Bind Address: Address Already In Use Existing"

This for a long time, and several tests. I created more than one project and this message was always displayed.

In this way, the app was run on the smartphone, however, it was "stopped" on the app's only home screen (since there were no other forms in the app).

On the smartphone side, no messages were shown. Only on the RAD Studio screen, in Debug mode. I could, on the smartphone, run the apps and nothing was shown error.

After several attempts, finally the application was compiled and executed without any error screen in RAD Studio, however, this time, before sending the application to the smartphone, now AVG Internet Security 2018 (antivius) "got" and showed a screen saying that the file "AndroidGDB.exe" was trying to access the internet. Something that had never been told before. By the way, I had already put the "ADB.exe" in the list of "exceptions" of AVG 2018.

Conclusion The new Antivirus with Firewall software seems to be more hostile with many applications than before, not even noticed.

Well, now, a new clash begins between me and RAD Studio.

Now, after losing so much time with the above mentioned error, I come back to a new error that I was already trying with trying to create a test project for "Push Notification" messages.

Well before the above error, I was not able to understand where the error was with my project, since I had no code to promote the error that I will describe here.

Always after the application was sent to the smartphone and executed without any error, when closing it and returning to RAD Studio I had the following errors: (always in DEBUG mode)

Debugger Exception Notification: Project "NovoPush.apk" raised exception class Segmentation fault (11).

And right after the second error screen:

Debugger Exception Notification: Project "NovoPush.apk" raised exception class EAccessViolation with message 'Access violation at address 746F4E64, accessing address 746F4E64

And then Debug was terminated in RAD Studio.

Now, let's understand my side:

1st, I do not have any source code typed in the project;
2nd, I have only 2 components that are linked by one of their properties (EMSProvider and PushEvetns)

Nothing else! No creation of any object is created or deleted manually, as there is no source code in the project.

There is only one form, which is the main form. Nothing else!

And now, what to do to understand this error! I've been trying to figure out where the error is in the project for 4 days.

If I compile in RELEASE mode, no error is shown.
If I set the variable "ReportMemoryLeaksOnShutdown: = True;" in DPR, no further information is displayed. Only the above two error messages.

So I'm sending the source project so someone can understand and explain where the error is. Which I do not think they will find either.

In order to create this "Push Notification" project, I have already installed the "30831_rad_studio_10.2.3_android_push_notification_patch 2017-March-27" patch in the RAD Studio XE10.2.3 Tokyo, as already explained in several videos I already saw on YouTube about subject matter.

My lasts line in my "AndroidManifest.template.xml"
********************
<%activity%>
<service android:name="com.embarcadero.gcm.notifications.GCMIntentService" />
<%receivers%>
</application>
</manifest>
<!-- END_INCLUDE(manifest) -->
*******************************

My screenshots:
image.ibb.co/iBZTfT/SKD_MANAGER_CONFIG.jpg
image.ibb.co/jLhQS8/Cant_Bind_Address_Ad..._In_Use_Existing.png
image.ibb.co/dahTVT/Error1_later_run_in_...in_my_smartphone.png
image.ibb.co/cgT2qT/Error2_later_run_in_...in_my_smartphone.jpg
image.ibb.co/hKCOx8/My_Project_Definitions.png
image.ibb.co/gQRac8/Later_Sometime_Now_I..._Android_GDB_EXE.png

I hope someone can lend a hand, thank you in advance.

hug

[DCC Error] E2597 ld: library not found for -lbz2 - by: Md. Shariful Alam

$
0
0
I am trying to compile a blank project for iOS device 32/64bit but getting error "[DCC Error] E2597 ld: library not found for -lbz2". I am using Delphi Tokyo 10.2.3 with iOS patch 11.3 on XCode 9.4.1 iOS 11.4. Also I tried with older iOS with same error message, please help.

svg in delphi - by: Padam

$
0
0
Hello everyone, does anybody has any idea about using svg in delphi applications. if embarcadero has any plans to make standard component for it. of if there are some third party components.

database Interbase 7.5 - by: nicolas

$
0
0
Hello,

i need to access to an Interbase 7.5 given by a client, i never heard a thing about this type of database before.

I've installed Embarcadero Interbase 2017 trial.
Server is started.
ODBC driver is installed.

I've imported the .ib file into IBConsole, when i try to connect to the database i've an error :

Unsupported on-disk structure for file C:\Users\nicolas\Desktop\NC\WINDEPA\WINDEPA.IB; found 11, support 17

Somebody can help me ?
Thx

OLE Container - by: Mark Williams

$
0
0
I am housing Word in a TOLECOntainer. I have some horrible alignment issues with it. If you open and close any of the side panes for Word, the container does not realign itself it just leaves blank space. The only way I have found to do this is by calling DoVerb(OVSHOW). Which is first ugly and secondly involves a herculean feat to work out whether or not a side pane has actually been closed (mouse hooks and timers and all sorts!!).

I cannot find anything about this on the web and can't believe this is an unknown issue.

There are also awful alignment problems if you move the form with the OLE Container onto a second monitor. The ribbon no longer align to the top, side panes no longer correctly align. When you move back on to the main monitor, it all realigns properly. I am not sure if this is a related issue, but suspect it may be.

Linux - by: Keith

$
0
0
I am unable to compile any Linux projects that use REST components. I get 21 Linking Errors having to do with 'curl'
HELP! The Rest Components are a major part of my project

key mapping no longer works - by: peter

$
0
0
I'm running Seattle and a few days ago, the key mapping settings failed and can't reliably be reset. I've re-installed Seattle, but the problem has grown. Now the Recent Projects doesn't list my projects.

If I close a project, it shows in the recent, but when I exit and restart Delphi, it is clear again.

The IDE is now almost unusable because the arrow keys have stopped functioning in the edit window, but works elsewhere in the IDE. The backspace pops up the "Replace text" dialog box. It seems if the "Default" Key mapping settings have been cleared.







<hr />


UPDATE:

A workaround is to change key mapping settings, save and then change it back to "default" and save. Then exit and reboot computer. On restart run Delphi. key mappings work until I exit. Run Delphi again and the key mapping is messed up again.

If you do not reboot, the fix does not work.

Next day, this work-around doesn't work

AMAZON S3 - by: Manuel

$
0
0
I have a small command line application to upload/download/list items in S3 buckets<span id="transmark" style="display: none; width: 0px; height: 0px;"></span>

until X7 everything worked just fine

However, in 10.2, with exactly the same authentication, it works for upload/download but not for listing (getbucket)

TAmazonStorageService returns "Forbidden - The request signature we calculated does not match the signature you provided. Check your key and signing method. (SignatureDoesNotMatch)Date=Wed, 03 Jan 2018 19:55:38 GMT"

however the Key and the User are exsactly the same that are accepted when uploading/downloading

what is going on?

here is my code:

program AwsCL;

{$APPTYPE CONSOLE}

{$R *.res}

uses
System.SysUtils,
System.Classes,
Data.Cloud.CloudAPI,
Data.Cloud.AmazonAPI,
utilities in '..\..\del_files\utilities.pas',
ConfigUnit in '..\ALM\ConfigUnit.pas';

var
AmazonConnectionInfo: TAmazonConnectionInfo;
AmazonStorage : TAmazonStorageService;
s : TFileStream;
AmazonInfo : TCloudResponseInfo;
Bucket,Path,LocalPath : Unicodestring;
filename : Unicodestring;
content : TBytes;
AWSparam : Unicodestring;
AWSParamList : TStringList;
AWSResult : TAmazonBucketResult;
i,totcount,rp : integer;
firstname : Unicodestring;
failed : boolean;

begin
try
AmazonInfo:=TCloudResponseInfo.Create;
AmazonConnectionInfo:=TAmazonConnectionInfo.Create(nil);
{ TODO -oUser -cConsole Main : Insert code here }
AmazonConnectionInfo.AccountName:=ConfigParams.Values;
AmazonConnectionInfo.AccountKey:=ConfigParams.Values;
//AmazonConnectionInfo.Protocol:='HTTPS';
writeln(AmazonConnectionInfo.AccountName,AmazonConnectionInfo.AccountKey);
writeln(AmazonConnectionInfo.StorageEndpoint);
writeln(AmazonConnectionInfo.UseDefaultEndpoints);
writeln(AmazonConnectionInfo.RequestProxyHost);
Bucket:=ConfigParams.Values;
Path:=ConfigParams.Values;
if path[length(path)]<>'/' then path:=path+'/';
localPath:=ConfigParams.Values; if localpath[length(localpath)]<>'\' then localpath:=localpath+'\';
filename:=replacedate(paramlist.values);
if paramlist.Values<>'' then
bucket:=lowercase(paramlist.Values);
if lowercase(paramlist.Values) ='upload' then
begin
s:=TFileStream.Create(localpath+filename,fmOpenRead);
setlength(content,s.Size);
s.ReadBuffer(pointer(content)^,s.size);
// for I := 0 to s.Size-1 do
// write(content);

writeln('tamaño=',s.Size);
amazonStorage:=TAmazonStorageService.Create(AmazonConnectionInfo);
rp:=0;
repeat
try
failed:=false;
AmazonStorage.UploadObject(bucket,path+filename,content,TRUE,nil,nil,amzbaPublicRead,AmazonInfo);
except
failed:=true;
end;
inc(rp)
until (rp=3) or ((amazonInfo.StatusCode=200) and not(failed));
writeln('UPLOAD ',path+uppercase(filename),amazonInfo.StatusMessage,' ',amazonInfo.StatusCode, 'tries=',rp);
s.Free;
end
else
if lowercase(paramlist.Values) ='download' then
begin
s:=TFileStream.Create(localpath+filename,fmOpenWrite+fmCreate);
amazonStorage:=TAmazonStorageService.Create(AmazonConnectionInfo);
amazonStorage.GetObject(bucket,path+filename,s,amazonInfo);
writeln('DOWNLOAD',amazonInfo.StatusMessage);
s.free;
end
else
if lowercase(paramlist.Values) ='list' then
begin
AWSParamList:=TStringList.Create;
Split(paramlist.Values,';',AWSParamList);
// writeln(AWSParamList.Text);
// s:=TFileStream.Create(localpath+filename,fmOpenWrite+fmCreate);
AmazonConnectionInfo.StorageEndpoint:='s3.amazonaws.com';
AmazonConnectionInfo.UseDefaultEndpoints:=false;
writeln(AmazonConnectionInfo.StorageURL(bucket));
amazonStorage:=TAmazonStorageService.Create(AmazonConnectionInfo);
firstname:='';
totcount:=0;
repeat
AWSParamList.Values:=firstname;
//AWSParamList.Values:='/';
AWSResult:=amazonStorage.GetBucket(bucket,AWSParamList,amazonInfo);
writeln(amazoninfo.StatusMessage,amazoninfo.Headers.Text);
// writeln(awsresult.name);
if awsresult.Objects.Count>0 then
begin
for I := 0 to awsresult.Objects.Count-1 do
writeln(awsresult.Objects.Name);
firstname:=awsresult.Objects[AWSResult.Objects.count-1].name;
end;
until awsresult.Objects.Count=0;
writeln('Total Files: ',totcount,' ',amazonInfo.StatusMessage);
writeln(paramlist.Text);
// for I := 0 to awsparamlist.count-1 do
// writeln(awsparamlist);
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
end.

Delphi standard Memo shows UTF8 content, but when I save to a txt file, I get ? - by: Kai Inge

$
0
0
When trying to save content beyond ANSI in a Windows txt file, I get question marks instead.
This is after starting to use Delphi 10_2_3.
In Delphi XE7 I got the UTF8 content.
How do I set the character set to UTF8?

TListView Not Following VCL Styles - by: Richard

$
0
0
It appears that the TListControl in Delphi is not completely following the VCL styles for Windows as the target platform. The select color is the standard windows clHighlight color, not the color defined in the VCL style. To reproduce this, drop a TListView onto a form, set the ViewStyle to vsReport and add several items. Now in the project Options, enable Runtime Themes and under Appearance select something like Ruby Graphite which has the highlight color set to red. Now compile and run... you will notice no matter what style you select, the item selected in the TListView will always be highlighted by the system color clHighlight... I'm looking for a work around for my application... Regards, Rick Zarr

DBGRID doesn't show records - by: Barry

$
0
0
Hi, I have a form with a dbgrid in which I display records from a table, tLogging. I have a button which, when pressed, executes this code:

buttonSelected:= MessageDlg('Are you sure?',mtConfirmation, mbYesNoCancel, 0); if buttonSelected = mrYes then
dm2.fdqLogging.ExecSQL('DELETE FROM tLogging WHERE Username = :pUser', [ cMe ], [ ftString ] );

cMe has a valid string, set up earlier, and the code executes perfectly. Issue is that the dbgrid then shows no records, even though there are still lots. If I close the form down and reopen it those records are displayed.

Question is, why does dbgrid not show the remaining records after the SQL statement completes, and how do I make the dbgrid show them?

Forum Issue - by: Barry

$
0
0
Hi
When I enter this forum and press Answers, Create Question (after I've logged in), or the Create Question' link on the right', I get the normal form in which I can put a title and details of my question, but when I hit Submit I get an error saying 'Invalid' Captcha. Thing is, there is no Captcha shown on the page which I can tick. Very frustrating.
If I go to Forums, New Topic, I get the same form, but this time with a Captcha.
Can this be checked and maybe fixed, please, as it is not the best UI I've seen?

FMX project can not load on iPad when iPhone is installed - by: Ugur

$
0
0
Hello,

In the FMX project I add a button to the screen on the apple side and compile it, and I create the ipa file. I am getting the error that the app can not be installed on the iPhone phone while it is loading and running smoothly.

I am providing the udid control of the devices on the Apple developer side, I observe that it works fine, it does not work on other tablets. In the project settings Options / Version info UIDevice Family / iPhone & iPad is selected.

I have found that the problem is in the Delphi compiler, how can I solve the problem.

Delphi version. 10.2.3 (RAD Studio 10.2.3 iOS 11.3 Patch)

Thank you.

Indy UDPServer & UDPClient - by: taine

$
0
0
I have what I thought was a simple problem. I have several third party devices I need to communicate with over UDP. I need to send a UDP packet with specific data with a specific source port to a specific destination port on the device. The destination IP is a multicast device and multiple devices will respond. The device will send its response to the UDP I use as my source port. For example:

I send my packet to 239.192.38.7 from port 61234 to port 5000. The device will respond to IP 239.192.38.7 sending from port 5000 back to port 61234.

I can make either half of this work with no issue. The trouble is when I need to do both. I get an error that the port is already bound: "Could not bind socket. Address and port are already in use."

I have an UDPClient with host set for 239.192.38.7, port = 50000, boundPort=61234.
The UDPServer has a default port set for 61234.

TIdSocketHandle.SendTo fails for character > ASCII 127 - by: taine

$
0
0
Characters with an ASCII value greater than 127 fail to send properly. They send as $3F instead. There does not appear to be a SendBuffer equivalent.

BytesToString will also fail in the same way translating characters with an ASCII value greater than 127 incorrectly.
Viewing all 3677 articles
Browse latest View live


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