Click here to Skip to main content
Email Password   helpLost your password?

 FormulaDlg Image Settings Image

We needed a mathematical formula editor that was able to export the content of the formulas into a programming language (FORTRAN 77 in our case). Therefore we developed a set of classes described below.

Parts of the code are based on the work of

Thanks to you for your excellent work.

General appearance

The following files and classes are included into the source code :

Core Data Structure

bintree.cpp, bintree.h CBinTree The binary-tree datastructure.
node.cpp, node.h CNode The core node datastructure.
nodeentities.cpp, nodeentities.h see table 1) The special node entities.
bintreeformat.cpp, bintreeformat.h CBinTreeFormat, CFormatInfoOb Formatting information
undo.h CUndo Undo/Redo functions
 

Editing and Visualizing

formuladlg.cpp, formuladlg.h, formuladlg_toolbar.cpp CFormulaDlg A Dialog that holds a CFormulaCtrl and toolbar-buttons supporting formula-editing. The dialog provides Callback-functions which handle the CToolBarBtn notifications
formulactrl.cpp, formulactrl.h CFormulaCtrl Custom control that handles keyboard- and mouse-input.
formulainplaceedit.cpp, formulainplaceedit.h CFormulaInPlaceEdit Inplace Edit-Control. Behaves like inplace-edit control in CGridCtrl
formuladroptarget.cpp, formuladroptarget.h CFormulaDropTarget The drop target for the formula-control
matrixdlg.cpp, matrixdlg.h CMatrixDlg A Subdialog for parametrizing matrix dimensions.
formulasettingsdialog.cpp, formulasettingsdialog.h CFormulaSettingsDlg Sub dialog supporting the customizing of the formula settings (eg. colours, fonts ...)

Helper classes

fontcombobox.cpp, fontcombobox.h CFontCombo A CComboBox derived control supporting fontselection.
colourpicker.cpp, colourpicker.h CColourPicker A CButton derived control supporting colour-selection.
colourpopup.cpp, colourpopup.h CColourPopup A CWnd derived control supporting colour-selection (used by CColourPicker).
toolbarbtn.cpp, toolbarbtn.h CToolBarBtn A CButton derived control supporting the bitmap-based node-entity selections.
toolbarbtnctrl.cpp, toolbarbtnctrl.h, toolbardlg.cpp, toolbardlg.h CToolBarBtnCtrl, CToolBarDlg used by CToolBarBtn

The basic approach of the formula-editor is the representation of mathematical content in a binary-tree data-structure. the extraction of the content is performed by an inorder-traversal through the binary tree.

Algorithm Binary tree Output
inorder traversal through a binary tree
inorder (node)
{
inorder (left_child);
process (this);
inorder (right_child);
}
Node Classes Node Classes

The base class CNode was originally designed as an abstract base class, but it currently provides the standard behaviour of a node. (draw my left child on the left, draw my right child on the right and draw my own content into the middle). If you want to integrate a new node you have to do the following steps:

  1. Define a new node-type (insert a new unique NT_* define into the node.h)
  2. Declare a new node-entity in the nodeentities.h (derive it public from CNode)
    class CMyNode : public CNode
  3. Implement the methods
    virtual void Serialize(CArchive& ar, CBinTree* pTree);
    virtual void TransformRects(CRect& ,CRect& ,CRect& ,CRect& );
    virtual CRect GetContentRect(CDC* pDC);
    virtual void DrawContent(CDC* pDC, CRect rect, DWORD dwSelect);
  4. Insert a new button into a already present ToolbarBtn or build a new ToolbarBtn with your own node
  5. Handle the ToolBarCtrlSelected Event for your node (in the FormulaDlg_ToolBar.cpp file)

Please have a look on the implementation of the already integrated nodes for further details. Here is a list of them and ther interdependencies:

Node class Type Left Child Right Child
CNode NT_STANDARD
CNablaNode NT_NABLA NULL CIndexNode
CIndexNode NT_INDEX Superscript Subscript
CPartialDerivativeNode NT_PARTDERIVE Derivation variable Content of the derivation
CDerivativeNode NT_DERIVE Derivation variable Content of the derivation
CPlaceHolderNode NT_PLACEHOLDER NULL CIndexNode
CNthRootNode NT_NTHROOT, NT_ROOT Content of the root Basis
CPowerToNode NT_POWERTO Basis Exponent
CSumNode NT_SUM CRangeNode

