Search Results

Search found 5657 results on 227 pages for 'delphi 2007'.

Page 125/227 | < Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >

  • How to get virtual com-port number if DBT_DEVNODES_CHANGED event accrues?

    - by Nick Toverovsky
    Hi! Previously I defined com-port number using DBT_DEVICEARRIVAL: procedure TMainForm.WMDEVICECHANGE(var Msg: TWMDeviceChange); var lpdb : PDevBroadcastHdr; lpdbpr: PDevBroadCastPort; S: AnsiString; begin {????????? ?????????} lpdb := PDevBroadcastHdr(Msg.dwData); case Msg.Event of DBT_DEVICEARRIVAL: begin {??????????} if lpdb^.dbch_devicetype = DBT_DEVTYP_PORT {DBT_DEVTYP_DEVICEINTERFACE} then begin lpdbpr:= PDevBroadCastPort(Msg.dwData); S := StrPas(PWideChar(@lpdbpr.dbcp_name)); GetSystemController.Init(S); end; end; DBT_DEVICEREMOVECOMPLETE: begin {????????} if lpdb^.dbch_devicetype = DBT_DEVTYP_PORT then begin lpdbpr:= PDevBroadCastPort(Msg.dwData); S := StrPas(PWideChar(@lpdbpr.dbcp_name)); GetSystemController.ProcessDisconnect(S); end; end; end; end; Unfortunately, the hardware part of a device with which I was working changed and now Msg.Event has value BT_DEVNODES_CHANGED. I've read msdn. It is said that I should use RegisterDeviceNotification to get any additional information. But, if I got it right, it can't be used for serial ports. The DBT_DEVICEARRIVAL and DBT_DEVICEREMOVECOMPLETE events are automatically broadcast to all top-level windows for port devices. Therefore, it is not necessary to call RegisterDeviceNotification for ports, and the function fails if the dbch_devicetype member is DBT_DEVTYP_PORT. So, I am confused. How can I define the com-port of a device, if a get DBT_DEVNODES_CHANGED in WMDEVICECHANGE event?

    Read the article

  • Indy IdSMTP and attachments in Thunderbird

    - by Lobuno
    Hello! Using the latest snapshot of Indy tiburon on D2010. A very simple project like: var stream: TFileStream; (s is TidSMTP and m is TidMessage) begin s.Connect; Stream := TFileStream.Create('c:\Test.zip', fmOpenRead or fmShareExclusive); try with TIdAttachmentMemory.Create(m.MessageParts, Stream) do begin ContentType := 'application/x-zip-compressed'; Name := ExtractFilePath('C:\'); //' FileName := 'Test.zip'; end; finally FreeAndNil(Stream); end; s.Send(m); s.Disconnect(); end; Everything works Ok in Outlook, The bat!, OE, yahoo, etc... but in Thunderbird the attachment is not shown. Looking at the source of the message in Thunderbird, the attachment is there. The only difference I can find between messages send by indy and other clients is that Indy messages have this order: Content-Type: multipart/mixed; boundary="Z\=_7oeC98yIhktvxiwiDTVyhv9R9gwkwT1" MIME-Version: 1.0 while any other clients have the order: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Z\=_7oeC98yIhktvxiwiDTVyhv9R9gwkwT1" Don't know if THAT is the source of the problem, but if so: is this a bug on Thunderbird or is this a problem with indy which "malforms" the headers of the messages? Is this order a problem? Does that matter anyway?

    Read the article

  • TVirtualStringTree - resetting non-visual nodes and memory consumption

    - by Remy Lebeau - TeamB
    I have an app that loads records from a binary log file and displays them in a virtual TListView. There are potentially millions of records in a file, and the display can be filtered by the user, so I do not load all of the records in memory at one time, and the ListView item indexes are not a 1-to-1 relation with the file record offsets (List item 1 may be file record 100, for instance). I use the ListView's OnDataHint event to load records for just the items the ListView is actually interested in. As the user scrolls around, the range specified by OnDataHint changes, allowing me to free records that are not in the new range, and allocate new records as needed. This works fine, speed is tolerable, and the memory footprint is very low. I am currently evaluating TVirtualStringTree as a replacement for the TListView, mainly because I want to add the ability to expand/collapse records that span multiple lines (I can fudge it with the TListView by incrementing/decrementing the item count dynamically, but this is not as straight forward as using a real tree). For the most part, I have been able to port the TListView logic and have everything work as I need. I notice that TVirtualStringTree's virtual paradigm is vastly different, though. It does not have the same kind of OnDataHint functionality that TListView does (I can use the OnScroll event to fake it, which allows my memory buffer logic to continue working), and I can use the OnInitializeNode event to associate nodes with records that are allocated. However, once a tree node is initialized, it sees that it remains initialized for the lifetime of the tree. That is not good for me. As the user scrolls around and I remove records from memory, I need to reset those non-visual nodes without removing them from the tree completely, or losing their expand/collapse states. When the user scrolls them back into view, I can re-allocate the records and re-initialize the nodes. Basically, I want to make TVirtualStringTree act as much like TListView as possible, as far as its virtualization is concerned. I have seen that TVirtualStringTree has a ResetNode() method, but I encounter various errors whenever I try to use it. I must be using it wrong. I also thought of just storing a data pointer inside each node to my record buffers, and I allocate and free memory, update those pointers accordingly. The end effect does not work so well, either. Worse, my largest test log file has ~5 million records in it. If I initialize the TVirtualStringTree with that many nodes at one time (when the log display is unfiltered), the tree's internal overhead for its nodes takes up a whopping 260MB of memory (without any records being allocated yet). Whereas with the TListView, loading the same log file and all the memory logic behind it, I can get away with using just a few MBs. Any ideas?

    Read the article

  • Sending binary data with Indy through TCP\IP, how?

    - by Wodzu
    Hello. How to send a binary data with Indy components? Which of them is most suitable for this task? I've tried to use TIdTcpClient but it allows only to send strings. I've found one reponce for that problem here but I don't get it. It says about method Write(TIdBytes), but the answer is not clear for me. Does he meant Write to some instance of TIdBytes, and how to connect that instance with TIdTcpClient? Thanks for any help.

    Read the article

  • Indy FTP, large files and NAT routers

    - by Lobuno
    Hello! I have been using Indy to transfers files via FTP for years now but have not been able to find a satisfactory solution for the following problem. When a user is uploading a large file, behind a router, sometimes the following happens: the file is uploaded OK, but under the mean time the command channel gets disconnected because of a timeout. Normally this doesn't happens with a direct connection to the server, because the server "knows" that a transfer is being taking place on the data channel. Some routers are not aware of this, though and the command channel is closed. Many programs send a NOOP command periodically to keep the command channel alive even if this is not part of the standard FTP specification. My question: how do I do that? Do I send the NOOP command in the OnWork event? Does this cause any collateral damage in some way, like, do I need to process some response? How do I best solve this problem?

    Read the article

  • Problem with Keyboard hook proc

    - by Steve
    The background: My form has a TWebBrowser. I want to close the form with ESC but the TWebBrowser eats the keystrokes - so I decided to go with a keyboard hook. The problem is that the Form can be open in multiple instances at the same time. No matter what I do, in some situations, if there are two instances open of my form, closing one of them closes the other as well. I've attached some sample code. Any ideas on what causes the issue? var EmailDetailsForm: TEmailDetailsForm; KeyboardHook: HHook; implementation function KeyboardHookProc(Code: Integer; wParam, lParam: LongInt): LongInt; stdcall; var hWnd: THandle; I: Integer; F: TForm; begin if Code < 0 then Result := CallNextHookEx(KeyboardHook, Code, wParam, lParam) else begin case wParam of VK_ESCAPE: if (lParam and $80000000) <> $00000000 then begin hWnd := GetForegroundWindow; for I := 0 to Screen.FormCount - 1 do begin F := Screen.Forms[I]; if F.Handle = hWnd then if F is TEmailDetailsForm then begin PostMessage(hWnd, WM_CLOSE, 0, 0); Result := HC_SKIP; break; end; end; //for end; //if else Result := CallNextHookEx(KeyboardHook, Code, wParam, lParam); end; //case end; //if end; function TEmailDetailsForm.CheckInstance: Boolean; var I, J: Integer; F: TForm; begin Result := false; J := 0; for I := 0 to Screen.FormCount - 1 do begin F := Screen.Forms[I]; if F is TEmailDetailsForm then begin J := J + 1; if J = 2 then begin Result := true; break; end; end; end; end; procedure TEmailDetailsForm.FormCreate(Sender: TObject); begin if not CheckInstance then KeyboardHook := SetWindowsHookEx(WH_KEYBOARD, @KeyboardHookProc, 0, GetCurrentThreadId()); end; procedure TEmailDetailsForm.FormDestroy(Sender: TObject); begin if not CheckInstance then UnHookWindowsHookEx(KeyboardHook); end;

    Read the article

  • Detect click on URL in RichEdit

    - by Tofig Hasanov
    I am trying to update RichEdit so that it detects URL and enables clicking on it to open in the browser. Detecting URL is easy, I just use the following code from http://www.scalabium.com/faq/dct0146.htm mask := SendMessage(MNote.Handle, EM_GETEVENTMASK, 0, 0); SendMessage(MNote.Handle, EM_SETEVENTMASK, 0, mask or ENM_LINK); SendMessage(MNote.Handle, EM_AUTOURLDETECT, Integer(True), 0); but the second part doesn't work for me. They give the following code to capture EN_LINK message and processing it: type TForm1 = class(TForm) protected procedure WndProc(var Message: TMessage); override; end; ... procedure TForm1.WndProc(var Message: TMessage); var p: TENLink; strURL: string; begin if (Message.Msg = WM_NOTIFY) then begin if (PNMHDR(Message.LParam).code = EN_LINK) then begin p := TENLink(Pointer(TWMNotify(Message).NMHdr)^); if (p.msg = WM_LBUTTONDOWN) then begin SendMessage(RichEdit1.Handle, EM_EXSETSEL, 0, LongInt(@(p.chrg))); strURL := RichEdit1.SelText; ShellExecute(Handle, 'open', PChar(strURL), 0, 0, SW_SHOWNORMAL); end end end; inherited; end; When I run the program, URL is detected, but clicking on it doesn't do anything. Using debug I found out that Message.Msg = WM_NOTIFY is not true when I click on URL. I then tried to override TRichEdit's WndProc, but result is the same. Any suggestions?

    Read the article

  • Will it be possible to use any asp.net and silverlight controls in Intraweb XII?

    - by user193655
    I am researching a lot on intraweb, I read that in Intraweb XII (when will this be released?) it will be possible to have: 1) "silverlight enabled controls" (mentioned here, this is the old IW XI roadmap anyway silverlight task has been moved to XII now) 2) "IntraWeb XII [...] will contain the integration with CrossTalk and ASP.NET" (mentioned here, check for Intraweb XII paragraph). Now I don't understand what this mean in detail. I think IW is very cool, but it lacks a good choice of components, there is only one vendor (TMS) that makes good components, but of course one can wonder "why to be limited to one vendor when I can use more components from more vendors"? So does anyone (ideally from IW team, or that really knows the inner workings of IW XII, I mean the details of the roadmap, since XII is not being developed yet) know what the bold sentences above mean? Will this mean I can use inside IW 3rd party components from any ASP.NET and Silverlight vendor like Telerik, DevExpress, ComponentOne, and many, many, more?

    Read the article

  • Temporary table resource limit

    - by Jk
    Hi, i have two applications (server and client), that uses TQuery connected with TClientDataSet through TDCOMConnection, and in some cases clientdataset opens about 300000 records and than application throws exception "Temporary table resource limit". Is there any workaround how to fix this? (except "do not open such huge dataset"?) update: oops i'm sorry there is 300K records, not 3 millions..

    Read the article

  • There is another way to load MSHTML documents without use Application.ProcessMessages?

    - by douglaslise
    There is another way to load MSHTML documents without use Application.ProcessMessages? To load a document into a IHTMLDocument I need to do this: while Doc.readyState <> 'complete' do Application.ProcessMessages; I want not to process all the message queue during the loading, because I would be changing my application flow, in other words, some messages that should be processed after the loading to be completed can be processed earlier, even before the loading end. There is a special message code that the IHTMLDocument expect to advance in the loading process? Or there is another way to load? Thanks.

    Read the article

  • FastMM log to file without FullDebugMode

    - by dmauric.mp
    I'd like to get FastMM memory leak report that shows up on app shutdown, but in a file instead of the dialog box. The idea is to use it in a release build as I have trouble reproducing the leaks. I would however prefer to not use the FullDebugMode which seems to be required for logging to a file. Am I missing anything or is this not supported ?

    Read the article

  • TVirtualStringTree - resetting non-visual nodes and memory comsumption

    - by Remy Lebeau - TeamB
    I have an app that loads records from a binary log file and displays them in a virtual TListView. There are potentially millions of records in a file, and the display can be filtered by the user, so I do not load all of the records in memory at one time, and the ListView item indexes are not a 1-to-1 relation with the file record offsets (List item 1 may be file record 100, for instance). I use the ListView's OnDataHint event to load records for just the items the ListView is actually interested in. As the user scrolls around, the range specified by OnDataHint changes, allowing me to free records that are not in the new range, and allocate new records as needed. This works fine, speed is tolerable, and the memory footprint is very low. I am currently evaluating TVirtualStringTree as a replacement for the TListView, mainly because I want to add the ability to expand/collapse records that span multiple lines (I can fudge it with the TListView by incrementing/decrementing the item count dynamically, but this is not as straight forward as using a real tree). For the most part, I have been able to port the TListView logic and have everything work as I need. I notice that TVirtualStringTree's virtual paridigm is vastly different, though. It does not have the same kind of OnDataHint functionality that TListView does (I can use the OnScroll event to fake it, which allows my memory buffer logic to continue working), and I can use the OnInitializeNode event to associate nodes with records that are allocated. However, once a tree node is initialized, it sees that it remains initialized for the lifetime of the tree. That is not good for me. As the user scrolls around and I remove records from memory, I need to reset those non-visual nodes without removing them from the tree completely, or losing their expand/collapse states. When the user scrolls them back into view, I can re-allocate the records and re-initialize the nodes. Basically, I want to make TVirtualStringTree act as much like TListView as possible, as far as its virtualization is concerned. I have seen that TVirtualStringTree has a ResetNode() method, but I encounter various errors whenever I try to use it. I must be using it wrong. I also thought of just storing a data pointer inside each node to my record buffers, and I allocate and free memory, update those pointers accordingly. The end effect does not work so well, either. Worse, my largest test log file has ~5 million records in it. If I initialize the TVirtualStringTree with that many nodes at one time (when the log display is unfiltered), the tree's internal overhead for its nodes takes up a whopping 260MB of memory (without any records being allocated yet). Whereas with the TListView, loading the same log file and all the memory logic behind it, I can get away with using just a few MBs. Any ideas?

    Read the article

  • Implement F3 Find Next using TFindDialog

    - by Pieter van Wyk
    Hi I've implemented a search using the TFindDialog on my form. Everything works well except that I cannot find a way to mimic the "F3 - Find Next" behaviour as in Notepad. Once you have entered a search string, pressing F3 finds the next instance without opening the search dialog. Regards, Pieter.

    Read the article

  • Download, pause and resume an download using Indy components

    - by Salvador
    Actually i'm using the TIdHTTP component for download a file from internet. i'm wondering if is possible pause and resume the download using this component o maybe another indy component. this is my current code, this works ok for download a file (without resume), but . now i want pause the download close my app ,and when my app restart then resume the download from the last position saved. var Http: TIdHTTP; MS : TMemoryStream; begin Result:= True; Http := TIdHTTP.Create(nil); MS := TMemoryStream.Create; try try Http.OnWork:= HttpWork;//this event give me the actual progress of the download process Http.Head(Url); FSize := Http.Response.ContentLength; AddLog('Downloading File '+GetURLFilename(Url)+' - '+FormatFloat('#,',FSize)+' Bytes'); Http.Get(Url, MS); MS.SaveToFile(LocalFile); except on E : Exception do Begin Result:=False; AddLog(E.Message); end; end; finally Http.Free; MS.Free; end; end;

    Read the article

  • Locking down RAD Studio internal browser security.

    - by HMcG
    I use Firefox as my web browser, mostly for access to add-ins such as Flashblock and No-script. I noticed yesterday that the RAD Studio internal browser used for the Welcome Page etc has scripting and Active X etc enabled. Is there a way to disable scripting, or better still, block all access to non-local sources in the built-in browser?

    Read the article

  • How to make TWebBrower ignore accelerator chars of others controls?

    - by douglaslise
    I have a TWebBrowser placed on a form with the designMode enabled. Bellow the browser I have a close button with the Caption setted to 'Clos&e'. When I am editing the contents of a document inside the WebBrowser and I press the key E the button close is called. It appears that it is treating TWebBrowser like other controls that don't handle keys (e.g. TButton). How can I solve this? Thanks in advance.

    Read the article

< Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >