DHTMLEdit - Registered Users - Helpdesk
What is TProfDHTMLEditChangeSink?
Thread Starter: Khurram Started: 7/30/2008 12:59 PM UTC
Replies: 10
What is TProfDHTMLEditChangeSink?
Hello,

The OnChange event is triggered by the following code in the control.

function TProfDHTMLEditChangeSink.Notify: HRESULT;
begin
 Result := S_OK;
 if Assigned(FOwner.FOnChange) then
   if not FCalling then
   begin
     FCalling := True;
     try
       FOwner.FOnChange(FOwner)
     except
     end;
     FCalling := False
   end
end;


Is there anyway to avoid the OnChange event from being fired here?

Thanks
Khurram
Re: What is TProfDHTMLEditChangeSink?
Don't assign anything to OnChange? Comment the code out?

Re: What is TProfDHTMLEditChangeSink?
Would it be OK to comment it out? I am thinking it may make the component behave unpredictably..
 
 
"Bart Roozendaal" <bart.roozendaal@sevensteps.nl> wrote in message news:3fc505cd$1dd27765$47ec@vlad...
Don't assign anything to OnChange? Comment the code out?

Re: What is TProfDHTMLEditChangeSink?
From the code you pasted here, I'd guess that's fine. If you want to be sure, just comment out the OnChange call itself.

Re: What is TProfDHTMLEditChangeSink?
I need the OnChange call in my code.. For the code from the component source, I wanna know what 'ChangeSink' means..
"Bart Roozendaal" <bart.roozendaal@sevensteps.nl> wrote in message news:58b3b7f8$7dd8c019$47e0@vlad...
From the code you pasted here, I'd guess that's fine. If you want to be sure, just comment out the OnChange call itself.

Re: What is TProfDHTMLEditChangeSink?
I'm sorry, I don't get what you want. In the first message you asked how to avoid calling the OnChange event handler and now you tell us you do want it. So, can you please elaborate on what you want to archieve?        

Re: What is TProfDHTMLEditChangeSink?
Hello Bart,
 
I have written code for the OnChange event handler of the ProfDHTMLEdit object in my application. When the application starts up, the object keeps calling the "TProfDHTMLEditChangeSink.Notify" which in turn calls the OnChange event. This has unexpected results, as the OnChange event is called when nothing has actually changed in that component..
 
I tried using 'if (busy = true) then exit' but that doesn't work either.
 
Thanks
Khurram
 
Re: What is TProfDHTMLEditChangeSink?
The OnChange event should only be called when the contents of your document changes. It would help to post a demo program demonstrating the effect (I guess that's what Nicholas would require anyway).  

Re: What is TProfDHTMLEditChangeSink?
As I said, I am not changing the contents of the document. This happens when the application starts up..
 
 
Re: What is TProfDHTMLEditChangeSink?

So, that's a one time call and not a recurring event? IMHO that shouldn't be a problem, is it? I'm sorry for not understanding your issue, but it is really not clear what exactly the issue is. Maybe if you describe what it is you are doing on the OnChange event it becomes clear to me what the problem is. Typically, you would do something as an automatic save or a parsing of the contents and if this happens at the start of the application you probably haven't set the content yet, so there shouldn't be a problem.

Again, sorry for my questions, but I'm a bit lost.

Bye,

Bart

Re: What is TProfDHTMLEditChangeSink?
Hello Khurram:

For the code from the component source, I wanna know what 'ChangeSink' means..

http://msdn.microsoft.com/en-us/library/aa704257(VS.85).aspx


-Nicholas