|
In that case, it will be much easier to subclass them and override OnActivate() and make it do nothing. It will also be a lot nicer to the system
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Coming from a Turbo Pascal / Turbo C++ background, I miss the good 'ole days of having complete control over a console screen using the conio.h libraries.
I have discovered that I can mimic certain functions using the platform SDK (changing colours etc), but does anyone know of where I can get some more information on using these functions more effectively? Or even if there are any (free) libraries that are compatible with VS6 that I can use.
I have tried a search on CP, but to no avail.
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
Are you talking about the console functions?
|
|
|
|
|
DavidCrow wrote:
Are you talking about the console functions?
I am.
But specifically all those very useful functions that were available, like GotoXY(), ClrScr(), etc.
I'm asking for some sort of document that explains, at least, how to achieve the equilavent results.
The MSDN documentation on the console functions, personally, does not have enough practical examples and usage.
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
The equivalent of GotoXY() would most likely be SetConsoleCursorPosition(). Clearing the screen can be done with FillConsoleOutputCharacter().
|
|
|
|
|
Have a look a Mike Dunn's C++ FAQ which answers these questions and more.
http://www.codeproject.org/cpp/cppforumfaq.asp#cons_gotoxy[^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Ah Ha!!!
That's what I needed.
I knew I was a dumbass, but I never bothered to comfirm it.
Cheers.
"..Even my comments have bugs!"
Inspired by Toni78
|
|
|
|
|
Hi !
In my MDI app with A CSCrollview, I handle the SETCURSOR message to get the cursor changed. However, I'd like to have the normal arrow back when the user wants to use the scrollbar (that is, the cursor should take its original shape when it is hovering the scrollbar, and take my custom shape everywhere else in the scrollview).
What's the best way to achieve that ?
~RaGE();
|
|
|
|
|
BOOL CMyView::OnSetCursor(CWnd *pWnd, UINT nHitTest, UINT message)
{
if(nHitTest == HTCLIENT)
else
return CScrollView::OnSetCursor(pWnd, nHitTest, message);
}
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Great ! Thanks !
~RaGE();
|
|
|
|
|
You're welcome
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
I wanted to convert my MDI app to SDI without having to start a new project. Is this possible for me to do without having to restart my project over and using app wizard?
thanks in advance.
|
|
|
|
|
Not without a lot of work (from my experience). By far, the easiest way is to create a "blank" SDI project and copy the necessary files over. You'll still have to tweak a few of the files, but it will be minimal.
|
|
|
|
|
I use lfCharSet can retrieve the character set, but I want to know the range of Unicode.
I want to know the relation between Unicode and the following?
#define ANSI_CHARSET 0
#define DEFAULT_CHARSET 1
#define SYMBOL_CHARSET 2
#define SHIFTJIS_CHARSET 128
#define HANGEUL_CHARSET 129
#define HANGUL_CHARSET 129
#define GB2312_CHARSET 134
#define CHINESEBIG5_CHARSET 136
#define OEM_CHARSET 255
|
|
|
|
|
Alice80 wrote:
...I want to know the range of Unicode.
It can handle 65,536 character combinations rather than just 256.
Alice80 wrote:
I want to know the relation between Unicode and the following?
I'm not sure what you are asking here. Unicode, also known as DBCS, uses two bytes for each character rather than one.
|
|
|
|
|
I want to know a font's character set and I want to know the character set position in unicode.
|
|
|
|
|
Perhaps you are looking for GetTextMetrics() and GetFontUnicodeRanges().
|
|
|
|
|
Hi
i have a CString which contains positive and negative numbers
im trying to loop through the string to extract each set of
numbers
mystring = "-21212,23123,4455656,-8484848,938383";
however, i keep losing my place in the list,
i need some way of indexing my string so i can loop through it
does ne1 have any ideas, cos this sending me mad
thanks
si
|
|
|
|
|
Hum, this can be done using the strtok function (take a look at the doc). But this works with char* and not CString.
Here is an example:
char szString[255];<br />
strcpy(szString,mystring.GetBuffer(254));<br />
<br />
char* token = strtok(szString,",");<br />
while(token)<br />
{<br />
int Value = atoi(token);<br />
token = strtok(NULL,",");<br />
}
And store Value in a table !
Hope this helps!
|
|
|
|
|
Yep, but I'd make a couple of modifications. Use _tcstok() so it supports unicode as well, replace char with TCHAR , and you don't need to call GetBuffer() on the string.
TCHAR szString[255];
_tcscpy(szString,(LPCTSTR)mystring);
TCHAR* token = _tcstok(szString,_T(","));
while(token)
{
int Value = _ttoi(token);
token = _tcstok(NULL,_T(","));
} As long as the string is less than 254 characters long it will work nicely
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Yep! Nice idea
A better solution would to allocate dynamically the string (so retrieve the length of mystring). But this was just an example so it was not perfect !
|
|
|
|
|
cedric moonen wrote:
A better solution would to allocate dynamically the string (so retrieve the length of mystring).
Yeah, but I just thought of an even better way! Let CString do the dirty work for you
CString str = mystring;
TCHAR* token = _tcstok(str.GetBuffer(), _T(","));
while(token)
{
int Value = _ttoi(token);
token = _tcstok(NULL, _T(","));
}
str.ReleaseBuffer();
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hhhmm, yep, but don't forget that _tcstok will modify the contains of the string !
|
|
|
|
|
cedric moonen wrote:
Hhhmm, yep, but don't forget that _tcstok will modify the contains of the string !
Yeah, which is why I made a copy of it first
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I think I'm tired !
|
|
|
|