cvbn
asked on
DHTMLEdit problem
//DHTMLEdit problem
//Problem is when I try to free DHTMLEdit !
//Problem is as You see DHTMLEdit1DisplayChanged procedure.
//Can You fix it ?
//Thanks.
procedure TMainForm1.DHTMLEdit1Displ ayChanged( Sender: TObject);
var
ovFontName, ovFontStyle, ovFontStyles,ovFontSize, ovInVar: OleVariant;
FontNameStatus: DWORD;
FontSizeStatus: DWORD;
StyleNameStatus: DWORD;
vo: OleVariant;
pValue: OleVariant;
begin
sasadhtmleditmess:='Pass';
if sasaclosecommand<>'Close' then
begin
if not (TObject(Componentlist[ICo unt]) is TDHTMLEdit) then
exit;
if TDHTMLEdit(ComponentList[I Count]).DO M.selectio n.type_ = 'Text' then
try
ToolButton39.Down := ((TDHTMLEdit(ComponentList [ICount]). QueryStatu s(DECMD_BO LD) and DECMDF_LATCHED) = DECMDF_LATCHED);
ToolButton40.Down := ((TDHTMLEdit(ComponentList [ICount]). QueryStatu s(DECMD_IT ALIC) and DECMDF_LATCHED) = DECMDF_LATCHED);
ToolButton41.Down := ((TDHTMLEdit(ComponentList [ICount]). QueryStatu s(DECMD_UN DERLINE) and DECMDF_LATCHED) = DECMDF_LATCHED);
ToolButton5.Enabled := ((TDHTMLEdit(ComponentList [ICount]). QueryStatu s(DECMD_UN DO) and DECMDF_ENABLED) = DECMDF_ENABLED);
ToolButton15.Enabled := ((TDHTMLEdit(ComponentList [ICount]). QueryStatu s(DECMD_RE DO) and DECMDF_ENABLED) = DECMDF_ENABLED);
if ((TDHTMLEdit(ComponentList [ICount]). QueryStatu s(DECMD_GE TFONTNAME) and DECMDF_DISABLED) = DECMDF_DISABLED) then
begin
ovFontName := TDHTMLEdit(ComponentList[I Count]).Ex ecCommand( DECMD_GETF ONTNAME, OLECMDEXECOPT_DODEFAULT, ovInVar);
ComboBox1.Text:=ovFontName ;
end;
if ((TDHTMLEdit(ComponentList [ICount]). QueryStatu s(DECMD_GE TFONTSIZE) and DECMDF_DISABLED) = DECMDF_DISABLED) then
begin
ovFontSIZE := TDHTMLEdit(ComponentList[I Count]).Ex ecCommand( DECMD_GETF ONTSIZE, OLECMDEXECOPT_DODEFAULT, ovInVar);
ComboBox3.Text:=ovFontSize ;
end;
ovFontStyles := TDHTMLEdit(ComponentList[I Count]).Ex ecCommand( DECMD_GETB ACKCOLOR, OLECMDEXECOPT_DODEFAULT, ovInVar);
//showmessage(ovFontStyles );//ColorD ialog1.Col or:=ovFont Styles;
ovFontStyles := TDHTMLEdit(ComponentList[I Count]).Ex ecCommand( DECMD_GETF ORECOLOR, OLECMDEXECOPT_DODEFAULT, ovInVar);
//ColorDialog2.Color:=ovFo ntStyles;
if ((TDHTMLEdit(ComponentList [ICount]). QueryStatu s(DECMD_GE TBLOCKFMT) and DECMDF_DISABLED) = DECMDF_DISABLED) then
begin
ovFontStyle := TDHTMLEdit(ComponentList[I Count]).Ex ecCommand( DECMD_GETB LOCKFMT, OLECMDEXECOPT_DODEFAULT, ovInVar);
ComboBox2.Text:=ovFontStyl e;
end;
except
end;
end;
sasadhtmleditmess:='';
end;
//Problem is when I try to free DHTMLEdit !
//Problem is as You see DHTMLEdit1DisplayChanged procedure.
//Can You fix it ?
//Thanks.
procedure TMainForm1.DHTMLEdit1Displ
var
ovFontName, ovFontStyle, ovFontStyles,ovFontSize, ovInVar: OleVariant;
FontNameStatus: DWORD;
FontSizeStatus: DWORD;
StyleNameStatus: DWORD;
vo: OleVariant;
pValue: OleVariant;
begin
sasadhtmleditmess:='Pass';
if sasaclosecommand<>'Close' then
begin
if not (TObject(Componentlist[ICo
exit;
if TDHTMLEdit(ComponentList[I
try
ToolButton39.Down := ((TDHTMLEdit(ComponentList
ToolButton40.Down := ((TDHTMLEdit(ComponentList
ToolButton41.Down := ((TDHTMLEdit(ComponentList
ToolButton5.Enabled := ((TDHTMLEdit(ComponentList
ToolButton15.Enabled := ((TDHTMLEdit(ComponentList
if ((TDHTMLEdit(ComponentList
begin
ovFontName := TDHTMLEdit(ComponentList[I
ComboBox1.Text:=ovFontName
end;
if ((TDHTMLEdit(ComponentList
begin
ovFontSIZE := TDHTMLEdit(ComponentList[I
ComboBox3.Text:=ovFontSize
end;
ovFontStyles := TDHTMLEdit(ComponentList[I
//showmessage(ovFontStyles
ovFontStyles := TDHTMLEdit(ComponentList[I
//ColorDialog2.Color:=ovFo
if ((TDHTMLEdit(ComponentList
begin
ovFontStyle := TDHTMLEdit(ComponentList[I
ComboBox2.Text:=ovFontStyl
end;
except
end;
end;
sasadhtmleditmess:='';
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.