Search Results

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

Page 128/227 | < Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >

  • RichEdit's EM_AUTOURLDETECT message not always sent

    - by HX_unbanned
    To describe this issue, the best would that you would test my application with following usecase: Application: http://ubuntuone.com/p/nF/ Open application; Click on the ""captioned button; Click on same button again; Click on the same button again. As you can see - URL is correctly detected in first expanding, but in any further is not. Hope to have fix for this issue with your help :)

    Read the article

  • How do you change the subdocument location in a Word 2007 master document programmatically?

    - by boost
    We have had the unenviable happen: various master documents refer to sub-documents that are no longer where they used to be due to a directory renaming. Is there a programmatic way of tweaking the HYPERLINK field without losing the master/sub-document relationship? I've got this far ... Sub FixyaLinks() Dim s 'As String Dim i As Long Dim bTrackRevFlag As Boolean Dim bShowRevFlag As Boolean bTrackRevFlag = ActiveDocument.TrackRevisions bShowRevFlag = ActiveDocument.ShowRevisions ActiveDocument.TrackRevisions = False ActiveDocument.ShowRevisions = False For i = 1 To ActiveDocument.Fields.Count s = ActiveDocument.Fields.Item(i).Code.Text If InStr(s, "CURRICULUM\\NEW") Then s = Replace(s, "NEW Foundation Units-in developing", "Foundation Programme Units") ActiveDocument.Fields.Item(i).Code.Text = s End If Next ActiveDocument.TrackRevisions = bTrackRevFlag ActiveDocument.ShowRevisions = bShowRevFlag End Sub It bombs on ActiveDocument.Fields.Item(i).Code.Text = s, with an error 5686 ("The operation cannot be completed because the Track Changes option in the master document does not match the option the the subdocument. Make the Track Changes option the same in the master document and subdocument.") However, I'm not entirely sure what that means. Ideas anyone?

    Read the article

  • Is Valid IMAGE_DOS_SIGNATURE

    - by iira
    I want to check a file has a valid IMAGE_DOS_SIGNATURE (MZ) function isMZ(FileName : String) : boolean; var Signature: Word; fexe: TFileStream; begin result:=false; try fexe := TFileStream.Create(FileName, fmOpenRead or fmShareDenyNone); fexe.ReadBuffer(Signature, SizeOf(Signature)); if Signature = $5A4D { 'MZ' } then result:=true; finally fexe.free; end; end; I know I can use some code in Windows unit to check the IMAGE_DOS_SIGNATURE. The problem is I want the fastest way to check IMAGE_DOS_SIGNATURE (for a big file). I need your some suggestion about my code or maybe a new code? Thanks

    Read the article

  • How do you protect a common resource using mutexes?

    - by Steve
    I have a common resource, which I want 1 and only 1 instance of my application (or it's COM API) to have access to at any time. I have tried to protect this resource using mutexes, but when multiple threads of a host dotnet application try to access the COM object, the mutex doesn't seem to be released. This is the code I have used to protect my resource. repeat Mutex := CreateMutex(nil, True, PChar('Connections')); until (Mutex <> 0) and (GetLastError <> ERROR_ALREADY_EXISTS); try //use resource here! finally CloseHandle(Mutex); end; If I run the threads simultaneously, the first thread get's through (obviously, being the first one to create the mutex), but subsequent threads are caught in the repeat loop. If I run each thread at 5 second intervals, then all is ok. I suspect I'm not using mutexes correctly here, but I have found very little documentation about how to do this. Any ideas?

    Read the article

  • DataSetProvider - DataSet to ClientDataSet

    - by nomad311
    I am trying to take data from a TMSQuery which is connected to my DB and populate a ClientDataSet with some of that data using a DataSetProvider. My problem is that I will need to modify some of this data before it can go into my ClientDataSet. The ClientDataSet has persistent fields that will not match up with the raw DB data. I can't even get a string from the DB into a memo field in ClientDataSet. The ClientDataSet is a part of my data tier so I will need to conform the data from the DB to the ClientDataSet field by field (well most will be able to go right through, but many will require routing and/or conversion). Does anyone have experience with this?

    Read the article

  • How to insert records in master/detail relationship

    - by croceldon
    I have two tables: OutputPackages (master) |PackageID| OutputItems (detail) |ItemID|PackageID| OutputItems has an index called 'idxPackage' set on the PackageID column. ItemID is set to auto increment. Here's the code I'm using to insert masters/details into these tables: //fill packages table for i := 1 to 10 do begin Package := TfPackage(dlgSummary.fcPackageForms.Forms[i]); if Package.PackageLoaded then begin with tblOutputPackages do begin Insert; FieldByName('PackageID').AsInteger := Package.ourNum; FieldByName('Description').AsString := Package.Title; FieldByName('Total').AsCurrency := Package.Total; Post; end; //fill items table for ii := 1 to 10 do begin Item := TfPackagedItemEdit(Package.fc.Forms[ii]); if Item.Activated then begin with tblOutputItems do begin Append; FieldByName('PackageID').AsInteger := Package.ourNum; FieldByName('Description').AsString := Item.Description; FieldByName('Comment').AsString := Item.Comment; FieldByName('Price').AsCurrency := Item.Price; Post; //this causes the primary key exception end; end; end; end; This works fine as long as I don't mess with the MasterSource/MasterFields properties in the IDE. But once I set it, and run this code I get an error that says I've got a duplicate primary key 'ItemID'. I'm not sure what's going on - this is my first foray into master/detail, so something may be setup wrong. I'm using ComponentAce's Absolute Database for this project. How can I get this to insert properly? Update Ok, I removed the primary key restraint in my db, and I see that for some reason, the autoincrement feature of the OutputItems table isn't working like I expected. Here's how the OutputItems table looks after running the above code: ItemID|PackageID| 1 |1 | 1 |1 | 2 |2 | 2 |2 | I still don't see why all the ItemID values aren't unique.... Any ideas?

    Read the article

  • Virtual StringTree's hint windows are left out on the screen

    - by Edwin
    Hi, See this screenshot, in the middle it's the small hint windows that are generated by a TVirtualStringTree control and were left out on the screen, these hint windows will remain there until the application exits. the problem happens when the treeview's hint is shown and the mouse leaves quickly to the window next to it. Any idea about how to avoid this or how to clear those un-erased hint windows if it's difficult to avid this? Few days ago I asked a similar question, while the hint windows in the screenshots look the same, the are not the same problem. That problem, the hint text never shows and only that kind of uncompleted hint windows are shown; This problem, the hint text shows but the hint windows are not completely erased in a case (as I described above). Hope it's clear.

    Read the article

  • HOw to use local instance of TPrinter

    - by gorann
    Hi, I need to do some printing using TPrinter. The problem is I can not, for varoius reasons, use Global object Printer. I want to be able to create my instance of TPrinter and print using that one. I tried with: MyPrinter := TPrinter.Create; MyPrinter.BeginDoc; but this generates AV. Any idea what does it take to print something using my instance of TPrinter? Regards Goran Nagy

    Read the article

  • Disable a style in VCL application

    - by Martin
    I am adding the a VCL style into my application but am also giving the users an option to turn this off but I cannot figure out how to do this globally at runtime. Setting "TStyleManager.AutoDiscoverStyleResources := false" almost works but it pops up with an error message saying "Style {style set} not found" but after dismissing the message does exactly what I want. This code I would expect to work but does not... if (not ParamObj.UseDarkStyle) then begin //TStyleManager.AutoDiscoverStyleResources := false; TStyleManager.SetStyle(TStyleManager.SystemStyle); end; I also tried (originally) TStyleManager.TrySetStyle('Windows'); but this also does not work. I have tried this both sides of "Application.Initialize;" with no difference What am I missing? Thanks in advance, Martin

    Read the article

  • How to detect popup of a sub-menu of a popup menu (and how to populate it dynamically)?

    - by Heinrich Ulbricht
    Hi everyone, I have a popup menu which contains several menu items and one of them can have child items. This entry has a little arrow on the right and when you hover your mouse over it, a sub-menu will open. Now I want to populate this sub-menu at runtime, but only if the user actually opens it. If the user never opens the sub-menu, it will be empty (maybe contain a placeholder). How could I accomplish this? Is it even possible to modify a popup-menu when it is already visible? Thanks for your help!

    Read the article

  • How to use SendMessage to another form in same app

    - by Robert Frank
    I've been trying to get this to work for some time now and can't figure it out. Probably obvious once you know it. I simply want a non-modal form (or perhaps an instantiated non-TForm class) to send a message to the application's main form. I can make the main form send a message to itself and receive (announcing with a beep) But, I can't seem to have other objects send messages to the main form. I'm using WM_MY_MESSAGE = WM_APP + 200; What should the first argument of the SendMessage be to send a message to the main form? Even sending it to Application.MainForm.Handle doesn't seem to work. The reason I need to do this is that the modal form has a slider that another form (#2) needs to know when it changes. Notifying the other form via a callback procedure was making it sluggish as form #2 did some work before returning from the call. Is having a modal form send a windows message to the main form a reasonable way to avoid this?

    Read the article

  • Startup in Windows 7

    - by iira
    Hi, I am trying to add my program run in Windows 7 startup, but it does'nt works. My program has embedded uac manifest. My current way is by adding String Value at HKCU..\Run I found a manual solution for Vista from http://social.technet.microsoft.com/Forums/en/w7itprosecurity/thread/81c3c1f2-0169-493a-8f87-d300ea708ecf 1. Click Start, right click on Computer and choose “Manage”. 2. Click “Task Scheduler” on the left panel. 3. Click “Create Task” on the right panel. 4. Type a name for the task. 5. Check “Run with highest privileges”. 6. Click Actions tab. 7. Click “New…”. 8. Browse to the program in the “Program/script” box. Click OK. 9. On desktop, right click, choose New and click “Shortcut”. 10. In the box type: schtasks.exe /run /tn TaskName where TaskName is the name of task you put in on the basics tab and click next. 11. Type a name for the shortcut and click Finish. Additionally, you need to run the saved scheduled task shortcut to run the program instead of running the application shortcut to ignore the IAC prompt. When startup the system will run the program via the original shortcut. Therefore you need to change the location to run the saved task. Please: 1. Open Regedit. 2. Find the entry of the startup item in Registry. It will be stored in one of the following branches. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Run HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run 3. Double-click on the correct key, change the path to the saved scheduled task you created. Is there any free code to add item with privileges option in scheduled task? I havent found the free one in torry.net Thanks a lot.

    Read the article

  • How to know when my control changes size?

    - by Mason Wheeler
    I'm building a custom control, and I need it to be able to respond when it gets resized. I need the old dimensions and the new dimensions available in order to do some calculations. Unfortunately, the SetWidth and SetHeight methods are private to TControl, not protected, and so I can't override them. Is there any other way to know that my control's about to be resized, and to have the old size and the new size both available?

    Read the article

  • How expose the properties of an component created in an activex form

    - by Salvador
    You can publish the properties of an control that is inside a activex form? example I have a form with an TAdoconnection component, I wish the properties of this component can be modified by the user when he loads my activex control. UPDATE @TOndrej gives me a very nice sample, but this sample only works for components derived from an activex control, how can accomplish this same efffect with an VCL component like an Timage or TMemo? is possible publish all the properties without rewrite each property to expose manually?

    Read the article

  • Owner Vs PArent and Taction shortcuts on Frames

    - by Fred
    I have a form with a panel. I create frames at runtime and display them on the panel by setting frame's parent property to the panel. When creating panels I do not set the owner property because i manage myself the lifetime of the frame. Until now i got no problem. Next I put an TActionList on the frame with some shortcuts on the actions. I found that my actions did not execute until I set the owner property of the frame to the panel. Can someone can explain me that ? I thought that owner property was just about wich component is responsible to free the children components, and not responsible to forward key events.

    Read the article

  • Conseqences of assigning self

    - by Vegar
    Hi, Found a piece of code today, that I find a little smelly... TMyObject.LoadFromFile(const filename: String); begin if fileExists(filename) then self := TSomeObjectStreamer.ReadObjectFromFile(filename); end; If this code works, it will atleast leak some memory, but does it work? Is OK to assign to self in this manner? What if the streamed object is of a different subclass then the original self? What if the streamed object is of a different class with no common ancestore to the original self?

    Read the article

  • TStringGrid with BOTH editing AND range selection?

    - by Kevin Killion
    Question: Can anyone point to an article or code samples anywhere on how to provide BOTH editing AND range selection in a TStringGrid? Yes, I KNOW there are third-party grids that do this, but it's frustrating that the built-in grid lacks this basic capability. Background: It's pretty normal to expect to be able to both edit a cell in a grid, and also to select a range of cells such as for a Copy operation. As delivered, TStringGrid doesn't do that. It's either/or. In fact, the docs tell us about the grid Options, "When goEditing is included in Options, goRangeSelect has no effect". However, it looks like it may be possible to do editing and rangeselects in a TStringGrid anyway!!! Through careful use of the mousedown, mouseup, selectcell and exit events, you can get dang close by switching editing elements on and off at the right times. But I still don't have it perfect, and that only covers mouse use, not keyboard changes.

    Read the article

  • How to publish a list of integers?

    - by Mason Wheeler
    I want to make a component that includes a list of integers as one of its serialized properties. I know I can't declare a TList<integer> as a published property, because it doesn't descend from TPersistent. I've read that you can define "fake" published properties if you override DefineProperties, but I'm not quite sure how that works, especially when it comes to creating a fake property that's a list, not a single value. Can someone point me in the right direction?

    Read the article

< Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >