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 a working system that uses SQL Express as the database.
On 2 computers, window 8.1, everything is okay.
I have just installed another computer with Windows 10 and the program brings an error when assigning MyQuery.FieldByName('MyDateField').AsDateTime to a DateTime variable.
It only happens on this computer.

I have installed the program on my development computer that is also Windows 10 and using SQL Express and have no problems.

The ShortDateFormat is the same on all computers.

1. The command ShowMessage(ShortDateFormat) displays the same on all computers 'd/MM/yyyy'
2. FieldByName('MyDateField').AsString on the working computers displays the date in the ShortDateFormat, like '31/12/1999'
3. FieldByName('MyDateField').AsString on the new computer displays the date as '1999-12-31'
4. FloatToStr(FieldByName('MyDateField').AsDateTime) on the new computer raises error "'1999-12-31' is not a valie date time."

All the settings are the same

I have never seen anything like that and I need your help here.

Using Delphi 7 and SDAC
0
Cloud Class® Course: Microsoft Azure 2017
LVL 12
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Hello,

I need to use a SOAP interface of the Dogana in Italy.
I develop some code in delphi (berlin) using SOAPHTTPClient, but i become always this error:

"Impossibile passare dalla codifica corrente a quella specificata.
Line: 1
<?xml version="1.0" encoding="utf-8"?><s."

I try
HTTPRIO.Converter.Options:=HTTPRIO.Converter.Options+[soUTF8InHeader];
HTTPRIO.Converter.Options:=HTTPRIO.Converter.Options+[soUTF8EncodeXML];
HTTPRIO.HTTPWebNode.UseUTF8InHeader:=true;
HTTPRIO.Converter.Encoding := 'UTF-8';

Thank you for the help.

Andreas
0
I got a signed executable, when running on my local machine everything works fine but with one of our clients there is an issue when they try to run it from a network drive.
They get a "Open File - Security Warning" (see the image). When they run it from a local disk, there are no issues as well
network-drive-error.PNG
0
please help me to translate this memory loader to delphi

#include "stdafx.h"
#include <Windows.h>

DWORD GetSectionProtection(DWORD sc)
{
    DWORD dwResult=0;
    if (sc & IMAGE_SCN_MEM_NOT_CACHED)
        dwResult |= PAGE_NOCACHE;

    if (sc & IMAGE_SCN_MEM_EXECUTE)
    {
        if (sc & IMAGE_SCN_MEM_READ)
        {
            if (sc & IMAGE_SCN_MEM_WRITE)
                dwResult |= PAGE_EXECUTE_READWRITE;
            else
                dwResult |= PAGE_EXECUTE_READ;
        }
        else 
        {
            if (sc & IMAGE_SCN_MEM_WRITE)
                dwResult |= PAGE_EXECUTE_WRITECOPY;
            else
                dwResult |= PAGE_EXECUTE;
        }
    }
    else
    {
        if (sc & IMAGE_SCN_MEM_READ)
        {
            if (sc & IMAGE_SCN_MEM_WRITE)
                dwResult|=PAGE_READWRITE;
            else
                dwResult|=PAGE_READONLY;
        }
        else 
        {
            if (sc & IMAGE_SCN_MEM_WRITE)
                dwResult|=PAGE_WRITECOPY;
            else
                dwResult|=PAGE_NOACCESS;
        }
    }

    return dwResult;
}


inline BOOL IsImportByOrdinal(DWORD ImportDescriptor)
{
    return (ImportDescriptor & IMAGE_ORDINAL_FLAG32)!=0;
}

#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif

//typedef BOOL (WINAPI *pointMAIN)(int , char*);

typedef BOOL (WINAPI *pointWINMAIN)(HINSTANCE, HINSTANCE, LPSTR, int);