Content of the Sum

CProdNode NT_PROD CRangeNode Content of the Product
CRangeNode NT_RANGE Upper Range Lower Range
CIntegrandNode NT_INTEGRAND Content of the integral Integration variable
CLimesNode NT_LIMES COperatorNode Content of the limes
CBinomialNode NT_BINOMIAL Upper Lower
CMatrixNode NT_MATRIX CLineNode NULL
CLineNode NT_LINE CLineNode CElementNode
CElementNode NT_ELEMENT Content of the Matrixelement CElementNode
CValueNode
CVariableNode NT_VARIABLE NULL CIndexNode
CConstantNode NT_CONSTANT NULL CIndexNode
CInfinityNode NT_INFINITY NULL CIndexNode
CPlanckNode NT_PLANCK NULL CIndexNode
CLambdaNode NT_LAMBDA NULL CIndexNode
CNumberNode NT_NUMBER NULL CIndexNode
CTypedNode
CFunctionNode
CUserFuncNode NT_USERFUNCTION CBraceNode NULL
CFuncNode NT_FUNC CBraceNode NULL
CExtFuncNode NT_EXTFUNC CBraceNode NULL
COpNode
CDivisionNode NT_DIVISION Left hand side Right hand side
CEquationNode NT_EQUATION Left hand side Right hand side
COperatorNode NT_OPERATOR Left hand side Right hand side
CBraceNode NT_BRACE Content of the brace NULL
CPoisonNode NT_POISON * *
CVectorNode NT_VECTOR Content of the Vector NULL
CIntegralNode NT_INTEGRAL CRangeNode CIntegrandNode
COverlineNode NT_OVERLINE * *
CArrowNode NT_ARROWS Left hand side Right hand side
CPlusNode NT_PLUS Left hand side Right hand side
CMinusNode NT_MINUS Left hand side Right hand side
CTimesNode NT_TIMES Left hand side Right hand side
CCrossNode NT_CROSS Left hand side Right hand side
table 1) List of already integrated nodes and their dependecies

Please see the implemented TransformRect and DrawContent methods as an example! There are a lot of ways to code them much better. Any suggestions and refinements are welcome.

If you want to use this code in your project you only have to import the classes and to call the DoModal-method of the FormulaDlg.Please be careful with the resources. The resources for the toolbar of the formula-dialog are included via compiletime-directives (resource includes-submenu in the view -menu of the developer-studio)

#include "mathsym.h"

#include "mathsym.rc"
#include "FormulaDlg.h"


void CMainFrame::OnFormula() 
{
    CFormulaDlg FormulaDlg;
    FormulaDlg.DoModal();
}

The core-classes with there attributes and methods look as follow:

CBinTree

CNode* m_pRootNode The rootnode of the tree.
CNode* m_pSelectNode The selected node.
DWORD m_dwSelectType The node-selection type (one of NS_*, see node.h).
CString m_strName The name of the tree.
CNode* CreateTree(CString strType) Creates a tree with a root node of type strType.
CNode* GetRootNode() Returns the root node.
void SetRootNode(CNode* pNode) Sets the root node.
void SetName(CString) Sets the Name of the Bintree.
CString GetName() Returns the name of the Bintree.
void SelectNode(CNode* pNode, DWORD dwSelectType) Selects the node pNode with nodeselectiontype dwSelectType.
CNode* GetSelectedNode() Returns the selected node.
void SetNodeSelectionType(DWORD dwSelectType) Sets the nodeselectiontype for the tree.
void GetNodeSelectionType(DWORD dwSelectType) Returns the nodeselectiontype for the tree.
void ResetTree() Resets the tree and delete all nodes.
CNode* GetParent(CNode* pNode) Returns the parent of node pNode.
CNode* CreateNode(CString strType) Creates a node of type strType.
CNode* ReplaceNode(CNode*, CString)
void ReplaceNode(CNode*, CNode*)
CNode* ReplaceSubTree(CNode*, CString)
CNode* InsertNode(CNode*, CNode*, CString, DWORD )
Some handy functions for rearrangement of the tree.
void DrawTree(CDC* pDC, CRect rect) Draws the tree on a dc.
CRect GetRect(CDC* pDC) Returns the destination-rect of the tree.
CNode* GetNodeFromPoint(CDC*, CRect&, CPoint) Returns a node that draws itself into a rect (resultRect) that contains point.
void ReformatNodes(CBinTreeFormat* pFormat=NULL) Reformat the tree with a special formatter.
void SortPreOrder(CNode* pOldNode)
CNode* SwapLeftChildNode(CNode*, CNode*)
CNode* SwapRightChildNode(CNode*, CNode*)
Sorting the tree in associative order (currently not used).
BOOL WriteDIB(CString strFile) Writes the binary-tree content into a dib.
BOOL PrintDDB(CDC* pDC) Prints the binary-tree content into a DC.
CString CBinTree::WriteFormula(int nLanguageType) Write the binary-tree content into a CString.
virtual void DeleteContents() Resets the tree and delete all nodes (from CUndo).
void DeleteNode(CNode* pNode) Deletes a node.
CNode* CloneNode(CNode* pNode, BOOLbCloneSubTree) Clones a node with or without its subtree.
 

