Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x

Delphi

59K

Solutions

17K

Contributors

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.

Share tech news, updates, or what's on your mind.

Sign up to Post

I have downloaded this function but can´t assign clis !
I will use it for VideoRotateFilter as I found on net ! I need it to my program  as read  pictures and videos from mobiles etc.
As you know you can hold mobile etc upside down or 90 degrees on side.

function LoadFilter(const Fhandle: HMODULE; clis: TGUID): IBaseFilter; overload;
Var
  DllGetClassObject: Function(Const clsid, IID: TGUID; Var Obj): HRESULT; STDCALL;
  ClassF: IClassFactory;
Begin
  result := nil;
  try
    If Fhandle = 0 Then
      exit;
    // NOTE: Fhandle is typically obtained as a result of LoadLibrary API
    //       call loading DLL hosting the DirectShow filter
    DllGetClassObject := GetProcAddress(Fhandle, 'DllGetClassObject');
    DllGetClassObject(clis, IClassFactory, ClassF);
    if assigned(ClassF) then
    begin
      if ClassF.CreateInstance(nil, IID_IBaseFilter, result) = ERROR_SUCCESS
      then
        exit;
    end;
  except
    exit;
  end;
end;

Can I got help for it ?
Ilkka
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE
LVL 5
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

In my Delphi project for Windows, I often render Japanese text on TCanvas of an image. Unfortunately, the vertical position of the rendered characters depends on the font family. When the font is MS Mincho or MS Gothic, it's positioned perfectly well. When it's Tahoma, the text goes a bit down. When it's Yu Mincho or Kozuka Gothic, it goes down a lot. So it's really difficult to align the text for all possible fonts. I need to calculate some parameter for every font to move the position upwards.

Some experts from another forum recommended to use the parameters from TTextMetric. There are several: tmAscent, tmDescent, tmExternalLeading, tmInternalLeading, etc. Theoretically, a certain combination of them and the font size in pixels should give me the desired value. But whatever I tried didn't work so far.

There must be a way to do it. Any ideas?
0
Hello guys

I have a function where I can set a print to as a default print.

Now I need to get the way to change the paper layout of it, I have a paper developed and I want to change it when I will print
a doc. Do you know any function or way to get that?


It is interesting that I can list all paper from my default printer with this function but I haven't found any way to set the paper with its name.

procedure TForm1.ListPaper;
var
  HPrinter: THandle;
  Forms: array of TFormInfo1;
  Count, Needed, Returned: DWORD;
  i: Integer;
begin
  Memo1.Clear;
  if OpenPrinter(nil, HPrinter, nil) then begin
    try
      if not EnumForms(HPrinter, 1, nil, 0, Needed, Returned) then begin

        // we should fail here since we didn't pass a buffer
        if GetLastError <> ERROR_INSUFFICIENT_BUFFER then
          RaiseLastOSError;

        Count := (Needed div SizeOf(TFormInfo1)) + 1;
        SetLength(Forms, Count);
        if EnumForms(HPrinter, 1, @Forms[0], SizeOf(TFormInfo1) * Count, Needed,
            Returned) then begin
          if Returned < Count then
            SetLength(Forms, Returned);
          for i := 0 to Returned - 1 do begin
             Memo1.Lines.Add(Format('Paper name: %s,   Paper size: %dmm x %dmm',
                            [Forms[i].pName,
                             Forms[i].Size.cx div 1000,
                             Forms[i].Size.cy div 1000]))
          end;
        end else
          RaiseLastOSError;
      end;
    finally
 

Open in new window

0
I'm trying to make a web server with TIdHTTPServer and so far it can display normal html pages. I want it to load this https://github.com/Facepunch/webrcon/tree/gh-pages site but It doesn't display it like it should be. A while back I made a web server with delphi 10 using the TcpServer component and that displays the site as it should be displayed but that component is no longer available in Rad Studio 10.2.2.

