|
If you don't say what does not work, no-one is going to give suggestions.
When you post code, please use the "pre" tag (below the signature box) so the indenting is not lost.
|
|
|
|
|
I'm just starting to learn C++, and i met a problem error below when i compound it...pls teach me how to correct these errors. Your kindness will be appreciated....thank you.
#include "matrix.h"
#ifndef _NO_NAMESPACE
using namespace std;
using namespace math;
#define STD std
#else
#define STD
#endif
#ifndef _NO_TEMPLATE
typedef matrix<double> Matrix;
#else
typedef matrix Matrix;
#endif
#ifndef _NO_EXCEPTION
# define TRYBEGIN() try {
# define CATCHERROR() } catch (const STD::exception& e) { \
cerr << "Error: " << e.what() << endl; }
#else
# define TRYBEGIN()
# define CATCHERROR()
#endif
the software tells the error at these location:
line6 : error C2871: 'std' : does not exist or is not a namespace
line7 : error C2871: 'math' : does not exist or is not a namespace
line14 : error C2143: syntax error : missing ';' before '<'
line14 : error C2143: syntax error : missing ';' before '<'
|
|
|
|
|
you need to #include the files that contian those namespaces, otherwise the compiler doesn't know what your "using" statements refer to.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
I'm sure there are hundreds of tools/addins/libraries for detecting memory leaks. Which one do most of you use? What is the best method for detecting the annoyances? is it possible to find the exact function/line?
I'm using Visual Studio VC6 Enterprise if it makes any difference.
|
|
|
|
|
I've tried many and my preferred tool DevPartner Studio from CompuWare. It has its quirks and sometimes goes a while without an update, but I've been especially impressed with the latest version.
It is a little expensive, but has proven its worth for me many times over.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I have a message "An unsupported operation was attempted" in MFC release configuration.
How may I locate error point?
|
|
|
|
|
try to search for this message in MFC Source.
Yout find it where your Developer Studio is installed.
|
|
|
|
|
I would try to find it in a debug buid. If it doesn't occur in the debug build alter the compiler setting (for the debug configuration) to include the "/GZ" switch and try again - It's much easier to find bugs in a debug build.
Steve
|
|
|
|
|
How can I tell if my arrival to OnBnClickedOk() came from a mouse click or from a keyboard entry of Enter?
The reason this is important is that I have a multi line edit box and if the user hits Enter while in this edit box I don’t want the system to act as if he clicked on OK.
I already tried removing the Default Button Status from the OK button, but that makes no difference. I can see that if I click on the edit box, the added black line on the OK button remains, as if it has the focus, which of course it doesn’t. Even if I tab to this control the added black line on the OK button remains, showing that Enter will activate it.
Clearly, if I could know in my event handler for the OK button if the event came from a mouse click or from a keyboard Enter, there would be no problem dealing with it.
Any suggestions would be appreciated. Thanks,
Ilan
|
|
|
|
|
I'm not quite sure how to do this in MFC, but in win32, you need to change the way the messages are handled.
This code is inserted into the winMain and it checks for messages being sent to the dialog.
while( GetMessage( &msg, NULL, 0, 0 ) )
{
if(!IsDialogMessage(dlgHwnd, &msg)) {
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
return msg.wParam;
|
|
|
|
|
You're going about it the wrong way, really. Take a look at the ES_WANTRETURN style for the edit box - setting that will probably give you the result you're after.
|
|
|
|
|
Thanks Graham. This gives me EXACTLY the result I wanted. Since I never used it, I didn't know it existed.
Thanks again,
Ilan
|
|
|
|
|
Hi Ilan,
Well, my suggestion is that you declare two time stamps and use them to keep the latest time of left mouse click and Enter key click. In OnOk functions, you may compare the current time with both time stamps and this may give you some idea about which is the source of the action.
regards,
chris
|
|
|
|
|
Oops, I didn't see other replys just now. Obviously, my suggestion is the worst one. hehe, ignor it.
Regards,
Chris
|
|
|
|
|
I want to make a modal class in the visual c++,but when I want to make it ,the system told me that I can't make this class,how should I solove this problem.thank you!waiting for your answer.
Always do you best,what you plant you will harvest
later!
|
|
|
|
|
Do you mean a modal 'dialog' ?
If so there are two methods for creating a dialog
DialogBox() // creates a modal dialog
CreateDialog() // creates a modeless dialog
Have a look on MSDN for how to use these functions.
|
|
|
|
|
|
Harry,
What are you staring with, a Dialog based application?
Do you want to create another Dialog that you can po
up from the intial one?
Bt the way, it will help you a lot, a lot, a lot,
if you give a subject in you post that is indeed the
subject you are inquiring about.
If you just put "help" then it possible that many people
who could help you will just pass over you post.
Read Chris's points also. They are the first post in this
forum.
|
|
|
|
|
Anyone knows what function to use to get the value of a radio button in a dialog box??
I have done the following but it has no effect on my program:
g_water.RippleIntensity= GetDlgItemInt( hWnd, IDC_RIPPLE_INTENSITY, NULL, true );<br />
<br />
iRenderCheck = GetDlgItemInt( hWnd, IDC_WATER_YES, NULL, true );<br />
<br />
if (iRenderCheck == 1)<br />
{<br />
g_water.m_bWaterCheck = true;<br />
}<br />
else if (iRenderCheck == 0)<br />
{<br />
g_water.m_bWaterCheck = false;<br />
}
Cheers!!
|
|
|
|
|
Not sure i understand what you mean but have you looked at CheckRadioButton[^]
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
CButton::GetCheck()
--
Pictures[^] from my Japan trip.
-- modified at 4:24 Sunday 19th March, 2006
|
|
|
|
|
Hi amanoullah,
if(m_Radio1.GetCheck()==1)
MessageBox("Radio1");
if(m_Radio2.GetCheck()==1)
MessageBox("Radio2");
|
|
|
|
|
Hi All,
How to convert a Binary tree to Circular linked list?
Any help would be appreciated.
With Regards,
A.Ilamparithi.
|
|
|
|
|
Ilamparithi wrote: How to convert a Binary tree to Circular linked list?
Why would you want to? homework assignment? or change of design?
Because of that possibility, I won't give you code. Any tree is read very easily. You have a descending key branch and an ascending key branch. A balanced tree has equal descending key branches as ascending key branches, each node is compared high or low to a key search and you follow either branch as appropriate, when you find equal, you stop. A binary tree, like a binary search is a minimal path to solution design, very efficient in search, but very poor design for sequential access. Lists are very poor random search but exceedingly fast in sequential search operations.
To follow a tree in sequential order is easy, you always follow a branch until your reach a bottom leaf and then back track and follow the next.
// psuedo-code this will NOT compile!!
process (node)
{
if (node->left not empty ) process (node->left)
display (node)
if (node->right not empty ) process (node->right)
}
pretty simple, but the stack flow from recursion has severe overhead, especially for large trees. You can change the display node portion to add to a sequential list, and add the necessary passed parameters to do so. But on large trees the overhead of process will be very high. If you notice most of the time is spent calling functions, so the cpu is spending 66% of its time doing nothing but calling code, only 33% processing a node. ouch.
If you have a design that must change from random access priority speed to sequential access priority speed, this is a great one-time tool to rebuild your list. If the list does not need to be ordered, then it doesn't matter what order you process left right and display operations. Circular linked lists are often random order, so I guess it doesn't matter, I highly dislike random order data because of the unpredictability factor. In my business "knowing" that a process will always take n milliseconds is more important than making it fast (though I try to do both in balanced form).
read this: http://en.wikipedia.org/wiki/Tree_search[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
i have a problem in creating my user interface using Open GL and GLUI. most of the example using polygons and some other things. I want to use tree.I just want to know how to create the interface because my project will use L-System as the engine.
|
|
|
|