CNode

CNode* m_pParent Pointer to parent.
CNode* m_pLeftChild Pointer to left child.
CNode* m_pRightChild Pointer to right child.
int m_nAssociativityLevel assoicativity level for mathematical analysis
DWORD m_dwEditMode edit mode of the node (one of the NE_* defines)
int m_nSubLevel sublevel (subscript, sub-subscript ...)
int m_nSubLevelLeftInc
int m_nSubLevelRightInc
the increments of the sublevel for the children
CString m_strNodeType node type (one of the NT_* defines)
CString m_strShortCut the shortcut of the node (sin for sinus)
CString m_strName the name of the node (sinus for sinus)
COLORREF m_crColor color of the node (modified by the formatter class)
LOGFONT m_lf LOGFONT node (modified by the formatter class)
CStringArray m_saKeyWord Keywords are stored in a Stringarray (Use the define LT_* to access)
CRect m_NodeRect the destination rectangle for the ouput
int m_nBaseLine the baseline of the node (with childs )
// e.g. the division line for the CDivisionNode
CString GetNodeType() Returns the node type
void SetParentDirect(CNode* pNode) Sets the parent node directly
CNode* GetParentDirect() Returns the parent node
void SetLeftChild(CNode* pNode) Sets the left child (and sets left child's new parent as this)
CNode* GetLeftChild() Returns the left child
void SetRightChild(CNode* pNode) Sets the right child (and sets right child's new parent as this)
CNode* GetRightChild() Returns the right child
void SetName(CString strName) Sets the name of the node
CString GetName() Returns the name of the node
void SetShortCut(CString strShortCut) Sets the shortcut of the node (used for rendering)
<CODE><CODE>CString GetShortCut() Returns the shortcut of the node
void SetEditMode(DWORD dwEditMode) Sets the edit mode of the node (Combination of NE_ defines)
DWORD GetEditMode() Returns the edit mode of the node
void SetItalic(BOOL bItalic) Sets the italic attribute in the LOGFONT structure
BOOL GetItalic() Returns the italic attribute in the LOGFONT structure
void SetBold(BOOL bBold) Sets the lfWeight-value of the LOGFONT structure (FW_BOLD for bBold==TRUE and FW_NORMAL for bBold==FALSE)
BOOL GetBold() Returns the weight of LOGFONT structure (TRUE for lfWeight==FW_BOLD and FALSE for bBold==FW_NORMAL)
void SetColor(COLORREF crColor) Sets the RGB colour of the node
COLORREF GetColor() Returns the RGB colour of the node
void SetSubLevel(int nSubLevel) Sets the sublevel of the node
int GetSubLevel() Returns the sublevel of the node
int GetSubLevelLeftInc() Returns the sublevel-increment of the left children
int GetSubLevelRightInc() Returns the sublevel-increment of the right children
void SetFaceName(CString strFaceName) Sets the facename in the LOGFONT structure
CString GetFaceName() Returns the facename of the LOGFONT structure as a CString
virtual int GetAssociativityLevel() Returns the Associativity Level of the node (for symbolical postprocessing, currently not used)
virtual BOOL IsNodeLeaf() Returns TRUE if the node has no valid left and right child
virtual void DrawNode(CDC*, CRect&,
CNode*, DWORD)
virtual CNode* GetNodeFromPoint(CDC*, CRect&,
CPoint)
virtual void FormatNode(
CBinTreeFormat* pFormat=NULL)
virtual CRect GetRect(CDC* pDC)
drawing functions
CNode* FindParentPraeorder(CNode* pSearchNode) searching praeorder for the parent of a given node
virtual void Serialize(CArchive& ar,
CBinTree* pTree)
function to overload by subentities
virtual void TransformRects(CRect&, CRect&,
CRect&, CRect&)
virtual CRect GetContentRect(CDC* pDC)
virtual void DrawContent(CDC*, CRect, DWORD)
standardimplementation (default behaviour)
virtual CString WriteNode(int nLanguageType) Output of the formula in the language LT_*
LOGFONT* GetLogFont() Returns a pointer to the LOGFONT structure m_lf
 

Features

The formula-control has got the following additional features:

How to use...

Select an equation-node from the equation-toolbar-button. Then you get an equation with placeholders on the left and on the right side. By moving the mouse over the equation the nodes are highlited. Select a placeholder with a single left-mouseclick. Now you can overwrite the placeholder with any node you want. By selecting a node with a double-click, the whole subtree of the node is selcted (e.g select the = from an equation with a doubleclick and either the left and the right side of the equation are selected). If you select a variable-node, a constant-node, a number-node or a userfunction-node you get into the editing by another left-mouseclick.

History

for detailed information please have a look on the file-header-comments
Version 1.0.0.1 - 15-Apr-2003 Version 1.0.0.0 - 09-Apr-2003
First Version

Environment:
Windows NT 4.0 Service Pack 6
MFC Version: 6.0
Service Pack: 5

DataPool engineering
Essener Str. 99
D-46047 Oberhausen

Internet: www.dp-e.de
thorsten.wack@dp-e.de

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
QuestionHelp~ me.
Yails
21:34 6 Jun '06  
Smile
Hello,
I'm Yail, Kim.

I try to compile your source(formula editor)...


Your source seems so good.(I think very excellent source)..
I do not compile this source.
So, some characters are compile error..~..

(My computer is Windows XP (Korean...), VC++ 6.0(SP 6))


-----------(nodeentities.cpp, line : 701)
m_straShortCuts.Add("?); //<-- Compile Error... may be "<="...
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T(".LE."));

these characters are 98 times....
(these characters are so many...So~
Please this source re-compress, and then please send to me..
Any one~ please....
)

I download the source at this site(www.codeproject.com).
I unzip that source using winzip.

Why???
Unknown character??? ("Symbol")


Please, can you send the source package to me by e-mail?
My E-mail is yails@citicomm.co.kr

Please~

Best regards...

=============================
Kim Yail / Engineer

Mobile : +82+10-2273-6900
E-mail: yails@citicomm.co.kr
=============================
AnswerRe: Help~ me.
gmaoyou
6:09 28 Sep '06  
modify the file in this way.

CEquationNode::CEquationNode()
{
char acs; //////////111111111

m_strNodeType=NT_EQUATION;
m_straShortCuts.SetSize(0,1);
m_straFontNames.SetSize(0,1);

m_straShortCuts.Add("=");
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add(acs=0xa3); /////////////111111 and so on !!!!
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T(".LE."));

m_straShortCuts.Add(acs=0xb3);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T(".GE."));

m_straShortCuts.Add("<");
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T(".LT."));