This is the following code for the command get event:
procedure Tfrmmain.idhtpsrvr1CommandGet(AContext: TIdContext;
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
begin
  with TStringList.Create do
    begin
      LoadFromFile('htdocs\index.html');
      AResponseInfo.ContentText := Text;
      Free;
    end;
end;

Open in new window


I never use indy so if anyone can help I would be great full.
0
Hello,

I wrote an Android App in Delphi.

I noticed the some applications are installed directly under root directory e.g. /sdcard/AnkiDroid or /sdcard/doubleTwist.
However my app is installed somewhere else (I think /sdcard/Android/data).

How can I change it? Or if I can't how can I make the installation make a folder in the root directory?
I need the user to copy a file there so as my app would parse it.

Thank you very much!
0
Hi.

I need to print a report (a simple pricelist), with some images (4 images for 4 pages ) before printing the nomal pricelist report.

Which is the best method?

Thanks!
0
h.GIFwhen I run the project I get this error message
how can i solve this problem please.???
0
Good Afternoon:

I have a code made in Delphi, in which, I see that a usb communication is established, of which, it is already done and I have no problems, but, my doubt is as follows:

  What is the function that is in the code, to be able to send a value in hexadecimal and in turn, have the answer in hexadecimal or capture the answer in hexadecimal. If possible, you can give me an example of sending and answering.


   I put the complete code so you can help me.

   thanks for your help

unit Unit1;
{************************************************* **************************************}
{*                    USB - Lectura / Escritura                                         *}
{*                                                                                      *}
{*                                                                                      *}
{*   Cómo se Usa:                                                                       *}
{*   Envío y lectura de datos al dispositivo:                                           *}
{*   string_result: = RWUSB ('DATOS PARA ENVIAR EN HEXADECIMAL', Read, Timeout);        *}
{*                                                                                      *}
{*   EJEMPLO (SOLO ENVÍO):                                                              *}
{*   s: = RWUSB ('FF FF FF');                                                           *}
{*                                                               

Open in new window

0
I have a base form and multiple other forms which are visually inherited from the base form.
There is a tdxbar component on the base form with 4 groups tdxnavbargroup.

I need one additional group in just one of the inherited form so should I add in the base form or just the inherited form?
0
Experts
What is best option in below scenario
I have two Delphi apps app1 and app2, they have their own data modules say dm1 and dm2 respectively.
Now I actually was running app2 from app1 hence there was no issue in accessing an query component placed in dm1 from a common frame being used by both apps.
Now I need to run app2 as standalone and it throws exception at a line where it sees the reference to query component of dm1.

So I have used ifdef conditional directives but is there any other solution?
0
Technology Partners: We Want Your Opinion!
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

I want to do just drawing on the image and save it with the image extensio
0
delphi de image üzerinde savepicturedialog ile resim kaydetme yapıyorum ve resmi kaydederken jpeg ten bmp ye çeviriyorum fakat dönüştürme yaparken dosya yoluna . jpeg kısmına dosyayı kaydederken yazılan ismin eklenmesi istiyorum nasıl yapabilirim.?
0
I am trying to read Thunderbird files such as Inbox in Delphi - to get the email addresses and to be able to parse the message contents and suchlike.

Is there a component or class that can do that publicly available? I believe Thunderbird stores the emails in the mbox format.
0
Hello,

Got some problems with cloning client datasets. Aggregate works after a cloning if the Aggregate active is first turned off and then back on, but if there is a Grouping level, no. It will stay blank. I checked the property of the index and of the aggregate field; both Grouping level's are still 1 after the clone and it works as is should until i clone...
0
how to save image in image object

if SavePictureDialog1.Execute then
Image1.Picture.SaveToFile(SavePictureDialog1.FileName);
this is not happening
0
On this form, there are (3) TDBGrids. OnCalcCellColors  or OnDrawDataCell, need to compare a value in grid1 with a corresponding value in grid3. The row color for all (3) grids will be determined by the comparison. >= Red, < Green etc...

The coloring is easy. However without ARow & ACol cell references, not sure how to index the values. Works great on a single grid.
Doing the comparison in this manner with negate the need to  Enumerate the data set.
0
I have an application that checks for files create by a Point of Sale application and then imports these files. It also compares the files and write to a settings file what the last time was it imported a file.

I have a problem where my application runs fine for a random amount of time (normally between 2-5days), then all of a sudden my application loses the ability to write to any file in Windows, even files created by my application and files that it was able to access just moments ago.

If you restart the application, everything works fine again for a random amount of time.

This happens on Windows 7/8/8.1/10/ server 2012

Code to write to the File:
function TFrmMain.CompareFileDate(sFileName : string): Boolean;
var
  dOldDate  : TDateTime;
  dNewDate  : TDateTime;
  ini       : TIniFile;
  iFileDate : Integer;
begin
  try
    //Get Old File Date
    ini := TIniFile.Create(IniFileName);
    try
      dOldDate := ini.ReadDateTime('Import','LastImportedFile',0);

      //Get File Date and Time
      iFileDate := FileAge(sFileName);
      dNewDate  := FileDateToDateTime(iFileDate);

      if dNewDate > dOldDate then begin
        Result := True;
        ini.WriteDateTime('Import','LastImportedFile',dNewDate);
      end else
        Result := False;
    finally
      FreeAndNil(ini);
    end;

  except
    on e : Exception do begin
      Result := True;
    end;
  end;
end;

Open in new window

0
Hello,

Im trying to add persistent fields (FieldDefs) and then add those fields to Fields. From the start i have only 2 fields:

Id : ftInteger
Name : ftString

When i create a new field "Test":ftString and try to add the new persistent field to "Fields" i get error "Missing dataprovider or datapack". Its a standalone use of clientdataset, no provider. When i then go to the fields editor and try to "add fields", the field dissiperar from field-defs. If i the right click on the cds and select "clear data", and then "create dataset" i get error "invalide fieldtype". If i skip to add persistent fields and just add it as a field, i get error "Catastrophic failure"....


Only way i found seems to:

(1) Manually delete all not persistent fields.
(2) Clear dataset
(3) Add the new persistent field
(4) Add all fields.

Not so very brilliant if i have properties on my fields. Clientdataset looks like it been around forever so i'm surprised it bugs like this, or am i missing someting?

unit MissingField;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Vcl.ExtCtrls, Vcl.DBCtrls,
  Datasnap.DBClient, Vcl.Grids, Vcl.DBGrids;

type
  TForm6 = class(TForm)
    DBGrid1: TDBGrid;
    ClientDataSet1: TClientDataSet;
    DataSource1: TDataSource;
    DBNavigator1: TDBNavigator;
    ClientDataSet1Id: TIntegerField;
    ClientDataSet1Name: TStringField;
  

Open in new window

0
I apologize for having to start another thread regarding this. But it's been over a week since the problem occurred. I have messaged a few members on here who are for hire but to no avail.

So the last time, my computer had a power outage while I was inserting data into a table on paradox. When I turn back on the computer and try to access the table it says the index was out of date. I believe it was because the something was written on the primary index and not the secondary which resulted in a header inconsistency. As suggested I downloaded some auto table rebuild/repair software; including the one that came with paradox (TUTILITY). After I rebuilt the index using TUILITY the problem was fixed, but another problem in another index occurred. This led me to doing a series of trial and error with the different software, and the outcome varied.

It seemed the more I messed with it,, little bits and pieces were being fixed, while I think perhaps I was making the problem more complex. And finally where I'm at now, most of the data is fine and I can work with, except one key component. My QTY-LEFT.DB shows some of the items with quantity left and the product order number, while a bunch of random ones are missing. I'm not sure if one of the software I used overwrote something. I deleted all my old files and index because I thought everything was fixed. It wasn't until I realized that this little bit was missing.

I've been working on it for eight hours straight today, but …
0
Free Tool: SSL Checker
LVL 11
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I have searched online and have been unable to find a recent example as to how the eBay API can be called from a recent version of Delphi XE using Indy.

If anyone can post here such a piece of code, I am sure it would save many people a lot of time trying to figure it out.

Many thanks!
0
Hi everybody,

I working to implement CD burning capabilty with IMAPI on D2007/XE/Berlin.
I don't want components or DLL.

I have try to write in Delphi this code:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364817(v=vs.85).aspx
with also the "Monitoring Progress With Events"
Has anyone already done it and can help me?
0
[Using Delphi] Hello Guys, i have a client/server unprotected application that cant be replaced and i dont have it sourcecode.
So i need to create a bridge between those applications like:
Client > ClientBridge > ServerBridge > Server
Why?
On ClientBridge i need encrypt the data sent from Client and on ClientServer i need decrypt those data and repass to server, server should answer so the process must be bidirectional.
I Could repass the data easily using Indy IdMappedTCPPort, however, i was wondering how to encrypt the data.
If i put any code on IdMappedTCPPort OnExecute() event the data is not repassed.
Keeping in mind that the "encrypt" could be of any type, the intention is to not allow the client comunicate directly with server without the bridge, and of course, protect the data.
0
after open file dialog how could i save this file to DB

openDialog := TOpenDialog.Create(self);
  openDialog.InitialDir := 'D:\';
 openDialog.Options := [ofFileMustExist];
//
//  // Allow only .dpr and .pas files to be selected
 openDialog.Filter :=
   'All files (*.*)|*.*';
//  // Display the open file dialog
 if openDialog.Execute  then
 title:=openDialog.FileName;
  TFileStream.Create (title, fmOpenRead);
  dbAttach_Title.Value:=title;
  //'File : '+openDialog.FileName;
//  else ShowMessage('Open file was cancelled');
0
I have this password-protected .mdb database. There is a table I need to copy into a different non-protected mdb database. I need to perform this task using Borland Delphi 7 ADO components. help?
0
Hey guys so I have a big problem. About 20 years ago my partner helped program a software for our business but he is no longer here with us. I have all my company information stored in this program. Yesterday suddenly my computer crashed while paradox was running. But I managed to boot it back up.

When I reopen PARADOX And try to access the directory this shows up

Cannot open LINEITEM.DB.
Index is out of date.
Table C:\GM2\LINEITEM.DB

Now I am completely computer illiterate and have tried to do my own research but it's like you guys are speaking in a different language. So it would really be appreciated if anyone can explain to me how I can fix this in more simple terms. I'm thinking reindex?
0

Delphi

59K

Solutions

17K

Contributors

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.