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

FireDac: any way to get SQL data as an object?

$
0
0

Hi,
I was wondering whether it's possible to actually get the result of an SQL statement as an object?
Did anybody typecast a result into an object?

Something like:
The class TProduct has a idProduct: integer, idName:String, idPrice:integer and equivalent fields in a Database, is it possible to get the select from the DB and avoid the idProduct := sql.FieldByName("idProduct").AsInteger, etc... ? A kind of auto field matching, filling the variables automatically (besides blobs)?

The example here is simple, but when you have 20+ fields it's more cumbersome: you need to manually assign each field.
That would be convenient too to write data into the DB.
I'd like to avoid storing the class as a BLOB so we can still query the values.

Thanks for any guidance.

Steve


TWebBrowser OnEnter and OnExit do not fire. Component takes focus but other controls are not being told they are de-focused.

$
0
0

Delphi 10.1 Berlin and Delphi XE8 (have not tried other versions). Simple to re-produce. Create a form. Put a TWebBrowser and a grid (string grid of URLS). When grid row changed, navigate to URL using TWebBrowser. Click on Web Browser to scroll up, down, right or left. (Does not matter). Cannot click on another row in the grid to switch to another URL. If third control like an edit box or check box is placed on the form. It can be clicked on to trick Delphi into de-focusing the grid and focusing the control. Then you can re-focus the grid, but same situation entered if TWebBrowser clicked on. I ran across a potential work around on the web where someone suggested finding all child windows of the TWebBrowser after the URL has finished loading and monitoring the focus state of the windows to send the notification through the form to de-focus all other controls.  Sounds like something that should be enhanced or fixed in the TWebBrowser component. Please assist me in what would appear to be an every time one uses a TWebBrowser component problem.  

Thank you, Ron        

iOS output: err=Unable to mount developer disk image. (e800000e)

$
0
0

For weeks now I try to get around this problem but nothing helps, no helpful information on the internet.

Development System (everything up-to-date)

Vmware Fusion /w Windows 10
Delphi 10.0 Seattle update 1

Mac (everything up-to-date)

MacPro /w El Capitan 10.11.5
Xcode 7.3.1
iOS 9.3.2

All certificates, provisioning profiles are valid and installed. My customer has similar problems and if I cannot find a solution the project will fail. 

Chunked File Upload with IOS App leads to Server Exception EConvertError, same App works on Android 100%

$
0
0

The app I work on uploads image files in chunks (sent as TStringstream) with a final TMultipartformdata using THTTPClient..
This system works 100% on Android but on iOS the server raises exceptions like this

Exception EConvertError: Invalid URL-encoded char (%Yπ) at position 69

Tried anything with encoding but nothing helps. 
The app is developed with Delphi 10.0 Seattle Update 1,
the server uses a dll developed with Delphi 2007.

Anybody an idea what the reason could be ?

Can't access Android Emulator

$
0
0

I have been unable to attach the debugger to my Samsung S6 phone, so I used the AVD Manager to create two virtual phones.  I can deploy both devices on my Windows 10 development machine, and they come up as targets in the project manager but there is some kind of error as they have a red-X associated with them - see below.  Does anyone have any idea how to fix this?

 

How can I calculate all field and post (SQL/or onncalc)

$
0
0

Hi. I want to calculate all fields and to total field. How can I do this. I did this with sql command. but I don't know how to update dbgrid everytime. my code :  procedure TForm1.Button1Click(Sender: TObject);

begin

ADOQuery1.Close;

ADOQuery1.SQL.text:='select names,big1,small1,black1,big2,small2,big3((big1+small1+black1+big2+small2+big3)*0.35) as  total from adlar7v';

ADOQuery1.Open;

end;

when I run this code first time working  second time changes doesn't appear db grid. 

Second method: 

I did this with adoquery oncalcfield event but there is a problem. I know how to calculate field but don't know how to  multiplication(*) all field after (+)

my codes:

ADOQuery1.FieldValues['total']:=ADOQuery1.FieldValues['big1'] + ADOQuery1.FieldValues['small1'] + ADOQuery1.FieldValues['black1'] + ADOQuery1.FieldValues['big2'] + ADOQuery1.FieldValues['small2'] + ADOQuery1.FieldValues['big3'];    

 

sorry for bad English 

How to "Open In" (iOS) and "... Send" (Android) in Delphi?

$
0
0

Hi

I would be interested in any advice and/or example, documentation regarding the best practices to share data from smartphones and tablets, under iOS and Android (for Delphi or C++Builder)

That means being able to have my application appear as an option in the "Open In..." menu in iOS or "Share"/"Send" under Android, my app being the recipient.

Then being able to trigger my app and receive the sent data.

Finally, the other way around: any way to implement the share option for text or file in order to be able to send them to a 3rd party app on the device, my app being the sender.

What are the mechanisms? What format should the data comply with?

Thanks for any light on these matters.

Steve

Delphi 10.1 freeze compiling android app

$
0
0

Hi there,

i downloaded the Delphi 10.1 Berlin Trial Version and trying to compile an Android app. but the compiler freezes by signing the HeaderFooterNavigation-unsigned.apk (test app )

The first time i tried to compile the app Delphi downloaded and installed the SDK and NDK by itself.

JDK is also installed in the Windows 10 VM

 

How can i fix this problem? We want to buy Delphi 10.1 if we can create android apps with it.

 

Sven

 


Readily available documentation

$
0
0

The development community desperately needs more direct access to tutorials, white-papers, and other forms of documentation. Upon registering for certain materials, I have received roughly 50% of what was requested, and too frequently, never received the ability to effectively or efficiently download them at all. If the company is looking to increase the developer base, providing pertinent, readily available documentation is an important component to help facilitate this need. Developer's need help when trying our new platforms and capabilities - if the right examples aren't there, everyone struggles. Thoughts?

Data Error - TFDJSONInterceptor::JSONObjectToDataSets();

$
0
0

Hello to everyone.

I use the following code to match the dataset inside a JSONObject to a TFDMemTable

(it was for me very usefull this post http://community.embarcadero.com/blogs/entry/cbuilder-xe6-multitier-database-app-with-firedac-json-reflection-40330)

//Code executed after a datasnap server response
TJSON::JSONObjectToMemTable(static_cast(JSONObjectRespuesta->Get("Empresa")->JsonValue),FDMemTableEmpresa);

void TJSON::JSONObjectToMemTable(TJSONObject *JSONObject, TFDMemTable *FDMenTable)
{
FDMenTable->Close();
FDMenTable->Active = false;
std::auto_ptr LDataSets(new TFDJSONDataSets());
TFDJSONInterceptor::JSONObjectToDataSets(JSONObject, LDataSets.get());
assert(TFDJSONDataSetsReader::GetListCount(LDataSets.get()) == 1);
TFDAdaptedDataSet *LDataSet = TFDJSONDataSetsReader::GetListValue(LDataSets.get(), 0);
FDMenTable->AppendData(*LDataSet);
}


i use that routine without problems in RAD Studio XE8. However i upgrade my Rad to 10.1 Berlin and the code stop working.

the execution stops on the line: 

TFDJSONInterceptor::JSONObjectToDataSets(JSONObject, LDataSets.get());

and the only error message i can get is "data error".

i checked the documentation but it seems that anything change with TFDJSONInterceptor object.

Do you have an idea of what is happenning?
Is there something wrong with my code?

thank you for reading.

A Best Way To Find The Duplicate File

$
0
0

If you often find that you create duplicate files as you rename or use files in another context, or just backup more than you had intended, Duplicate File Detectors help you find and/or delete these duplicates and regain the storage space they previously occupied.

Judging from some of the recent comments, it would appear that some cautions should be noted before using this type of software. One might also note that with the cost per gigabyte rapidly decreasing, redundancy is no longer such a bad thing.

What is the duplicate files? There are different degrees of definition. Look at the "Name": the file name must be the same? Look at the "real": the same is a binary bit stream, or to the "content" the same? Most stringent, of course, is to copy a file to another directory, the name is exactly the same content. But in some cases, especially for lossy compression or change the compression ratio, although the binary bit stream is different, but we think they are the same file. For example, two different jpg, file size, but the same picture; 2 mp3, accuracy is slightly different, but the same song; two zip, compression ratio is different, but inside are the same files on different space...... Suppose, we have different solutions. The most rigorous comparison, look at the file name, size, and checksum. Compare by content, you actually have to consider the decoding process, therefore, there will be some more specialized tools, such as re-check found pictures, music, re-check, re-check the video.You should need a true duplicate file finder,which is a good helper for you.

 

Suggest a duplicate file finder tool, used personally feel the best, and is free, but is in English, not Chinese version, I think a little English foundation can use to software title NoClone software size 565 KB Operating environment Win2003, WinXp, Win2000, Nt, WinMe, Win9x License free English language version of the software software Description NoClone is able to scan the computer in the same file name, exactly, 0 byte file, not only to avoid wasteful duplication of files on your computer space, It can also be used as a hard disk / CD-ROM file comparison.I think NoClone is the best duplicate file finder.

 

Unlike other duplicate file finder tools which use MD5 match algorithm, NoClone applies binary comparison that ensures the duplicate files uncovered are exactly the same in content. That would allow you to delete duplicated files without being worried about false duplicates.

 

Support a wide range of file types including document files such as docx, xlsx, pptx; audio files such as mp3, wma, wav; video files such as mp4, vob, flv; images files such as jpg, gif, bmp;Outlook emails and more! Also work with removable media devices like floppy, usb, etc.

 

As a fast duplicate file finder, NoClone Smart Marker allows you quickly pick up duplicate files and folders for removal by size, date, version, folder and file name pattern. You can increase free disk space up to 50%, and thus no need to purchase an external hard-drive.

 

You may interested on: free email marketing

 

 

The first app I tried to compile in Delphi v10 Berlin throws this error...

$
0
0

[dcc32 Error] The specified task executable location "c:\program files (x86)\embarcadero\studio\18.0\bin\dcc64.exe" is invalid. I installed for Win32 only, but the reference to dcc64.exe seems like the compiler is looking for 64bit file. Anyone know how to fix this?

Notification.FLAG_ONGOING_EVENT

$
0
0
  • android java

  notification.flags |= Notification.FLAG_ONGOING_EVENT; 

  notification.flags |= Notification.FLAG_NO_CLEAR;

     ->

  •       delphi 10.1
    TNotification is no flags
    how to write

How to get the runtime stack information for an error? In the FireMonkey.

$
0
0

  In firemonkey, an unknown error has been learned in the APP, and how we should get the stack information at run time.  

How to get access to previous version of Delphi ?

$
0
0

Hello, I just bought Delphi Berlin 10.1. I need to have access to previous version XE6 and XE7. How I can do that Thanks Bengeloune


Email

$
0
0

Hi All,

 

Am in a fix and want to know how i can resolve this issue. I have an application developed in delphi XE7 and indy components. I have placed it into an application server. From the architecture diagram we have the application server only allowed connection to the mail server. When a user tries to send an email then the application picks the users computer IP and not the servers IP hence connection to mail server is rejected. How can i go around solving this. Thank you.

 

--

Zack

Surprise of the Day

$
0
0

Hi All,

Yesterday I had a real unpleasant surprise with the Seattle IDE freezing.

After some rounds of edit - crash - kill - restart, I managed to boil it down to this line:

Const AName: array [0 .. 1] of TPoint = ((X:0, Y:1), (X:1, Y:0));

The syntax of the initialization may actually not even correct, but since the IDE hangs before telling me what it doesn't like, I have currently no way to tell you how to correctly place the punctuations ..

It's actually not even important how you try to initialize the content,
the Compiler just seem to not like a constant of type array of record.

Have to work around that pitfall now :o

What was your surprise of the day?

Cheers,

Tarek

Can't create packages in Delphi 10.1 Berlin

$
0
0

Hi,

Environment: Windows 7 SP1
Installed: Delphi 10 Seattle and Delphi 10.1 Berlin

I can't build any package in Delphi 10.1 Berlin.
I have no problems when building the same packages in Seattle.
Even the simplest package with only 1 basic unit in the contains-section gives errors:
E2200 Package 'Package1' already contains unit 'Unit1'

package Package1;

{$R *.res}
{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO OFF}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS ON}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION OFF}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO ON}
{$SAFEDIVIDE OFF}
{$STACKFRAMES ON}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DEFINE DEBUG}
{$ENDIF IMPLICITBUILDING}
{$IMPLICITBUILD ON}