m_straShortCuts.Add(">");
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T(".GT."));

m_straShortCuts.Add(acs=0xb9);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T(".NE."));

m_straShortCuts.Add(acs=0xba);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add(acs=0xbb);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add("@");
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add(acs=0xc7);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add(acs=0xc8);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add(acs=0xc9);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add(acs=0xca);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add(acs=0xcb);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add(acs=0xcc);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add(acs=0xcd);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add(acs=0xce);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add(acs=0xcf);
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add("'");
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add("$");
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_straShortCuts.Add("\"");
m_straFontNames.Add("Symbol");
m_straKeyWords[LT_FORTRAN].Add(_T("="));

m_strShortCut="";
m_strName="equation";
m_nType=0;

m_nAssociativityLevel=20;
}



G-RdOX-Gen.
email longes@56.com
GeneralGreat Article
Hadi Dayvary
21:38 27 May '06  
Great article.
Thanks
GeneralGreat work [modified]
hamo2008
7:37 23 May '06  
It's a great work. I am developing a expression parser for this control and it can translate the formular expression(LaTex-like) to this great formula editor.
For example, f(x)=x^2+\frac{1,x+\sigma}

Another more complex example, following is the formula expression:
s(x)=a\link x^2+b \link x+30 \n
f(x)=x^2+\beta+\frac{x,1+\sqrt{x+\frac{1,3+x}}} \n
g(x)=80.22\unit{mm} \n
f(x)=\int_0^100{(2\cdot x^2+3\cdot x+10),x} \n
g(x)=\sum{i=1,N,(x_i+sin(x+\pi/2))}+100 \n
W_0=\frac{\gamma,2}\link\brac{2,(\cot{\omega_2}+
\tan{\alpha_2})\link H^2 +(\tan{\alpha_1}-\tan{\alpha_2})\link H^{2}_{1}} \n
x=3\arrow{6}\brac{15,\bin{w=4,m=5}}\cdots{50}(8.29)

