Search Results

Search found 4 results on 1 pages for 'user257188'.

Page 1/1 | 1 

  • Delphi 2010 Error Insight incorrectly flags "Undeclared Identifier"

    - by user257188
    In D2010, Error Insight is incorrectly underlining in red types like "TOpenDialog" (even though my unit and project's uses both include Dialogs). Also, in my method TMyFrame.Foo, it fails the same way by flagging a reference to a VCL component in my TMyFrame -- even though Foo and the component are both part of TMyFrame. SO suggested I read several threads on this subject. One mentions a D2009 fix for this. Is there a D2010 fix? Other postings have suggested that Error Insight yields too many false alarms and should just be turned off. Any suggestions?

    Read the article

  • Using EnterCriticalSection in Thread to update VCL label

    - by user257188
    I'm new to threads. I'm using a 3rd party library that uses threads which at times call a procedure I've provided. How do I update update a TLabel.Caption from my procedure when its called by the thread? If I've called InitializeCriticalSection elsewhere, is it as simple as EnterCriticalSection(CritSect); GlobalVariable := 'New TLabel.Caption'; LeaveCriticalSection(CritSect); And then in my main thread: EnterCriticalSection(CritSect); Label1.Caption:= 'New TLable.Caption'; LeaveCriticalSection(CritSect); But, how do I get the main thread code to be called? The thread can use SendMessage? Or is there some better/easier way (.OnIdle could check a flag set by the thread?) Thanks.

    Read the article

  • Ok to use VirtualProtect to change resource in Delphi?

    - by user257188
    I'm working on a simple localization effort in D2010. I'm handling all strings on forms because ETM seems like overkill for my needs, as did other 3rd party tools... (although I'm not so sure at this point!) Is the code below for changing the Const.pas strings considered safe to change the button labels on standard message boxes? procedure HookResourceString(rs: PResStringRec; newStr: PChar); var oldprotect: DWORD; begin VirtualProtect(rs, SizeOf(rs^), PAGE_EXECUTE_READWRITE, @oldProtect); rs^.Identifier := Integer(newStr); VirtualProtect(rs, SizeOf(rs^), oldProtect, @oldProtect); end; const NewOK: PChar = 'New Ok'; NewCancel: PChar = 'New Cancel'; Procedure TForm.FormCreate; begin HookResourceString(@SMsgDlgOK, NewOK); HookResourceString(@SMsgDlgCancel, NewCancel); end;

    Read the article

1