HMODULE MemLoadExe(PBYTE data)
{
    IMAGE_FILE_HEADER        *pFileHeader        = NULL;
 

Open in new window

0
I have a horrible problem with Delphi XE7.
The Hard Disk on my Desktop PC crashed and I had to reinstall Delphi XE7.
Although my Laptop and Desktop have identical structures for all the components and .pas files, I can't compile my Apps on the Desktop in the IDE.
The Laptop compiles like clockwork, but on my Desktop I get continuous "Out of Memory" exceptions, and then the IDE aborts.
I have tried to use IdeFixpack, and that made it even worse. I also tried Madshi's MadCollection with the same result.
I have spent 3 Days on this, without success. Has anybody an idea, what the problem could be?
0
This happens when a particular table is opening upon initialization.

Got this message using EurekaLog:

Exception:
--------------------------------
  2.2 Address: 008C4A85
  2.5 Type   : EApolloError
  2.6 Message: Scope Set failed.
  2.7 ID     : 4A5B93DE
  2.11 Sent  : 0

I'm aware this question is vague but I'm hoping someone on here has encountered a similar issue. Thanks.
0
I wanna make the mobile game called '2248' on PC and I'm almost done, im just having a problem with the Accept parameter of the Dragover event. The problem is that I want the program to allow the dragging only the panel which's caption is identical, or if I have already dragged a few panels before then also allow the drag if  the sum of the panels caption dragged before equals to the one im trying to drag to. And also, I dont want the panels to be able to dragged into panels that are not their 'close-neighbours', so only allowing to drag to the panels next to it.
Here is a picture of how It actually looks like, if u dont know the game:https://m.crazygames.com/game/2248
procedure TForm1.balklikk(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button=MBleft then begin
TPanel(sender).BeginDrag(True);
kiindulo:=strtoint(TPanel(sender).caption);
oszeg:=strtoint(TPanel(sender).caption);
end;
end;

procedure TForm1.over(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
begin
Accept :=(Source is Tpanel) and ((Tpanel(sender).caption=Tpanel(source).caption) or (oszeg=strtoint(Tpanel(Sender).caption)));
Tpanel(source).Tag:=1;
if (Source is Tpanel)
  and (Sender is Tpanel)
    and (Source <> Sender)
      and (Tpanel(Sender).Tag=0)
        and(Accept=true)
          and (State = dsDragEnter) then begin
z:=z+1; T2[z]:=Tpanel(Sender); Tpanel(Sender).Tag:=1; oszeg:=oszeg+strtoint(Tpanel(Sender).caption);
end;
end;

Open in new window

on the 'balklikk' event of the panel it just checks if it was a left click, if yes then the dragging begins. Also i have declared here a variable that later on in the over event counts the sum of the previously dragged panels captions. If the initial caption is= with the one we dragged to(source.caption=sender.caption) then it will go to a for cicle in which i store the dragged panels and also i increase the sum(oszeg) with the (sender), so next time something gets dragged, it also gets analyized whether the sum is = or not.
0
Hey,
I want to serialize an object to xml with delphi 7,  i searched but i didn't find a full solution, i think with HttpRio we can do it .
thank you in advance.
0
Hi. I'm working in Delphi xE7.  I recently changed computers.  I installed the same delphi on the new pc and when I tried to run a certain part of my project where I use a Timage on a form I got an exception EInvalidGraphic with message "Unknown picture file extension (.png)."  Mind you this program was working on the previous pc.  Is there something that I'm missing perhaps when I installed on the new pc?  Any ideas or suggestions of what I could look for would be greatly appreciated.  Thanks in advance.
0
Hi !
Are it possible to rotate a video using Dspack ?
Have downloded JongovEdgeDetectFilter but I can´t get it to work !
Ilkka
0
Upgrade your Question Security!
LVL 12
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Hello,i wish that you are fine
My problem is that i want to send a text file from my computer to another one using Delphi 7 how can i do this please
thanks.
0
I am using Delphi con connect to mysql, using myDac componentes (paid version).

I have a table called items(upc,description,retail,picture).
picture is a Blob Field storing .bmp or .jpg images.

How can I show a .jpg image from a BLOB field using the DBCtrlGrid and DBImage component on Delphi XE7.

There is no way for me to have .jpg in the Blob and be able to show it on the DBImage over the DBCtrlGrid, as if .bmp is the only image supported, only .bmp works ok.

I used the DBCTRLGRID to arrange the way visual components should display information, but it seems only to support display for .gmp images, I already put in use the .jpeg library but no luck.
DBCtrol_grid_noJPG_SUPPORT.png
0
Fast MM4 for Delphi, cant get fulldebugmode to work. When i link the fulldebugmode.dll to the tools/optoins/library/library path or /browsing  path or ion the same folder as my exe the program just wont rund after i build and hit F9/Run. It returns to the same state as after a run. I am missing something but what?
Flsdihf
0
My Delphi application for Windows is packed in appx so I can have it published in Microsoft Store. At the first run, the app creates a folder in <user>AppData\Roaming to store there some files accessible for the users. Here's the code:

MyFolder:=GetSpecialFolderPath(CSIDL_APPDATA)+'\MyApp';
CreateDir(MyFolder);
TDirectory.SetAttributes(MyFolder,[TFileAttribute.faNormal]);

Open in new window


It works fine. When the app is running, the users can open its dialog windows, see this folder with all the files, read them or write into them. But only from the app! The mystery is that this new folder cannot be seen in Windows Explorer. Even in Command Prompt it seems non-existent!

Can anybody explain what this means?
0
Hi Guys,

The idFtp has an important event that gets the results, I don't know how to set / use the event when I create the idFtp in runtime. I need to
an example for it.  Below you can see my code and use it to give me an example.

Thanks a lot

  Function RunFTP( FtpServidor ,  FtpUsuario, FtpSenha, FtpPorta,  FtpAutentica, FtpCaminhoUpload, FtpCaminhoResposta: String): Boolean;

  Result := True

  if EstaVazio(FtpServidor) or EstaVazio( FtpUsuario ) or EstaVazio( FtpSenha ) or  EstaVazio( FtpAutentica ) or
     EstaVazio( FtpPorta )  {or EstaVazio( SmtpCaminhoUpload ) or EstaVazio( SmpCaminhoResposta )} then Begin
     ShowMessage('As configurações de FTP não estão completas no parceiro: ' + CodCad);
     Result := False;
     Exit;
  End;


  if FtpAutentica = '1' then
     FtpAut  := true
  else
     FtpAut  := false;


  IdFTP1 := TIdFTP.Create();
  IdFTP1.Disconnect;

  IdFTP1.Host     := FtpServidor;
  idFTP1.DirectoryListing.DirectoryName:= FtpCaminhoUpload;
  IdFTP1.Port     := Strtoint(FtpPorta);
  IdFTP1.Username := FtpUsuario;
  IdFTP1.Password := FtpSenha;
  IdFTP1.Passive  := FtpAut;

  try
     IdFTP1.Connect;
  except
     IdFTP1.Disconnect;
     IdFTP1.Connect;
     Result := False;
     Exit;
  end;

  BarraRotina('UP',Carquivo+iif(Tipo = 'Upload',' Envio ',' Recebimento ')+' de Arquivo '+Carquivo,0,0);

  Try
    Try
      if Tipo = 'Upload' then begin
         IdFTP1.Put (cArquivo, FtpCaminhoUpload+Carquivo, true);
      end else if Tipo = 

Open in new window

0
I want to programmatically have a form made visible in its normal size on the screen, when currently it is minimized (so just appears as an icon in the windows bar
0
The last versions of RAD Studio allow you to create appx packages for Microsoft Store. This is what I'm trying to do now with my Delphi project for Windows. There are some additional files which should be included in the package; during the installation, I want them to go to the default data folder like <user>\AppData\Roaming\MyApp, so that the users can easily access them.

In RAD Studio, additional files are specified in Deployment Manager. There's a parameter called Remote Path which determines the folder where the file will be put. The default is '.\' which is the installation folder. I don't want all my files to go there. But I couldn't find how you can specify the default data folder.
0
In my Delphi application, I determine the current directory by SysUtils.GetCurrentDir function. Of course, when the app is run, the current directory is the folder in which the installer put MyApp.exe file. By default, it is C:\Program Files\MyApp

Everything looks different now, after I packed my program in appx, in order to make a UWP application and submit it to Microsoft Store. Now the app goes to the folder C:\Program Files\WindowsApps\MyApp_1.0.0.0_x86__sp51hrchc9zqj.  However, the function GetCurrentDir returns a different address which is C:\WINDOWS\system32

What can I do about it? I need the address of the folder where the exe file is!
0
I´m running a miniature callcenter with business clients who use Microsoft Office 365 as their enterprise calendar system. The clients usually have anything from 10 to 200 employees using O365 calendars. I need to be able to get our callcenter program to tap into the client´s calendars and retreive information (free/busy is most important).

Some background info that may be useful: We run FreePBX (Asterisk) as our telephony platform. Our agents use an in-house developed program to handle the calls and get info about the clients. The program is fully customizable (developed in Delphi) and talks with a MySQL db where all the client info is stored.

When our callcenter agent gets a call to one of the client´s phone number, the client´s company info is displayed together with a complete listing of all the employees. We currently have no way of telling if the employee is free or busy, as we cannot access their calendar. I would need to get that information added to the employee info in our MySQL db. Perhaps synchronized once every 5 minutes.

How would you suggest me to go about this? I accept suggestions to 3rd party plugins (for example for Delphi). Freelance gig may also be accepted.

Thanks and sorry about my bad english.
0
Free Tool: Path Explorer
LVL 12
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Hi
Can you some one help me for following
i am using Quick Report 6  and Delphi Berlin 10.1

What i need
 generate report and send via e mail  

option  to be saved or send mail
0
I have several documents that are actually *.rtf files, but the extension was changed to *.doc.
Now I need to know if it is actually a *.rtf or a real *.doc file.

So I'm looking for a Delphi function that will determine if a document-file internally is ​a *.rtf of *.doc file.
The function should handle older version of word documents too (like Word 98).
0
When I try to Deploy/Run F9 my FireMonkey mobile app from a Win10.1x32 machine to an Ipad 4 mini, I get the following error:

paclient exited with code 1

When I change the build target to Android, everything works fine. I used Delphi Berlin and XCode 9.2 and it's my first iOS app.

Can anybody give me an advise?
0
I have a text file available and I want to place its entire content (including carriage-return/line feed) in the ClipBoard ...
0
Hi,

This question is related, to :
OS: Win 10
Prog Lang : Delphi 10.2
Type: OAuth 1 Request
Api: Flickr API
Method: flickr.photos.comments.addComment
Description: Add comment to a photo as the currently authenticated user.
Required Params (3):
  1. api_key (Mandatory): API application key.
  2. photo_id (Mandatory): The id of the photo to add a comment to.
  3. comment_text (Mandatory): Text of the comment
Help: https://www.flickr.com/services/api/


Infos
My application IS
  1. - fully functional,
  2. - authenticated,
  3. - authorized
  4. - and already uses similar functions requiring authentication.
May Application HAS
- Read and Write perms
Photo ID IS VALID
- 37003221603
   
Question:
How to add a COMMENT on a photo knowing its ID using the method "flickr.photos.comments.addComment" provided by the Flickr's Api ?
I've written the following function returning the request to send to Flickr in a similar way done for all functions that are working without problem.
But this one gives me an invalid result:

"oauth_problem=signature_invalid&debug_sbs=GET&https%3A%2F%2Fapi.flickr.com%2Fservices%2Frest&comment_text%3DWord%26format%3Drest%26method%3Dflickr.photos.comments.addComment%26oauth_consumer_key%3De18bf8e598480c5e03091a6a1c0b76c3%26oauth_nonce%3D3FD8DA177DB415864FF5B52B9982B120%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1521484643%26oauth_token%3D72157663363639987-7eb5726589a2beb0%26oauth_version%3D1.0%26photo_id%3D37003221603"
0
Hi can you help to write correct Query for Filter 3 Data fields

for Example
Data1 , Data2 , Data2

txt1 = Data1
txt2= data2
txt3 = data3

ex1: Data1  and Data 3
ex2: Data 3 and Data2
ex3: Data 1, Data 2 Data 3

Qury.Close;
Query.Sql.Clear;
Qury.Sql.Add (Select * From Table1);
If Not (txt1.text = ' ')then
   Begin
   Qury.Sql.Add(Format ('Where Data1= ' '%s' ' ',[txt1] ));
  end;
If not (txt3.text = ' ') then
   Begin
   Qury.Sql.Add(Format ('and Data3= ' '%s' ' ',[txt1] ));
  end;

lets say txt1 one is blank then how to write correct code ?
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.