|
Hi,
I'm looking for some code that understands mathematical expressions presented as a string (e.g. "y=sin(x)+2x").
Have you seen any code that does this? This code seems so fundamental to me, it could even be provided within MFC but I can't find it.
I'm writing an MFC application that will plot a x-y graph of a mathematical equation.
So ideally code I am looking for will accept a string input (e.g. "y=x^2+5") and an x value will output the corresponding y value.
Thank you
Shan
|
|
|
|
|
|
For your application you need to first "compile" the expression into some quickly-evaluatble form, and then repeatedly assign values to the variables in it (in your case -- 'x' only) and get the result.
I did that a long long time with UCalc, which back then had a .lib version.
Alternatively, if you're feeling up to it, you can write an infix parser, and create an expression tree or a postfix expression from it.
EFG also has a page full of links for such programs and libraries. Search for "+Expression +Evaluate +Library +EFG" on Google.
I'll be glad to elaborate more if you need.
|
|
|
|
|
have a look at the book The C++ Language from Bjarne stroustrup. Inside, he gives an example of "mathematic calculator" (about p.120).
TOXCCT >>> GEII power
|
|
|
|
|
No code actualy understands a mathematical expression! What I think you are looking for is a "Recursive Descent Parser"; the best example I ever found was in "Advanced C Programming" (may be out of print), it is much easier to understand than the one in "Bjarne stroustrup" book.
INTP
|
|
|
|
|
I want to hide my menu bar but I've read in msdn that a menu bar is always visible, but I think I've seen an application (running fullscreen, probably with WS_POPUP) has the ability to hide/unhide its menu bar.
Can we really do this using MFC ??
|
|
|
|
|
|
Hi,
What is the best way of using MFC's List to store data of this type?
typedef struct DATAGRAM
{
UINT packetID;
ip_header* ipHeader;
pcap_pkthdr* wpHeader;
const UCHAR* pkt_data;
} DATAGRAM;
ipHeader* etc are pointers to further structs. I tried plain CList DATAGRAM, DATAGRAM& and are having problems with code like:
packetCapture.AddTail(filledStruct);
The addtail is in a fairly fast loop and added data is going in fine and coming out of the list corrupted (due to something going out of scope before the operation is completed perhaps?)
I am probably doing something extremely retarded, any ideas?
|
|
|
|
|
Did you mean to do this instead?
packetCapture.AddTail (&filledStruct);
Also remember that filledStruct must be in scope for its address to be valid when you access the list after populating it. You might want to consider new() ing instances of DATAGRAM and adding those instances to the list. They will be around as long as your application runs since they're created on the heap. Be sure to free up this memory before your app exits.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi all,
I would be pleased if any one have an algorithm for building a software program to make a Gantt Chart i need to know the steps thanx all .
More Creativity
|
|
|
|
|
I'm writting my own Gantt control right now as i wasn't able to find anything suitable out on the web.
When i searched for existing Gantt related work the best (only) thing i found was :
http://ganttproject.sourceforge.net[^]
although this is all in Java it might provide a starting point.
I have tended to use MS Project as a guide to what kind of data needs to be stored and how to present the data in an interface. If you are going to have access to MS Project you may want to look at the database schema information provided with MSP. It can usually be found in the install directory e.g. C:\Program Files\Microsoft Office\Office\1033 and will be named OLE_DB.HTM, or PROJDB.HTM, or something similar depending on the version of MSP you have installed.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
hi,
I am trying to understand the Plot Grafhical Library (great library that plots grafhs that i downloaded from the PGL homepage and not the one you can download on the code project site) by programming a small example. but after i run the appliaction i find myself facing the next message : "Unhandled exception in try2.exe (MFCO42D.DLL): 0x0000005: Access Violation"
this violation occures while the program tries to call for a constructor of one of the PGL classes (CPGLRegion), and the debugger brings me to GetThreaterMode() function (from viewhtml.cpp).
if someone knows what is the problem, please help.
mloolm
|
|
|
|
|
hi,all:
when i use spy to trace my windows prog,the trace show that there is a window which the caption is "Default IME".
who can tell me:what is the "Default IME"?
another question:who can tell me the "winsta0" in function OpenWindowStation("winsta0",......)?
appreciate any help!!!!
|
|
|
|
|
Hello all,
please, does anybody know how to setup the RichTextControl (2.0) that it will appear only as the text on dialog box and not as edit field (e.g. that cursor changes and user can select it)?
I tried to set it as read only, but it doesn't help.
Thank to you all!
Katerina
|
|
|
|
|
i am not sure..just try
YourCtrlVariable.EnableWindow(FALSE);
I want to change Myself..Can u help me?
|
|
|
|
|
Hi,
it is not realy nice solution because i have to use different font (normal is grayed then), but still better than nothink,
maybe somebody knows better solution?
Anyway thanks!
how can i help you to change your self?
|
|
|
|
|
GirlsCanProgram wrote:
I tried to set it as read only, but it doesn't help.
Strange. This should work.
VERIFY (myRichEditCtrl.SetReadOnly (TRUE));
ASSERT (myRichEditCtrl.GetStyle() & ES_READONLY);
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi dear,
yes, sure setting it to read only works,
but then when you will move over control the cursor changes and and you can also select the text.
So it doesn't look like normal text.
Katerina
|
|
|
|
|
Hi Katerina, what you are doing is right according to me. But, there is one more thing that you need to add. Override the PreTranslateMessage and enter the code given below:
BOOL CMyDialog::PreTranslateMessage(MSG *pMsg)
{
if (pMsg->message == WM_MOUSEMOVE && pMsg->wParam == MK_LBUTTON)
return (TRUE);
return (CMyDialog::PreTranslateMessage(pMsg));
}
Don't remove the read-only setting.
Hope this proves useful.
Gurmeet S. Kochar If you believe in God, it's because of the Devil
My CodeProject Articles: HTML Reader C++ Class Library, Numeric Edit Control
|
|
|
|
|
Hello,
I am experiencing a very strange "phenomenon":
When I compile a Visual C++ program in VS 2002
(no GUI, just console output) into
an exe on XP Home it runs smoothly. However,
when I give this to someone with an XP Pro
machine, it does not run but stops with an
exception error message box.
We have tested this on 3 different XPPro boxes now
and everywhere the same result.
When I compile the program with the same VS 2002
installed on a XPPro machine into an exe,
it runs BOTH on XPPro and XPHome.
I am really puzzled and have no clue why this happens.
Seems that in terms of OS at compilation time the exe's
are downward compatible but not upward.
Could anybody please help me and tell me what is going on?
Thank you so much in advance,
Tony
|
|
|
|
|
Tony Westminster wrote:
Could anybody please help me and tell me what is going on?
A lot depends on what the exception error is. Is this an MFC app or a pure Win32 app. Do you use the CommonControls dlls.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
Thank you very much for your quick answer. I am not quite sure how
someone can tell if it is an MFC app or pure Win32 app? I assume
you see it if it contains MFC*.dll?
I used depends 2.1 to see which DLL's my App uses. I have attached below a list of all used DLLs. Note that Column1 and Column2 contain
the same list of dll's, I have just sorted Column2 by name to facilitate analysis.
Thank you so much for any help on this.
If I cannot find an answer on why this happens, do you think it is safe to say:
"Compiled exes will
always work on XP Home when compiled on XP Pro but not necessarily the
other way around."
If I knew this was true, I could always only compile the progs on XP Pro and be on the safe side.
Thanks again,
Tony
MPR.DLL ACTIVEDS.DLL
ADVAPI32.DLL ADSLDPC.DLL
COMCTL32.DLL ADVAPI32.DLL
COMDLG32.DLL ADVPACK.DLL
GDI32.DLL APPHELP.DLL
IPHLPAPI.DLL ATL.DLL
KERNEL32.DLL AUTHZ.DLL
MSCOREE.DLL BROWSEUI.DLL
MSVCP60.DLL CABINET.DLL
MSVCRT.DLL CDFVIEW.DLL
NTDLL.DLL CERTCLI.DLL
OLE32.DLL CFGMGR32.DLL
OLEACC.DLL CLUSAPI.DLL
OLEAUT32.DLL COMCTL32.DLL
RPCRT4.DLL COMDLG32.DLL
SHELL32.DLL CREDUI.DLL
SHLWAPI.DLL CRYPT32.DLL
USER32.DLL CRYPTUI.DLL
WINSPOOL.DRV CSCDLL.DLL
WS2_32.DLL DBGHELP.DLL
WS2HELP.DLL DEVMGR.DLL
ACTIVEDS.DLL DHCPCSVC.DLL
ADSLDPC.DLL DNSAPI.DLL
ADVPACK.DLL DUSER.DLL
APPHELP.DLL EFSADU.DLL
ATL.DLL ESENT.DLL
AUTHZ.DLL GDI32.DLL
BROWSEUI.DLL GDIPLUS.DLL
CABINET.DLL IMAGEHLP.DLL
CDFVIEW.DLL IMM32.DLL
CERTCLI.DLL INETCOMM.DLL
CFGMGR32.DLL IPHLPAPI.DLL
CLUSAPI.DLL KERNEL32.DLL
CREDUI.DLL LINKINFO.DLL
CRYPT32.DLL LZ32.DLL
CRYPTUI.DLL MFC42U.DLL
CSCDLL.DLL MLANG.DLL
DBGHELP.DLL MOBSYNC.DLL
DEVMGR.DLL MPR.DLL
DHCPCSVC.DLL MPRAPI.DLL
DNSAPI.DLL MPRUI.DLL
DUSER.DLL MSASN1.DLL
EFSADU.DLL MSCOREE.DLL
ESENT.DLL MSGINA.DLL
GDIPLUS.DLL MSHTML.DLL
IMAGEHLP.DLL MSI.DLL
IMM32.DLL MSIMG32.DLL
INETCOMM.DLL MSOERT2.DLL
LINKINFO.DLL MSRATING.DLL
LZ32.DLL MSSIGN32.DLL
MFC42U.DLL MSVCP60.DLL
MLANG.DLL MSVCRT.DLL
MOBSYNC.DLL MSWSOCK.DLL
MPRAPI.DLL NETAPI32.DLL
MPRUI.DLL NETCFGX.DLL
MSASN1.DLL NETMAN.DLL
MSGINA.DLL NETPLWIZ.DLL
MSHTML.DLL NETRAP.DLL
MSI.DLL NETSHELL.DLL
MSIMG32.DLL NETUI0.DLL
MSOERT2.DLL NETUI1.DLL
MSRATING.DLL NETUI2.DLL
MSSIGN32.DLL NTDLL.DLL
MSWSOCK.DLL NTDSAPI.DLL
NETAPI32.DLL NTLANMAN.DLL
NETCFGX.DLL ODBC32.DLL
NETMAN.DLL OLE32.DLL
NETPLWIZ.DLL OLEACC.DLL
NETRAP.DLL OLEAUT32.DLL
NETSHELL.DLL OLEDLG.DLL
NETUI0.DLL OLEPRO32.DLL
NETUI1.DLL POWRPROF.DLL
NETUI2.DLL PRINTUI.DLL
NTDSAPI.DLL QUERY.DLL
NTLANMAN.DLL RASAPI32.DLL
ODBC32.DLL RASDLG.DLL
OLEDLG.DLL RASMAN.DLL
OLEPRO32.DLL REGAPI.DLL
POWRPROF.DLL RPCRT4.DLL
PRINTUI.DLL RTUTILS.DLL
QUERY.DLL SAMLIB.DLL
RASAPI32.DLL SCECLI.DLL
RASDLG.DLL SECUR32.DLL
RASMAN.DLL SETUPAPI.DLL
REGAPI.DLL SHDOCVW.DLL
RTUTILS.DLL SHELL32.DLL
SAMLIB.DLL SHLWAPI.DLL
SCECLI.DLL SHSVCS.DLL
SECUR32.DLL TAPI32.DLL
SETUPAPI.DLL URLMON.DLL
SHDOCVW.DLL USER32.DLL
SHSVCS.DLL USERENV.DLL
TAPI32.DLL UTILDLL.DLL
URLMON.DLL UXTHEME.DLL
USERENV.DLL VERSION.DLL
UTILDLL.DLL W32TOPL.DLL
UXTHEME.DLL WININET.DLL
VERSION.DLL WINMM.DLL
W32TOPL.DLL WINSCARD.DLL
WININET.DLL WINSPOOL.DRV
WINMM.DLL WINSTA.DLL
WINSCARD.DLL WINTRUST.DLL
WINSTA.DLL WLDAP32.DLL
WINTRUST.DLL WMI.DLL
WLDAP32.DLL WS2_32.DLL
WMI.DLL WS2 HELP.DLL
WSOCK32.DLL WSOCK32.DLL
WTSAPI32.DLL WTSAPI32.DLL
WZCDLG.DLL WZCDLG.DLL
WZCSAPI.DLL WZCSAPI.DLL
WZCSVC.DLL WZCSVC.DLL
|
|
|
|
|
This is happens to me also too. I is compilate on my office combuter (XP) and is runs fine also on home computer. But is compilate on home computer, is not run OK on office computer. I having the problem with spin controls jumping more than by one. Is also other problem that I fixed by moving some code from PreCreate to Create.
|
|
|
|
|
Tony Westminster wrote:
Seems that in terms of OS at compilation time the exe's
are downward compatible but not upward
Absolutely not. It doesn't matter what OS you compile on. I could run VC 5 on Win 95, build a GUI app, and it would run on XP or 2K3 or whatever.
It would help if you posted the error message.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Mike,
thank you very much. I get an error message box that says:
"The application failed to initialize
properly (0xc0000135). Click on OK to terminate the application."
Do you have any idea what could cause this?
Thanks,
Tony
|
|
|
|