Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DHTMLEdit problem

Posted on 2002-07-20
1
Medium Priority
?
688 Views
Last Modified: 2008-03-17
//DHTMLEdit problem

//Problem is when I try to free DHTMLEdit !
//Problem is as You see DHTMLEdit1DisplayChanged procedure.
//Can You fix it ?

//Thanks.

procedure TMainForm1.DHTMLEdit1DisplayChanged(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[ICount]) is TDHTMLEdit) then
  exit;
if TDHTMLEdit(ComponentList[ICount]).DOM.selection.type_ = 'Text' then
try
  ToolButton39.Down := ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_BOLD) and DECMDF_LATCHED) = DECMDF_LATCHED);
  ToolButton40.Down := ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_ITALIC) and DECMDF_LATCHED) = DECMDF_LATCHED);
  ToolButton41.Down := ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_UNDERLINE) and DECMDF_LATCHED) = DECMDF_LATCHED);

  ToolButton5.Enabled := ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_UNDO) and DECMDF_ENABLED) = DECMDF_ENABLED);
  ToolButton15.Enabled := ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_REDO) and DECMDF_ENABLED) = DECMDF_ENABLED);

if ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_GETFONTNAME) and DECMDF_DISABLED) = DECMDF_DISABLED) then
begin
ovFontName := TDHTMLEdit(ComponentList[ICount]).ExecCommand(DECMD_GETFONTNAME, OLECMDEXECOPT_DODEFAULT, ovInVar);
ComboBox1.Text:=ovFontName;
end;


if ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_GETFONTSIZE) and DECMDF_DISABLED) = DECMDF_DISABLED) then
begin
ovFontSIZE := TDHTMLEdit(ComponentList[ICount]).ExecCommand(DECMD_GETFONTSIZE, OLECMDEXECOPT_DODEFAULT, ovInVar);
ComboBox3.Text:=ovFontSize;
end;


ovFontStyles := TDHTMLEdit(ComponentList[ICount]).ExecCommand(DECMD_GETBACKCOLOR, OLECMDEXECOPT_DODEFAULT, ovInVar);

//showmessage(ovFontStyles);//ColorDialog1.Color:=ovFontStyles;

ovFontStyles := TDHTMLEdit(ComponentList[ICount]).ExecCommand(DECMD_GETFORECOLOR, OLECMDEXECOPT_DODEFAULT, ovInVar);

//ColorDialog2.Color:=ovFontStyles;
if ((TDHTMLEdit(ComponentList[ICount]).QueryStatus(DECMD_GETBLOCKFMT) and DECMDF_DISABLED) = DECMDF_DISABLED) then
begin
ovFontStyle := TDHTMLEdit(ComponentList[ICount]).ExecCommand(DECMD_GETBLOCKFMT, OLECMDEXECOPT_DODEFAULT, ovInVar);
ComboBox2.Text:=ovFontStyle;
end;
except
end;
end;
sasadhtmleditmess:='';

end;
0
Comment
Question by:cvbn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
vbmn earned 1200 total points
ID: 7166441
did you try this one ?

I was able to solve this problem by changing the code in DHTMLEDLIB_TBL.PAS
getControlInterface
as follows:

function TDHTMLEdit.getControlInterface : iDHTMLEdit;
var
idsp : iDispatch;
begin
idsp := iDispatch(OleObject);
idsp.QueryInterface( IID_iDHTMLEdit, result );
end;

And you can try adding these lines to the bottom of your unit:

initialization
OleInitialize(nil);

finalization
OleUninitialize;

And if You use OnMessage:

application.onmessage:=nil;
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question