delphi-7

Using C++ interface in delphi/pascal

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 05:56:09
问题 I have the following interface defined in a dll: class TestInterface { public: int foo(int)=0; }; And the following functions let's me create objects of this type: extern "C" declspec(dllexport) TestInterface* __stdcall CreateInterface(); The interface is implemented in the dll and I can use it in C++ without any problems (I've also defined the .def file to make sure everything works correctly). However when it comes to using it in pascal I have problems. Here's how I'm trying to use the

Partial Search In Table(BDE)

孤街浪徒 提交于 2020-01-03 04:14:04
问题 I made a database with paradox 7. The usual search I do is a syntax like this: Table.Filter := 'Country=' + QuotedStr(Edit.Text); This returns rows those country field is same as the entered text in edit. when I want to search for countries are beginning by "L" i use this syntax: Table.Filter := 'Country=' + QuotedStr(Edit.Text + '*'); But how can I search for fields those are finished with "L"? this syntax does not work: Table.Filter := 'Country=' + QuotedStr('*' + Edit.Text ); Thanks. 回答1:

Optimizing TCHart drawing in Delphi 7

久未见 提交于 2020-01-03 00:01:14
问题 My previous question had some great input, but it didn't work for me because my problem seems to be Delphi 7 related. I have a chart with a single series (TFastLineSeries) and 3,600 datapoints which is taking up to 45 seconds to draw. Others have said that it should be lightning fast, so who can help, bearing in mind that I am using Delphi 7 and the standard TChart component. I suspect that instead of calling AddXY() 3,600 times I should be preparing the data first, then adding it all at once

Delphi GetClass

一个人想着一个人 提交于 2020-01-02 20:13:30
问题 My question is how to access a class which is in an other unit? For an example: program Project1; {$APPTYPE CONSOLE} uses SysUtils, Classes, System, StrUtils, Math, TypInfo, Data in 'Data.pas'; var Str, name, value : string; List, tmpList : TStringList; i : Integer; Obj : TObject; CRef : TPersistentClass; d : TData; begin d := TData(GetClass('Data.TData').Create); Writeln(Format('%s', [d.Name])); Readln; Readln; end. And the Data unit : unit Data; interface uses SysUtils, Classes; type TData

Sorting of Arrays Alphabetically?

限于喜欢 提交于 2020-01-02 08:43:31
问题 Say I have two arrays of string, named 'arrayone' and 'arraytwo' How would I go about sorting the 'arrayone' alphabetically (from A to Z), while still keeping relations to my second array. Incase you were wondering what is in 'arrayone' and 'arraytwo', 1 has surnames and 2 has the ages of each person. My end result is to add it to a richedit. Example of scenario: Smith 25 Appleseed 32 Gibbs 45 Must turn into: Appleseed 32 Gibbs 45 Smith 25 Please no stringlist, keep it in simple array and in

Sorting of Arrays Alphabetically?

久未见 提交于 2020-01-02 08:42:30
问题 Say I have two arrays of string, named 'arrayone' and 'arraytwo' How would I go about sorting the 'arrayone' alphabetically (from A to Z), while still keeping relations to my second array. Incase you were wondering what is in 'arrayone' and 'arraytwo', 1 has surnames and 2 has the ages of each person. My end result is to add it to a richedit. Example of scenario: Smith 25 Appleseed 32 Gibbs 45 Must turn into: Appleseed 32 Gibbs 45 Smith 25 Please no stringlist, keep it in simple array and in

delphi - calculate directory size API?

佐手、 提交于 2020-01-02 07:14:28
问题 Anyone knows other way to get a directoy's size, than calculate it's size by counting file with file? I'm interested on some win32 API function. I've google it about this, but i didn't found relevant information so i'm asking here. PS: I know how to calculate a directory size by using findfirst and findnext and sum all file's size. 回答1: Getting the size of one directory is a pretty big problem, mostly because it's something you can't define. Examples of problems: Some filesystems, including

delphi - calculate directory size API?

最后都变了- 提交于 2020-01-02 07:13:03
问题 Anyone knows other way to get a directoy's size, than calculate it's size by counting file with file? I'm interested on some win32 API function. I've google it about this, but i didn't found relevant information so i'm asking here. PS: I know how to calculate a directory size by using findfirst and findnext and sum all file's size. 回答1: Getting the size of one directory is a pretty big problem, mostly because it's something you can't define. Examples of problems: Some filesystems, including

How can I send keys to another application using delphi 7?

扶醉桌前 提交于 2020-01-02 05:27:14
问题 Ok, so Pretty much i am trying to send keystrokes of a string from and edit box to the active window and the enter key after. does anyone here know a working method of doing this in delphi 7? I have been searching for about an hour and a half for this now and i cant seem to find anything and the stuff I have found is ether for newer versions of delphi, or it just doesn't work. I have tried TTouchKeyboard but that's only for delphi 10 and newer. 回答1: I've used this to send text to an annoying

What tool can I use to merge wsdl and xsd file?

空扰寡人 提交于 2020-01-02 05:20:09
问题 I have two files, one with webservice description (wsdl), second with data structures used in webservice (xsd). I have nothing more, webservice doesn't work yet. I need to merge them into one, because Delphi 7 WSDL Importer doesn't handle included xsd files to well. Where can I find tool to do it? EDIT I copied xsd content into <types> section and it works. I tried it before, but I must have made a mistake and Delphi WSDL import didn't work. I have to improve my copy/paste skills. 回答1: You