Hi... I'm beginner in C++ and MFC. I'm building an application that interface with a robotic arm... I have already done that part. I'm missing a part where I have a trajectory in (X,Y,Z) and the arm follows the trajectory. I can handle the mathematical stuff to generate the trajectory but I guess I would be nice to have the target trajectory and the real one plotted in the screen. I have somebooks about visual C++ and MFC, but it is hard for me to diggest them. What I have learnt from the reading is: 1) How to show a window, What I know I need is: 1) Put the (0,0) in the middle of the window, 2) Draw the X,Y,Z axis (taking care of the scaling) 3) Pass the trajectories generated to be ploted. However all this, I'm still confused with the MFC and the modes, and the coordinates. Is there any tutorial that lead me step by step to create an application like that... I like to follow that by creating a demo application to plot an ellipse. Then, I can pass it over my main application, to plot trajectories (the target and the real) together with the error of a trajectory. Both in a window, trajectories in the top and the error in the bottom. Then, of course I would like to save them and/or printing. Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
emrosa
Posts
-
Plotting Graphs -
Four dialogsSorry for this, but I do have no experience in visual c++. I want to build an interface with four dialog windows. I know how to start the first dialog. But then, the main dialog has three buttons (A,B,C). When clicking on A, the main dialog window should be hidden an a new dialog window (WA) appears, after working wiht WA and click (RETURN TO MAIN) window WA disappears, and the main window appears. The same thing happens with buttons B and C. If somebody can give me a hand I will appreciate it. Thanks, Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
control stylesHello...I have a form with some edit controls boxes and buttons. There are two modes (1 and 2). In mode 1 some edits controls should be available for editing, and a button visible and available; and other controls should be unavailable for editing and another button not visible. Changing to mode 2 invert the availability. My problem is that I do not know if this is possible to do it at runtime. If this is possible, how do I do it? I know where to put the code to enable and unenable the controls, but I would like to know what are the visual c++ statements to do this. Can anyone give me a hand? What I meant is how can I change the edit control styles and button control styles, specifically WS_TABSTOP and WM_ENABLE? This at run time Thanks Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
edit control propertiesHello...I have a form with some edit controls. there are two modes (1 and 2). In mode 1 some controls should be available for editing, and a button visible and available; and other controls should be unavailable for editing and another button not visible. Changing to mode 2 invert the availability. My problem is that I do not know if this is possible to do it at runtime. If this is possible, how do I do it? I know where to put the code to enable and unenable the controls, but I would like to know what are the visual c++ statements to do this. Can anyone give me a hand? Thanks Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
Memory SizeHello...I'm declaring a class array of size 80,000,000...when compiling there is an error that the size exceeds the allowed one and the program may not run. I tried but it really does not work..it says that the program is not a win32 application. My solution is to declare the class array dynamically: myclass1 = new myclass[size] When I tried with this there is no memory allocated and the program aborts. As myclass has some double data and other classes embedded, I guess I need to overload the operator new so to create the needed space. Can anyone help me how to do this, assuming the class is defined as: class myclass{ public: myclass2 curr_data2; myclass3 curr_data3; myclass2 new_data4; myclass3 new_data5; } and the other classes class myclass2{ public: double x; double y; double z; } class myclass3{ public{ double motionX; double motionY; double motionZ; } Thanks, Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
Bits and bytes handlingThanks for the hint...I have already tried that and it works fine. Thanks again Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
Bits and bytes handlingHi there...I'm writing a program that will work at bits/byte level. It will accept a double number as an argument, and then the number will be decomposed in two parts: the high and the low, I'm going to do some operations with them. I know about the bitwise operators, but Is anyboady know how to make the decomposition double FUNCTION(double argument) { int hx,lx //MISSING THIS PART!!!! hx = HIGH_PART(argument); lx = LOW_PART(argument); //other operations with hx and lx // return(final_result) } Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
Precision ProblemHi...I'm working with trigonometric functions in visual C++ V6.0. I have this program that converts degrees to radians, applies some direct trigonometric functions, and then some inverse functions. The inverse function I'm using is the ATAN2(y,x). I have checked the function and it uses the definition of pi=3.141592653589793116E00. The examples given in the MSN documentation uses pi=3.1415926535 giving the correct results. Then, I was using the last definition of pi to convert degrees to radians and viceversa, but using also the atan2(y,x) function, and I'm getting that: cos(90. degrees)=-3.4914833611094e-15 Then, because the definition of pi is different in the conversion and the function, I have decided to make it uniform, as I cannot change the definition of pi in the atan2() function, I decided to change the definition of pi used for the conversions, however, I ave got the following: cos(90. degrees)=-6.1230317691119e-017 Which is less than the previous result, but still is not correct. Is there anyway to avoid this situation? Thanks, Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
Edit control boxesHello, I'm developing an interface in visual C++ 6.0...I have some boxes to input data. The program should be able to identify what data was inputted..that is I have three boxes and I just want to change the contents of the third one, if I type twice the tab-key, the contents will be no changed, but if I type something, how can the program know that the contect is being changed, or the contents remaind the same?. I have tried with the OnkillfocusFUNCTION so to detect that i'm moving from one to another. inside the the function I'm using UpdateData() to retreive the data, but how can i implement the identification of the contents-update without having to ask for a previous value. in code this seems like: if (field_code != old_value) //do something else //continue Is there anyother eaier way to do this? Thanks, Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
formatting output in control boxHi...I'm developing a graphical interface. The programs computes some values that are later shown in control boxes in the screen. The program does already that, but I was wondering if there is any way to format that output. That is if the program is displaying in a control box a numeric variable it shows 99.9999 and not 99.999999 (or whatever). I'm using MFC to do most of the stuff, like showing and reading, and all the computations are mine. In the part where the values are shown, I'm calling UPDATE() with false, so to not read values, just show the values. Thanks, Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
control box and menuesHello, everybody. I have an application in which I will have a control box with several data to fill in, several data to be updated, and some command buttons. I also like to add menu facilities. If I used the mfc (exe) wizard application, either I create a single document or a control-box based application. So, 1. How do I include a control box without having a menu command to invoke it, I mean that the control box appears when I start the application. 2. How do I include menues facilities to the control-box based application? I have been looking the online help, ans some manuals I have got without success. Thank you very much, Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONEHow will I do that? What allocation and accesing methods?. Where will I submit the article?...Would you like to help me? Thanks, Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONEThanks for your help....I have tried that and it did work...therefore, making a generalization for this, I just found this: Let be a multidimensional array MArray[max1stdim][max2nddim]...[maxnthdim], the indexes referencing certain location be i1,i2,...,in. If MArray is declared as int MArray[max1stdim*max2nddim*...*maxnthdim]; then the index referencing the location (i1,i2,...in-1,in) will be: index=(i1*max2nddim*max3rddim*...*maxnthdim)+(i2*max3rddim*...*maxnthdim)+...+(in-1)*maxnthdim+in Then for an array MArray[4][3][2] declared as MArray[3*3*3], the single index to reference (i,j,k)will be: index=(i*4*3)+(j*2)+k I have tried this and it works! Thanks again..... :) ;) Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONEThanks for your help....I tried that but it did not work...however, you gave an idea and I put myself to think deeply and I just found this: Let be a multidimensional array MArray[max1stdim][max2nddim]...[maxnthdim], the indexes referencing certain location be i1,i2,...,in. If MArray is declared as int MArray[max1stdim*max2nddim*...*maxnthdim]; then the index referencing the location (i1,i2,...in-1,in) will be: index=(i1*max2nddim*max3rddim*...*maxnthdim)+(i2*max3rddim*...*maxnthdim)+...+(in-1)*maxnthdim+in Then for an array MArray[4][3][2] declared as MArray[3*3*3], the single index to reference (i,j,k)will be: index=(i*4*3)+(j*2)+k I have tried this and it works! Thanks again..... :) Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
graphics library:confused: I'm looking for a graphic library for visual c++ V5.0. The intention is to plot two-dimensional graphs in a single manner and on-line processing. Thanks,:) Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
MULTI-DIMENSIONAL ARRAYS SEEN AS ONE-DIMENSIONAL ONE:confused: Hello. I know that a two-dimensional array can be handles as one-dimensional array by converting the indexes to a single one. Supose you have the following: int *table; table=new int table[3*3]; When referencig table[2][2] by a single index index=(2*3+2); then table[index] can be recalled. Now, I'm having a three-dimensional array and because is faster to handle dynamic arrays, I can define it as: int table1; table1=new int table[3*3*3]; but I got lost finding the index conversion formulae... :confused: Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311
-
Runtime variable creationHas anybody faced the need to create up to k n-dimensional arrays at runtime? Here is an example: Suppose that at the moment of running the program, it needs 3 2-dimensional arrays, each of them has different dimensions. The dimensions of each table are stored in another 2-dimensional array. Then, you start creating the names of each array obtaining array1, array2 and array3. Then, how do you: a) Declare array1, array2 and array3 as dynamic arrays (i.e. double *array1, *array2, array2;) b) How do you re-declare them, i.e. array1 = new double[newdimension]; The problem is not how to create the name of the variables, because you can do it by handling strings and concatenating a number so they can be identified. The main problems are (a) and (b). If someone has a potential response, please emailme... Eric Manuel Rosales Pena Alfaro PhD student Unversity of Essex Wivenhoe Park Colchester, CO4 3SQ Essex, Uk email: emrosa@essex.ac.uk tel: +44-01206-87311