|
CDotNetTabCtrl ....
http://www.codeproject.com/wtl/TabbingFramework.asp
Seems like MDI tab sample:
http://www.codeproject.com/tabctrl/mditabs.asp
Just don't want to waste time converting XP UI
|
|
|
|
|
Hi, is there a simple way to program complex equations in MFC AppWizard(exe)??? For the equation z = z^2 + c, where 'z' and 'c' is (r + i), I was able to program it like this:
//r2 and i2 the user gives the values for
//r and i are the 'x' and 'y' values on the complex plain
//r5 and i5 is the final 'z' value
r3 = (r2 * r2) + (-(i2 * i2));
i3 = (i2 * r2) + (i2 * r2);
r5 = r3 + r;
i5 = i3 + i;
r2 = r5;
i2 = i5;
I need the final answer in complex form (r + i) so I may be able to put those values back into the equation as 'r2' and 'i2'... I want a simpler way to do this so I can use bigger equations like:
z = ((z^5 + c)/(z^3 + z^2 + z + 1)) + sin(z)
Thanks...
|
|
|
|
|
Use the Standard C++ complex class.
#include <complex>
std::complex<double> z, c;
z = std::pow(z, 2) + c;
|
|
|
|
|
How would I get the 'r' and 'i' values from the 'z'???
|
|
|
|
|
How would I get the Real and Imaginary values from the 'z'???
|
|
|
|
|
double real, imag;
complex cplx;
T = complex(1.0, 2.0)
real = cplx.real();
imag = cplx.imag();
|
|
|
|
|
It gives me an error saying 'complex' is "undeclared identifier"...
What I need to do after I got 'z' is this:
Final = abs(pow(pow(z[REAL PART], 2) + pow(z[IMAGINARY PART], 2), 0.5));
'double Final' is a single value...
Thanks...
|
|
|
|
|
#include <complex>
using namespace std;
double final;
complex<double> z(1.0, 2.0);
final = abs(z);
pow(x, 0.5) is the same as sqrt(x) .
abs(z) where z is a complex number calculates the same value as your formula.
|
|
|
|
|
When I do the calculations this way:
z = (2, 3);
c = (-4, -5);
z = std::pow(z, 2) + c;
Final = abs(sqrt(pow(z.real(), 2) + pow(z.imag(), 2)));
I get a different answer than this:
r2 = 2; i2 = 3;
r = -4; i = -5;
r3 = (r2 * r2) + (-(i2 * i2));
i3 = (i2 * r2) + (i2 * r2);
r5 = r3 + r;
i5 = i3 + i;
r2 = r5;
i2 = i5;
Final = abs(pow(pow(r5, 2) + pow(i5, 2), 0.5));
The second way seems to give me the correct answer... Thanks...
|
|
|
|
|
Nevermind, I figured it out... I had "complex<double> z = (2, 3);" instead of "complex<double> z(2, 3);"...
|
|
|
|
|
When a modal dialog box is closed using EndDialog does it's parent window recieve a message to notify it that the dialog has closed? I want to update some info in my status bar as soon as the dialog is closed.
Thanks in advance,
Paddy
|
|
|
|
|
|
Thanks for the help. It's non-MFC I'm using. Does this mean that my main window can't do anything until EndDialog is called?
Paddy
|
|
|
|
|
|
What am I doing wrong? I want to read the names from a file and put them onto a vector of char*......it crashes at the pushback. Each file name is on a different line.
I did a dir/b in dos and got a txt file with a list of file names (a bunch of .bmps) from the directory. I assume theres carriage returns at the end of each line. But maybe not. There are 18 letters in the name08FEB096_9571s.bmp , and carriage return line feed is 1 byte (MSDN).
CFile file;
std::vector<char*> fileVec;
file.Open("c:\\miss\\SImages.txt", CFile::modeRead, 0);
char* pBuf;
char folder[200];
strcpy(folder , "C:\\miss\\");
for (int i = 0; i <96; i++)
{
pBuf = new char[200];
file.Read( pBuf,20);
strcat(folder, pBuf);
fileVec.push_back(folder);
delete[] pBuf;
}
file.Close();
|
|
|
|
|
looks like the board ate some of your code. how is your vector defined? (what is it a vector of?)
-c
WWT2D?
|
|
|
|
|
It was avector of CString. However my problem was that I was using CFile when CStdioFile was more suitable and I had overwritten some buffers, but the poor vector got blamed....
Thanks.
|
|
|
|
|
CFile file;
change std::vector fileVec;
to std::vector<string> fileVec;
Move strcpy(folder,"c:\\miss\\");
to For Statement
for (int i = 0; i <96; i++) {
strcpy(folder , "C:\\miss\\");
pBuf = new char[200];
file.Read( pBuf,20);
strcat(folder, pBuf);
fileVec.push_back(folder);
delete[] pBuf;
}
Learning and Working
|
|
|
|
|
Nobody explained the reason for the crash...Without the unimportant stuff, here is what the code looks like. Do you see the problem?
char folder[200];
strcpy(folder , "C:\\miss\\");
for (int i = 0; i <96; i++)
{
...
strcat(folder, pBuf);
...
}
|
|
|
|
|
Yup. I saw finally....my poor "folder" variable was getting concatenated way beyond its allocated space...
Thanks
Appreciate your help,
ns
|
|
|
|
|
I have a file with several lines of text (all end with a carriage return). I want to use my CFile object to read these strings into an array of pointers to char. I dont see a anything like GetLine()....if I dont know the length of the text on the line, I dont have a value to give Read() as a count of chracters...
Actually I'm push_backing the strings onto a vector...
|
|
|
|
|
|
That is working out......many thanks.
|
|
|
|
|
Hi,
I got a DLL (not MFC) with some functions in it. The header file containing the declaration for the functions of the DLL is also available.
Is there a way to call these functions in a static way other than using LoadLibrary and GetProcAddress ?
Thanks
|
|
|
|
|
yes, include the header file:
#include "MyDllBase.h"
and link the project with the output .LIB file for the DLL
under project settings->linker->input, add "MyDllBase.lib"
- Roman -
|
|
|
|