more detail on http://www.ucosoft.com/archives/29.html

----
You have nothing to lose, but everything to gain.
Welcome to www.ucosoft.com
GeneralThank u
Keyvan Nayyeri
6:15 5 Jul '05  
That's great article. Specially for someones like me whose deal with mathematics in their applications.

Keyvan Nayyeri
Website: www.keyvannayyeri.com
Online community: www.nayyeri.net
GeneralFirst char uppercase
Bruno Norberto
2:30 17 Feb '05  
Does anybody knows how to prevent the in place edit from displaying the first char of a typed text in uppercase? Mad

Bruno Norberto
GeneralRe: First char uppercase
Ramon Pardo
2:17 28 Jun '06  
Hi Bruno,
i found the problem. The control doesn't handle properly char codes in CFormulaCtrl::OnKeyDown function.
The last "if" sentence of that function is:

if(pNode->GetEditMode() & NE_ALLOWEDIT)
{
pNode->SetEditMode(pNode->GetEditMode() | NE_INEDITMODE);
DWORD dwStyle = ES_CENTER;
CRect rectEdit=TransformRect(pNode->m_NodeRect);

m_pEditWnd = new CFormulaInPlaceEdit(this, rectEdit,
dwStyle,
IDC_INPLACE_CONTROL,
pNode,
pNode->GetShortCut(),
nChar2);
}

and should be

if(pNode->GetEditMode() & NE_ALLOWEDIT)
{
pNode->SetEditMode(pNode->GetEditMode() | NE_INEDITMODE);
DWORD dwStyle = ES_CENTER;
CRect rectEdit=TransformRect(pNode->m_NodeRect);

BYTE keyState[256];
memset(keyState, 0, 256);
::GetKeyboardState((BYTE*)keyState);

WORD nChar2 = 0;
if(::ToAscii(nChar, 0, (BYTE*)keyState, &nChar2, 0) == 1)
{
m_pEditWnd = new CFormulaInPlaceEdit(
this,
rectEdit,
dwStyle,
IDC_INPLACE_CONTROL,
pNode,
pNode->GetShortCut(),
nChar2);
}
}

This works for me.

Cheers,
Ramón Pardo
GeneralGreat control
AliRafiee
15:26 18 Jan '05  
I just wish that the output data wasn't dependent on CObject. I need to develop this same control, and a Mac equivalent, and exchange data between the two.
GeneralAnd & Or
Bruno Norberto
10:50 29 Jul '04  
How could I write a CAndNode and a COrNode for boolean expressions like: ( A > B ) && ( C == D ) ? Did anybody already write these?

Bruno Norberto
GeneralRe: And & Or
Bruno Norberto
5:58 31 Aug '04  
Nevermind... i figured it out

Bruno Norberto
Generalrequest!
some_one_1
23:01 6 May '04  
it's a fain working prog.I am very interested in developing a similar project but in other domain than math,may you send me by email some other documentation's about de prog, like some uml design's or explanation about de subalgorithm's.Thanck you. i wait for your reply at Amadeo_BEI@personal.ro. thanck's again!
GeneralRe: request!
cherish
22:10 8 Aug '04  
I want to get those documents ,please send me a mail too. Thanks a lot !

www.cherishSoft.com
Thanks!
GeneralEXCELLENT!
boon313
2:14 30 Mar '04  


I have never seen anything like this before. Excellent piece of work!