contains
  Unit1 in 'Unit1.pas';

end.


unit Unit1;
interface
const
  ourTest1 = 'Test1';
  ourTest2 = 'Test2';
implementation

end.

Any idea what's wrong ?
Regards

Freddy

 

 

Memory leak after upgrade to Delphi 10.1 Berlin

$
0
0

Hi all,

i recently upgraded to Delphi 10.1 Berlin from 10 U1 Seattle.

After that I get a memory leak reported by the IDE.
The Code hasn't been changed after the upgrade, so something must have been changed in the Delphi sources.

What I have figured out so far is, that it is somehow related to the TMenuBar component.
When I run the application and not touching the main menu in any way, then the memory leak is not reported.
But as soon as I click on a menu item (opening the menu is already enough, no need to execute a menu entry) the leak is reported after closing the application.

Is it a known problem?
Is there a workaround?

 

You can very easy reproduce the error by:

1. Create a new Firemonkey desktop application
2. drop a TMenuBar item on the form
3. add some menu items
4. set  "System.ReportMemoryLeaksOnShutdown := True;" in the application unit
5. run the application and click the menu item
6. close the application

Here you go... a memory leak should be reported after closing the app.


Some Info:
I am developing on a windows 7 system;
The IDE is version Delphi 10.1 Berlin;
The application is based on the FMX framework.
Styles are used (but disabling styles did not help) 

Greetings

A. Hoppe

OnFormCloseQuery not working in Delphi 10.1 Berlin anymore

$
0
0

Hi,

I recently upgraded to Delphi 10.1 Berlin.
After upgrading the OnFormCloseQuery-Event of a Firemonkey-Form dos not work anymore.

To reproduce the error simply:

1. create a blank Firemonley Desktop-Application
2. create a second form
3. in the OnFormCloseQuery event-proc of the second form set "canClose := False" to prevent the form from closing
4. drop a button on the first (main) form
5. in the OnClick-event of the button, create the second form and call "ShowModal" to display the form.
6. destroy the second form after showModal.
7. run the application

Now you can observe that the second form can be closed without any error.
The CanClose := False is simply ignored.

We use this feature in multiple applications very excessive to ask the "Close window without saving?" question.
So this is definitely a show stopper!! It renders 10.1 Berlin useless.

Will this be fixed in the near future?

Greetings

A. Hoppe 

Viewing all 1888 articles
Browse latest View live


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