Delphi

Windows Authentication in Firebird 2.5

本小妞迷上赌 提交于 2020-01-14 14:38:28
问题 Can I login to firebird database using a Windows user instead of using SYSDBA and MASTERKEY credential? If Yes, please let me know the way to connect to the firebird database. I am using Delphi XE3 and Firebird 2.5. I need to authenticate user by logged in user after updating config file for "trusted" in place of default "native" as specified here: https://firebirdsql.org/file/documentation/release_notes/html/en/2_5/rnfb25-fbconf-authent.html This is my code : SQLConnection1.LoginPrompt :=

What parameters I can pass to this function?

主宰稳场 提交于 2020-01-14 14:11:34
问题 I found a function function RotateBitmap(var hDIB: HGlobal; radang: Double; clrBack: TColor): Boolean; that rotates an image. But I don't know how to call this function. What parameters I can pass to this function. I don't know how to use this func at all. 回答1: Judging by the code presented hDIB is a pointer to a single memory block containing 2 structures - BitmapInfo and bitmap's pixel array. You can obtain these structures from TBitmap using GetDIBSizes and GetDIB functions. If you are

What parameters I can pass to this function?

落爺英雄遲暮 提交于 2020-01-14 14:09:33
问题 I found a function function RotateBitmap(var hDIB: HGlobal; radang: Double; clrBack: TColor): Boolean; that rotates an image. But I don't know how to call this function. What parameters I can pass to this function. I don't know how to use this func at all. 回答1: Judging by the code presented hDIB is a pointer to a single memory block containing 2 structures - BitmapInfo and bitmap's pixel array. You can obtain these structures from TBitmap using GetDIBSizes and GetDIB functions. If you are

Passing binary data from Qt/C++ DLL into Delphi host application

橙三吉。 提交于 2020-01-14 14:08:26
问题 In a Program I want to uses QImage.bits() in Delphi. So, in Qt I was created a dll. the dll Source Code Listed in below: test.h: #ifndef TEST_H #define TEST_H #include "test_global.h" extern "C"{ TESTSHARED_EXPORT uchar* testFunc(); } #endif // TEST_H test.cpp: #include "test.h" #include <QtGui> QImage image; uchar* testFunc(){ image.load("c:\\1.png","PNG"); return (uchar*)image.constBits(); } and in the Delphi Side I use this code for using Qt dll: function testFunc(): PByteArray; external

Passing binary data from Qt/C++ DLL into Delphi host application

╄→尐↘猪︶ㄣ 提交于 2020-01-14 14:08:13
问题 In a Program I want to uses QImage.bits() in Delphi. So, in Qt I was created a dll. the dll Source Code Listed in below: test.h: #ifndef TEST_H #define TEST_H #include "test_global.h" extern "C"{ TESTSHARED_EXPORT uchar* testFunc(); } #endif // TEST_H test.cpp: #include "test.h" #include <QtGui> QImage image; uchar* testFunc(){ image.load("c:\\1.png","PNG"); return (uchar*)image.constBits(); } and in the Delphi Side I use this code for using Qt dll: function testFunc(): PByteArray; external

How can I make a system-modal window?

浪子不回头ぞ 提交于 2020-01-14 13:56:27
问题 Is it possible to make the main form of an application system modal ? My application will FTP a file from a remote company PC. Users should not be allowed to interact with the desktop while this process is in progress. Application.MainFormOnTaskbar := True; Application.ShowMainForm := False; ... FormChild.ShowModal; 回答1: It doesn't make sense to make the main form modal. Indeed, if you have an ordinary application with a (normal) main form, and then displays a modal form (e.g. a dialog box,

Getting arg to work in a varag function in Lua 5.2 (integrated in Delphi)

醉酒当歌 提交于 2020-01-14 13:25:50
问题 When using the Lua 5.2 API, the code below prints "nil" function __debug(szName, ...) print(type(arg)); end __debug("s", 1, 2, 3, 4); But this code does work when using Lua 5.1, and prints "table" 回答1: If you are referring to vararg function, the arg table was deprecated already in Lua 5.1. In Lua 5.2, you can use table.pack to create arg if you need it: function debug(name, ...) local arg = table.pack(...) print(name) for i=1,arg.n do print(i, arg[i]) end end 回答2: That's because arg has been

Why is this TStreamAdapter not released?

感情迁移 提交于 2020-01-14 13:01:50
问题 Compare these two snippets: (d as IPersistStream).Save( TStreamAdapter.Create( TFileStream.Create('test.bin',fmCreate),soOwned),true); (d as IPersistStream).Load( TStreamAdapter.Create( TFileStream.Create('test.bin',fmOpenRead),soOwned)); This fails on the second TFileStream.Create because the first isn't destroyed. This is odd since the parameter has the only reference, I thought it would get destroyed in closing up the Save call. So I tried this: var x:IStream; begin x:=TStreamAdapter

Convert Delphi Extended to C# [duplicate]

只谈情不闲聊 提交于 2020-01-14 12:47:31
问题 This question already has answers here : Delphi Extended to C# (2 answers) Closed 7 months ago . How to correctly convert Delphi Extended type to C# decimal? I have tried code from this post https://stackoverflow.com/a/34550718/2550543 ,with some values it works fine, but not with all. Example : 000000000000A08C0B40 == 4500, correct 0050AA7D3A1E33D30140 == 6,59999, correct 00D0F753E3A59BC4F73F == 25769803,776, should be 0.006 00A0703D0AD7A3B0FD3F == 1481763717,12, should be 0.345 Yep, both

How to perform an image stream preview to a Delphi 6 frame or form from a background thread efficiently?

微笑、不失礼 提交于 2020-01-14 12:37:12
问题 I have a Delphi 6 application that receives and processes an image stream from an external camera. I have the code on a background thread since it is CPU heavy and I don't want it interfering with with the user interface code that runs on the main thread. I want to update a rectangular area on a form or frame with the TBitmaps I create from the camera's JPEG frames that are received at a rate of 25 frames per second. I want to know what method will give me the best performance and what