I was wondering what advice can you give on how to create a data/business model in C++. I mean, when working with C# I usually have no problems, simply follow .NET's guidelines, but it seems there aren't guidelines in C++ on this regard. Is there any example you'd like to share?
I'm thinking common scenarios like a sales system (product, warehouse, pricing, purchase order) or a search inverted index (term, documents, posting, posting lists, dictionaries).
You could overwrite the OnChange Handler (I think it was EN_CHANGED or something like that) and manually get the text, check for any non-digit and remove it. Then set the corrected Text with SetWindowText(), or ReplaceSel().
There are however several pitfalls you need to avoid. First, setting the text programmatically also calls the event handler, and you need some status variable to prevent "recursive" calls.
Second, You need to take the cursor position into account. When you call SetWindowText(), usually the whole edit control content is selected. You could set the cursor position to the end with SetSel() (IIRC you need two calls, one to mark everything and at the same time set the cursor to the end, a second one to mark nothing and leave the cursor where it is.) Since the user may have entered something in the middle you may want to get the cursor position before changing anything (with GetSel()) and set it back to that position later.
I usually avoided these issues by letting the user enter the wrong values and checking them when the control lost focus, unless where was a strong argument against this approach.
I'm not sure where should I post this but it's part of the code in Clips (C Language Integrated Production System ) environment which is software tool for building expert systems.
please let me know where should I post it?
You've been told that this forum isn't suitable, yet have decided to post here again. No matter how may times you post CLIPS != c || c++, the c=part denotes it can be integrated with c-based systems. Additionally CLIPS is relatively specialised, rule based programming is different to the way c operates.
All this adds up to one thing: the advice I have seen here so far is spot-on: don't post this here as this isn't the correct forum and few people here will have an interest in CLIPS, your chances will be vastly improved by posting on a specialised CLIPS forum where everyone is there as they know about/are interested in it.
The defrule for Rule0 has an unbalanced number of brackets BTW my guess is there is one missing at the end of the "not" line, and the ? after tank-is-full looks suspicious. Of course I know next to nothing about CLIPS, which is why going to a CLIPS forum would be so handy.
“Education is not the piling on of learning, information, data, facts, skills, or abilities - that's training or instruction - but is rather making visible what is hidden as a seed” “One of the greatest problems of our time is that many are schooled but few are educated”
yeah, I do that but I didn't get any answer so I post here.
yours help a lot because every time I check every thing else rather than brackets. I didn't pay attention to that at all, it was just frustrating to check sth again and again and don't know what to do.
my problems solved, THX
A couple of weeks ago, I got this nasty rash on my mouse clicking finger. I posted a question to a medical site but nobody answered. I figured that since I was writing a C++ program when it started to hurt that I would repost my question here.
hello everybody :
i want to ask i recently downloaded a C++ source code , i just want to make program executable ( i mean make it binaries)like linux ,
is there any free program that do and make the setup file .
Thanks anyway .
You need to create a project, add the source files to it, compile it and fix the compiler type errors if any.
After this process, you will have an executable.
As for creating a setup program, you can use the free Wix Toolset.
It will integrate with Visual Studio so that you can create the setup program from Visual Studio itself.
You can download it from here - http://wixtoolset.org/[^]
Here is an extensive tutorial on Wix - http://wix.tramontana.co.hu/tutorial[^]
«_Superman_» I love work. It gives me something to do between weekends.