|
NewbieStats wrote:
Im still alittle Queued...
You need to first add an edit control (eg: IDC_MY_EDIT ) to your dialog template using the resource editor. Next, use the ClassWizard to add the m_myEditCtrl variable (category = Control).
Since you're new to VC++, you may want to refer to an introductory text to help you get going. Meanwhile, see this[^] link to see how to add controls to a dialog template.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
It looks like the forum ate one of my replies. In answer to your question about the Control toolbar, here's how to display it:
In VS2003, do View|Toolbox. In VC6, double-click the dialog in Resources tab, then right-click the workspace and select "Controls" from the popup menu.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanks! I still say this is the best forum ive seen =)
Im going to try and work with ur tutorials your site provides so i can minimize on these post on the forum for newbie questions hehe... Thanks for puttin up wit my illiterate beginnings of MFC... Ill come back here if any questions or if i finish what im working on for feedback! thanks!
Just a Human Trying to Live in a Computers World.
|
|
|
|
|
NewbieStats wrote:
Thanks for puttin up wit my illiterate beginnings of MFC...
No thanks needed. We're here to help. Good luck!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Why recommend sprintf ? What's wrong with stringstream or even CString.Format ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
It was the closest thing to printf() which he's familiar with. In my later post I recommended that he use CString::Format() .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
NewbieStats wrote:
I was wondering if there was a way to somehow get printf or cout working in Button01Dlg.cpp in order to apply variables?
No, those are for console-based applications.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi everyone,
I'm currently working on an FFT App which gets the Input about the Mic. Once the Mic Buffer is full the Function void void CWaveCtrl::Update(const Fft &FftTransformer) in my Static control is called. Now lets come to the problem. In the Function I can't call GetClientRect() or Invalidate(). I don't know if the problem only exists with those two Functions. This are the Functions i would need The Program always crashes with:
Debug Assertion Failed!
Program: ...\Visual Studio Projects\FFT\Debug\FFT.exe
File: f:\vs70builds\9466\vc\MFCATL\ship\atlmfc\include\afxwin2.inl
Line: 135
Please Help. I have no clue.
MFG
RedDragon2k
|
|
|
|
|
Trace it with single-stepping.
Don't try it, just do it!
|
|
|
|
|
I did and it just seems like the Functiun is unable to get the correct HWND.
I can't be more precioses because when i click retry to debug my system is vveeerrrryyyyy slow 'cause of the bug. But in the Locals Watcher i can see that GetClientRect(rect) return the right Rect Values. Here is the Complete Function:
void CWaveCtrl::Update(const Fft &FftTransformer)
{
CRect rect;
GetClientRect(rect);
int iMaxPoints = min(FftTransformer.Points(),FFT_POINTS * 8);
for(int i=0; i < iMaxPoints; i++)
{
int s = FftTransformer.Tape(i) / 512 + (rect.bottom - 1) / 2;
if (i >= rect.right)
{
Add( i, rect.right - 1, (rect.bottom - 1) / 2);
}
else
{
if ( s < 0 )
Add (i, i, 0);
else if (s >= rect.bottom)
Add (i, i, rect.bottom - 1);
else
Add (i, i, s);
}
}
}
|
|
|
|
|
I'm using this class in my UI thread (which has no dialog, so I needed to make a timer) so that I could fire off 3 different timers. I was wondering is I should wrap the postmessage as well as SetTimer and KillTimer as a critcal sections. My main app will be creating 3 threads that will be creating three timers. Would this help in making sure I did not step on another thread accessing TimerProc at the same time.
Here is the link to the class I'm using.
CWinTimerThread
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Would it hurt anything to give each thread its own timer function?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Well basically each thread is dirived from the CWinThreadTimer class. So it does have it's own timer function. I was under the understanding that the TimerProc used the same memory space regardless of what thread created it. is this not the case.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Just a suggestion, ignore me if I'm totally off base, but why not create a hidden window for the thread that will handle the WM_TIMER message? That way the window's message queue will take care of all those problems.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Good question. While at first i was attempting that, I figured it was more of a hassle dealing with a dialog that was modaless and modal.....blah blah blah. So it was easier too make a timer call....by the way this work great. I'm running three threads with each having 3 timers. That's 9 timers going, and it works great. I just want to make sure that then do not step on each other in memory.
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
In this case, there's no need for thread synchronization because there are multiple independent timers. However, synchronization is required if you were to share one timer in multiple threads.
Kuphryn
|
|
|
|
|
So each time I create a thread, I create a new TimerProc that has it's own memory space? So I should just do a critical section around the postmessage?
What happens if I have 200 threads that I'm creating, would I need to protect the TimerProc function then? Or would I have 600 individual TimerProcs?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
|
Hey people
OK, I'm sure a lot of you guys have seen or at least used Microsoft Money. Do any of you have any idea how they did the user interface? It's as if they're using some kind of HTML...but not :P (Does that make any sense :P?)
I'd like to hear any ideas as I'm trying to write a similar application in MFC.
Thanks for any help.
The earth's rotation is caused by penguins running around the south pole.
|
|
|
|
|
I wish i knew, I've often asked this question and the best i can come up with is alot of javascript and mfc htmlview stuff. It's a pretty nice interface, but i never did find an easy way to mimic it.
|
|
|
|
|
GUIs like this can be built using a CDHtmlDialog [^]. For guidelines on inductive user interfaces (like MS Money), see this[^] link.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
What does this declaration mean?
|
|
|
|
|
abc is a pointer to a pointer to a double .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
what about this :
double d1;
double* d2;
double** d3;
double* d4[];
...?????????
you don't have it ? ok, i'll help you, but you will have to study a bit more the C/C++ language.
double d1; declares d1 as a double. (easy, isn't it ?)
double* d2; declares d2 as a double*, that means pointer to double. this is the same as double *d2;,double*d2; and double * d2;
double** d3; declares d3 as a double** (i'm sure you start understanding), that means pointer to double*, that means in fact pointer to pointer to double. you have it now ?
more difficult, but quite the same as the previous one. Let's see this :
double* d4[]; declares d4 as an array of double*, and as you know, arrays are pointers to the first element. Such code declares so a pointer to pointer to double.
see you
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Using MFC for Print and Print Preview, i cannot get it to work with CDC::SelectClipRgn to print in just a specified region. Even Print Preview never clips the output correctly. How could this be? I cannot find any information that would say clipping isn't working in Print and Preview modes, but it's not!!!
Please help me!!!
|
|
|
|