Delphi

How to capture frames using Delphi/DSPack without displaying it on TVideoWindow?

ε祈祈猫儿з 提交于 2020-01-13 14:07:11
问题 DSpack has example code to play a DirectShow compatible video device and to capture the video frames simultaneously. A TVideoWindow is attached to the FilterGraph to display the video (Firgure-1). If you remove the TVideoWindow, then the Operating System (Windows) will automatically bring up ActiveMovie and display the video on a separate window (Figure-2). Is there a way to use DSPack to capture video frames without using any of the GUI components and without displaying the video? DSPack

WOW64 woes (.lnk shortcuts)

泪湿孤枕 提交于 2020-01-13 13:11:29
问题 I'm using Windows 7 (x64) and Delphi 2010. I'm writing a component that will emulate the start menu. However, I've run into the following problems: If I attempt to open a shortcut (.lnk file) with ShellExecute , this will fail whenever %ProgramFiles% is part of the target path of the shortcut (it will then look at the C:\Program Files (x86) folder instead of C:\Program Files ); ShGetFileInfo fails to extract the correct index of the icon in the system image list if %ProgramFiles% is part of

Zebra Printer direct communication

丶灬走出姿态 提交于 2020-01-13 11:37:48
问题 Based on this question I have implemented the following code to send direct commands to my Zebra TLP2844 var cmm: AnsiString; i: integer; begin commands.saveToFile('path\to\a\file'); Printer.BeginDoc; cmm := ''; for i := 0 to commands.Count-1 do cmm := cmm + commands[i] + #10; Escape(Printer.Canvas.Handle, PASSTHROUGH, Length(cmm), PAnsiChar(cmm), nil); Printer.EndDoc; end; commands is a TSringList containing all the commands I want to send to the printer. Note that I save all the commands to

How to disable all exception raising in Delphi?

风格不统一 提交于 2020-01-13 11:26:09
问题 Is there a way to disable all the dialog boxes when an exception or error occurs(like access violations, indy socket errors, timeouts etc.)? They are thrown sometimes in my program, but these errors aren't fatal in any way and can be ignored, just the dialog boxes are disturbing. I use Delphi 7. 回答1: If you just don't wont to show the exception window then go to: Tools/Options/Debugger Options/Language Exceptions and disable CheckBox Notify on language exceptions . That is walid for Delphi

Difference between “array of double” and TDoubleDynArray

强颜欢笑 提交于 2020-01-13 11:13:42
问题 The System.Types unit declares an array type: TDoubleDynArray = array of Double; If I declare a method as: procedure func (x : TDoubleDynArray) I notice that the argument x acts like a var argument, ie I can change x inside the method and I'll see the changes reflected outside the method. However when I use procedure func (x : array of double) As expected, any changes in x stays in func . Although TDoubleDynArray appears to be declared as an array of double , it behaves differently from my

Which functions are predefined in JCL TEvaluator class

雨燕双飞 提交于 2020-01-13 11:00:11
问题 Does anyone know which predefined functions (e.g ABS function) are included in the TEvaluator JCL class for Delphi 7? 回答1: There are none of the standard functions from Math.pas included. All that is implemented in the default evaluation parser are the operators or , xor , and , not , mod , + , - , / , * , < , > , <= , >= , = , div , cmp , bor , bxor , band , bnot , shl , and shr . (As many as I found in a quick check of the source, and a few I missed based on @David's comment.) You can add

Eurekalog: save exception stacktrace into a log file

此生再无相见时 提交于 2020-01-13 10:17:27
问题 I'm using delphi 7. I need to log to a file the complete informations of any exception that occurs. Normally I use Eurekalog. This wonderful product shows a dialog with all the stack trace information and many many others for debugging purpouse. I need to access this informations Eureka log gives me (really I need just the stack trace) because I need to send them in a syslog deamon. Is there a way to access the information from the Eureka log programmatically ? I can use the bare delphi 7 or

What is the “real” memory size occupied by a dynamic array?

心已入冬 提交于 2020-01-13 10:07:57
问题 Example: procedure Test; var AText: array of AnsiChar; begin SetLength(AText, 7); end; Question What is the real size of AText occupied in memory? Is it 7 + Cardinal size of its length, that is, 7 + 4 = 11 bytes? 回答1: That plus 4 bytes reference count. And of course heapmanager overhead (which depends on delphi version and uses memory manager, which can easily be 12-16 bytes). So that means: sizeof(element)*elementcount sizeof(refcount) current implementations :sizeof(integer)=4 sizeof

What is the “real” memory size occupied by a dynamic array?

▼魔方 西西 提交于 2020-01-13 10:06:36
问题 Example: procedure Test; var AText: array of AnsiChar; begin SetLength(AText, 7); end; Question What is the real size of AText occupied in memory? Is it 7 + Cardinal size of its length, that is, 7 + 4 = 11 bytes? 回答1: That plus 4 bytes reference count. And of course heapmanager overhead (which depends on delphi version and uses memory manager, which can easily be 12-16 bytes). So that means: sizeof(element)*elementcount sizeof(refcount) current implementations :sizeof(integer)=4 sizeof

How do I save the contents of TWebBrowser, including user-entered form values?

坚强是说给别人听的谎言 提交于 2020-01-13 09:57:07
问题 is it possible to save entire document loaded in Webbrowser (in Delphi) as a ordinary HTML file with new values (I mean values entered by user in html's forms this document)? I need this for reading this HTML document with all values next time when application will be used. 回答1: Sure this is possible! Small demo App, make a new vcl forms application, drop a TWebBrowser , a TButton and a TMemo on your form and use this code (don't forget to bind OnCreate for the Form and OnClick for the Button