|
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
|
|
|
|
|
STL containers are very powerful and can be very useful when one know how to use them.
unfortunately, they are sometimes hard to start with, and they frighten the beginners...
if you have time to learn at stl containers, it will always be a personal investment.
|
|
|
|
|
This will not work - std::queue doesn't have any iterators. I posted a similarly flawed example before I realized (so I deleted it)
Steve
|
|
|
|
|
didn't know that...
i changed it into vectors
thanks for the info
|
|
|
|
|
Should be #include <string> not #include <string.h> - STL header files don't end in ".h". Another issue is the printf ("%s", Plain_Text); . If you must use printf it should look like this: printf ("%s", Plain_Text.c_str()); . But using printf is a bad idea. Instead do this: cout << Plain_Text; . You may need to add an #include <iostream> for cout .
Steve
|
|
|
|
|
Hey Stephen Hewitt you are right:: printf ("%s", Plain_Text.c_str()); with include <string> works fine thanks
but cout<<plain_text gives="" error="" in="" compiling
the="" error:::
c:\documents="" and="" settings\antonis\my="" documents\parser\otinane.cpp(80)="" :="" c2679:="" binary="" '<<'="" no="" operator="" defined="" which="" takes="" a="" right-hand="" operand="" of="" type="" 'class="" std::basic_string<char,struct="" std::char_traits<char="">,class std::allocator<char> >'
(or there is no acceptable conversion)
I thought i was allowed to cout<< strings because i see it everywhere used
any ideas why i get error?
Thanks again for solving my problem
|
|
|
|
|
Have you included <iostream> ? Get rid of any ".h" CRT headers you're including. printf isn't type safe, as you've found the hard way - God knows how much wasted time has been spent in the programming world tracking down obscure bugs caused by, for example, a mismatch in the format string and the parameters.
Steve
|
|
|
|
|
God u are so right again i have to loose the .h from the include
Thanks man ur the best.
I wonder why they teach us wrong things in college u should become a teacher
thanks
so u sugest i use cout instead of prinf?
|
|
|
|