GeneralSome questions, please help me !!
cherish
16:54 17 Dec '03  
I complie the program, but it has some errors.
Example:
m_straShortCuts.Add("?);
and
m_strShortCut="?;
and
m_straShortCuts.Add("鬃?)
and
m_straShortCuts.Add("蝌?)
and
m_straShortCuts.Add("|?);

other is similar.

What are these errors meaning , how to solve? Please give me a help ,thanks at first.


cherish William
GeneralRe: Some questions, please help me !!
cherish
18:11 18 Dec '03  
No person tell me why ?

The symbol means what??

Thanks a lot!!

cherish William
GeneralRe: Some questions, please help me !!
Anonymous
23:22 4 Jan '04  
I meet the same thing, can not know how to solve it
GeneralRe: Some questions, please help me !!
cherish
2:28 12 Jan '04  
If someone can compile it, please tell us , thanks a lot!!

GeneralRe: Some questions, please help me !!
tbw
23:47 15 Jan '04  
The formula-editor is not tested with unicode. The constructors of the nodeentities use some characters, that are dircetly copied from the symbol-charset (to supply for example special kind of braces). I think these characters are the problem.
Please send me the output of your compiler including the errors.
Maybe I can find a solution... Sigh

tbw

GeneralRe: Some questions, please help me !!
Xiaopf
17:10 20 Jan '06  
These errors,can you fix it? thank you!
\formulactrl_src\projekte\FormulaDlg\nodeentities.cpp(350) : error C2146: syntax error : missing ';' before identifier 'm_strName'
\formulactrl_src\projekte\FormulaDlg\nodeentities.cpp(424) : error C2001: newline in constant
\formulactrl_src\projekte\FormulaDlg\nodeentities.cpp(425) : error C2146: syntax error : missing ';' before identifier 'm_strName'
\formulactrl_src\projekte\FormulaDlg\nodeentities.cpp(589) : error C2001: newline in constant
\formulactrl_src\projekte\FormulaDlg\nodeentities.cpp(590) : error C2146: syntax error : missing ')' before identifier 'm_straFontNames'
\formulactrl_src\projekte\FormulaDlg\nodeentities.cpp(599) : error C2001: newline in constant
\formulactrl_src\projekte\FormulaDlg\nodeentities.cpp(600) : error C2146: syntax error : missing ')' before identifier 'm_straFontNames'
\formulactrl_src\projekte\FormulaDlg\nodeentities.cpp(701) : error C2001: newline in constant
\formulactrl_src\projekte\FormulaDlg\nodeentities.cpp(702) : error C2146: syntax error : missing ')' before identifier 'm_straFontNames'
\formulactrl_src\projekte\FormulaDlg\nodeentities.cpp(705) : error C2001: newline in constant
GeneralRe: Some questions, please help me !!
Prosperb
11:28 5 Apr '07  
This probably has to do with the namespace for your section of code not being used properly. Make sure you include the header file that defines the namespace of the code that you are about to call, and then write the line "using namespace nnnn;". The 3 things must be in this particular order.

For example:

#include "ou_thread.h"
using namespace openutils;
// my code that uses the namespaced classes defined in the header file

pp
QuestionMy Error is same~!
Yails
21:38 6 Jun '06  
Can you re-compress the package?
Please~
GeneralGreat work!
dswigger
9:19 4 Dec '03  
The control really is impressive - I am looking forward to letting a friend of mine play around with it.
Big Grin
GeneralGreat - but some errors when compiling for VC.NET
Alexandru Savescu
4:46 10 Jun '03  
Hello,
Your control looks amazing. However, I tried to build it with .NET and encountered the following errors:


Compiling...
ColourPopup.cpp
c:\Alex\CodeProject\FormulaCtrl\projekte\FormulaDlg\ColourPopup.cpp(230) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CColourPopup::* )(BOOL,HTASK)' to 'void (__thiscall CWnd::* )(BOOL,DWORD)' None of the functions with this name in scope match the target type
c:\Alex\CodeProject\FormulaCtrl\projekte\FormulaDlg\ColourPopup.cpp(908) : error C2664: 'CWnd::OnActivateApp' : cannot convert parameter 2 from 'HTASK' to 'DWORD' This conversion requires a reinterpret_cast, a C-style cast or function-style cast

I reckon you should update your ColourPopup control.

Keep up the good work!

Best regards,
Alexandru Savescu

P.S. Interested in art? Visit this!
GeneralRe: Great - but some errors when compiling for VC.NET
SohailB
21:57 29 Mar '05  
Just change the HTASK in those two lines to DWORD and everything runs OK. Its a really great job Smile
GeneralGreat!
Doan Quang Minh
18:36 31 May '03  
This 's great job. Love!

Never say Goodbye!


Last Updated 16 Apr 2003 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2010