|
Stephen Hewitt wrote: I was going to but I was too lazy
Nah generally you are not, you helped me a lot in the ATL forum
thanks
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
I think you want to display the current time in a EditBox
Use SetTimer to Set a Timer preferable in OnInitDialog
SetTimer(2500,1000,NULL);
this is fire WM_TIMER every second
Use ClassWizard to handle WM_TIMER message
.....::OnTimer(UINT nIDEvent)<br />
{<br />
<br />
CDialog::OnTimer(nIdEvent);<br />
}
This is probably not the best way (cause of the delays) but will work
Hope it helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
WonderFull!!!!
it is working.
Thanks a lot.
Helping others satisfies you...
|
|
|
|
|
Hi to All,
Can anybody explain what is a Simulator. What is the purpose of it. How to create it in VC++. Is there any relation between Service and a simulator. please help me in this regard.
Thanks
|
|
|
|
|
|
Dont ask plain when you talk about simulators. it has a *wide* meaning. In what context you wanna know about simulator?? a Mobile device??
VuNic
|
|
|
|
|
I dont even know that. When i start my system two simulators called Clinical and NonClinical are getting activated. (I guessed that)With that only I am able to get data for Clinical and Non clinical data.
|
|
|
|
|
Hello snprani,
A simple meaning of simulator is virtual world.
In simulater you can create a real environment effect virtualy.
It is use for testing of device, Training & many more places.
Divyang Mithaiwala
System Engineer & Software Developer
|
|
|
|
|
Hi,
under VC6 in a SDI project i want to have the question label (for context help) in the caption bar (in neighbourhood to min/max/close-Button) *but* in the main program window (not in normal dialog boxes .. that's easy). I tried much code with ModifyStyleEx() but nothing worked. Is it possible without writing complete new classes? Has anyone a sugguestion for a simple solution???
Thanx!!!
Greetings from good old germany ... from Frank
|
|
|
|
|
The WS_EX_CONTEXTHELP extended window style is not compatible with the WS_MINIMIZEBOX or WS_MAXIMIZEBOX styles. The context help icon isn't displayed on the caption as long as one or both of the minimize or maximize boxes is displayed. The same thing happens with dialog boxes using the DS_CONTEXTHELP and the WS_MINIMIZEBOX or WS_MAXIMIZEBOX styles.
Note that the window must have the WS_SYSMENU style.
Nibu thomas
Software Developer
|
|
|
|
|
Make sure the windows has the WS_EX_CONTEXTHELP style. This is an extended style. If you use ModifyStyleEx you may need to add code as follows to make the change take effect:
SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED);
Steve
|
|
|
|
|
Hi Stephen,
thanx for that, but can you tell me in which module in the SDI project i have to place this code?
Frank
|
|
|
|
|
No, sorry - I'm not even sure it will work.
Steve
|
|
|
|
|
Inside OnCreate
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
....
ModifyStyle(WS_MINIMIZEBOX|WS_MAXIMIZEBOX, WS_SYSMENU);
ModifyStyleEx(0,WS_EX_CONTEXTHELP, 0);
...
}
Nibu thomas
Software Developer
|
|
|
|
|
... ahhh, it works ... great!
Thanx for that hint!
|
|
|
|
|
Hello gurus,
I'd like to know how I can programmatically play an old Fast Tracker 2 XM module? Thus, where can I find a set of source code that shows how to play these files without DLLs or LIBs...
Thanks for the help.
Best regards.
Fred.
There is no spoon.
|
|
|
|
|
(I'm not good at english.Please guess!)
I dont know how to use accelerator in a dialog application
Can you show me some code to do that or send me a simple application.
Thank!!!
(kflrei@yahoo.com)
-- modified at 5:56 Thursday 9th March, 2006
|
|
|
|
|
Declare a member variable of type HACCEL
HACCEL m_hAccelerators; Inside OnInitDialog
m_hAccelerators = ::LoadAccelerators(AfxGetResourceHandle(), MAKEINTRESOURCE(IDR_MYACCELERATORS));
now inside PreTranslateMessage function...
BOOL CAccelTestDlg::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message >= WM_KEYFIRST && pMsg->message <= WM_KEYLAST )
{
return TranslateAccelerator ( m_hWnd, m_hAccelerators, pMsg );
}
else
return CDialog::PreTranslateMessage(pMsg);
}
Nibu thomas
Software Developer
|
|
|
|
|
Hi again
i get so much feedback from u guys so many good advices so i decided to ask again
Something simple again.
I want to work with strings for my first time
what i have is a queue of characters and i want to copy one by one in a string. Do i loose the spaces when i copy the contex of the oueue list into a string?
Code:
#include string.h
using namespace std;
queue<char> PlainText;
string Plain_Text;
while (!PlainText.empty())
{
Plain_Text+=PlainText.front();
PlainText.pop();
}
printf ("%s", Plain_Text);
I get no output and the console crashes as well!!
i have no idea if this is any close to correct is definetly not good programming i know and i apologize that u have to see this
But do you have any advices to give
Thanks in advance
|
|
|
|
|
what is the error message ?
where doest it crash ?
have you used the debugger ?
have you considered using iterators ?
|
|
|
|
|
Thanks for the reply V2.0
i don't know exactly i compile no errors then i press run the console opens i get no output and then a meesage from microsoft "Program has encoutered a problem and needs to close send report?
i no is silly but i'm not familiar with the debuger i don't know how to use it effectively but i press debug-> go i get Unhandled exception in otinane.exe 0xC0000005:Access violation then i get a bunch of memory addresses(i think) that is no way for me to understand
I know i'm not helping here but thats all i can give u
Thanks again
|
|
|
|
|
antonaras_marcou wrote: the debuger i don't know how to use it effectively
set a breakpoint when you want the program to pause while executing to let you debug (F9).
then, use the Watch view to see your variables contents (or hover the variable in the code), and use the "Step-by-step" toolbar buttons to go next code line...
|
|
|
|
|
Thanks again V2.0
I used the debuger thanks to u i set the breakpoint where i assign my values to the string and i see the characters getting in memory one by one that's a cool tool
very helpful thanks.
I'm not sure if u read the rest of the replies i used printf("%s",Plain_Text.c_str());
and it works fine.
one more question v2.0 what are iterators? (u mentioned them in ur first reply)
|
|
|
|
|
iterators are STL classes that allow you to iterate through the linked-lists items.
for instance :
std::string strText;
std::vector<std::string> PlainText;
std::vector<std::string>::iterator iterStrings;
for (iterStrings = PlainText.begin();
iterStrings != PlainText.end();
iterStrings++) {
strText += *iterStrings;
}
-- modified at 6:32 Thursday 9th March, 2006
|
|
|
|
|
Thanks v2.0 this looks helpful for my project i'll try to use it because u have some points in that example that will make my life much easier
Thanks a lot appriciate the help talk to u again on the next post
Thanks again
|
|
|
|