|
sure its advanced - but using the MsgConnect tool & similar idea you could scale it down a bit - its a great concept
'G'
|
|
|
|
|
sorry for this simple question, but how can I get my color printer to print in the same color as my VC++ 6.0 IDE display? - yes, I do have colour selected.
I have comments in Green, keywords in Blue, ... I would like my printed pages to display the same colours.
Thanks for helping me with this.
Johnny
|
|
|
|
|
My suggestion. (Might not work)
Copy your codes from your IDE to any word processor that support RTF at least and print it there.
If you could view the font as colored in other word processor and still your printer could not print. It is definitely your printer problem. Either software or hardware problem (running out of ink)
|
|
|
|
|
I posted this in the VS Ide area, but I don't think many people get over there. Does anyone have any ideas?
I have a problem with vs.net 03. I noticed a great slow down of c++ projects. I can type and be 10 to an upwards of 20 chars ahead before seeing them on the screen. Intellisense is also slow in showing. This just happed reciently. I did a defrag of my hard drive and then noticed this. C# projects work fine. Anyone seen this or know how to fix it?
Also, is there a way to fix c++ intellisense to not have to use the mouse? In C# after hitting a . and having intellisense popup, the first item is selected. I can push a letter or the up and down arrows and have it select different items. In C++ if I touch the keyboard, it disapears. I have to use the mouse to scroll and select something. It's a pain.
TIA
|
|
|
|
|
i need to sort an object of type std::list
i have something like this:
(.h)
struct _Selected
{
_decimal ent;
_decimal docNum;
}Selected;
typedef list<_Selected, allocator<_Selected> > LISTSTR;
LISTSTR arrSelected;
and i need to sort 'arrSelected'
how can i do this?
thanks
Nuno Henrique Mendes
|
|
|
|
|
NHM wrote:
and i need to sort 'arrSelected'
how can i do this?
std::sort? Did you even *read* the documentation before asking?
|
|
|
|
|
Mike Nordell wrote:
std::sort? Did you even *read* the documentation before asking?
Ehm.
Documentation[^] states that you need a Random access iterator[^] to use std::sort, and std::list::iterator is a Bidirectional iterator[^]
Anyway, his problem is that he has no < operator defined for his struct, which is easy enough to fix. Then he can use std::list::sort
|
|
|
|
|
Mike Nordell wrote:
std::sort? Did you even *read* the documentation before asking?
Nemanja Trifunovic pitched in:
Ehm.
Documentation states that you need a Random access iterator to use std::sort ...
*slap* (that was the sound of one hand clapping). OK, I'm a moron. I stand corrected and bow my head in shame.
|
|
|
|
|
Hi,
I try to use the DumpElements function to dump specific information from a CMap. If I define the Dump function has follow:
template <> void AFXAPI DumpElements<cstring> (CDumpContext& dc, const CString* pElements, INT_PTR nCount)
{
… do something
}
I get a linker error (LNK2005) that this function is already defined in a other obj. The only thing defined in this obj is a other CMap of CStrig.
Is there any sample available on you to properly use this function?
Thank you
Sascha Schantz
|
|
|
|
|
Hi,
I'm overriding PreTranslateMessage() for my CView-derived class because I want to detect when the user presses ctrl-z (undo). I know that pMsg->wParam has the key code, but how can I check if the ctrl key is also pressed? On a sidenote, why can't I get ctrl-z in the OnKeyDown() of a CView? I already removed ctrl-z from my accelerator table but I still cannot get ctrl-z to show up in OnKeyDown(). Thanks for all hints!
cheers,
roel
|
|
|
|
|
You do not have to use PreTranslateMessage for this. You can your view's OnKeyDown message handler. Use GetKeyState(VK_CONTROL) to check the status of the control keys.
if ((nChar == 'z' || nChar == 'Z') && GetKeyState(VK_CONTROL) & 0x80))
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Myself I'd use an accellerator for CTRL+Z that mapped to UNDO.
|
|
|
|
|
Mike Nordell wrote:
Myself I'd use an accellerator for CTRL+Z that mapped to UNDO.
I would to, but roel said he(she?) removed the accelerator. He must have done that for a reason?
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
'He', thank you very much
I did it because the CView is in a library that I'd like to keep as separate as possible from the application it is going to be used in.
Anyway, the problem turned out to be that I tried to use nFlags in OnKeyDown to determine the state of the Ctrl key - for some reason I thought that nFlags & VK_CONTROL was supposed to give me the state. GetKeyState() was the solution! Thanks to both of you.
cheers,
roel
|
|
|
|
|
I try to place a file into the clipboard so I can later paste them in Explorer. I can place text, bitmap etc, but how can I place a file into the clipboard?
Thanks
|
|
|
|
|
Perhaps you should examine what the clipboard contains after you select "Copy" on a file from the explorer? Preferrably before asking.
|
|
|
|
|
I am trying to optimize the inner loop of an interpreter, and looking at the generated machine code I notice that the compiler always writes a local variable back to the stack frame after it has been modified, even though the variable is held in the same register throughout the entire loop & its lifetime. Sometimes it randomly loads it from the stack as well, even though it was already in the same register just before, and no control flow is present in between.
The variable is not static/volatile, is not aliased (its address is never taken), and its register is never used for other purposes in the generated code. I have all optimisations on max and even have /Oa on. Using vs.net.
How do I stop the superfluous flushing/loading from happening?
|
|
|
|
|
You could use the register keyword, but I'm not sure if the compiler honours that any more. If you optimise for speed, it should use only the register anyway.
Use the /Oe option to optimise register-allocation, and the compiler should be able to sort this out.
If neither of these work, either you can write the algorithm in assembly, use a different compiler, or just accept it
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"
|
|
|
|
|
Ryan Binns wrote:
You could use the register keyword,
Or you could read the documentation that states the register keyword is disregarded. The choice is yours, but knowing this compiler I think you'd be wrong to not trust the documentation.
|
|
|
|
|
Did you only read the first half of the sentence? Just wondering...
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"
|
|
|
|
|
The register keyword is indeed useless.
/Oe doesn't help either, the optimisation I am looking at is all inside a single function (a local variable).
I don't want to write it in assembly, it has to be portable across a great many architectures, of which x86 happens to be the most important one. I am just attempting to write C++ that doesn't stop msvc from making important optimisations.
|
|
|
|
|
Aardappel wrote:
How do I stop the superfluous flushing/loading from happening?
You don't.
No, really. When the compiler wants one thing and you want another, the compiler *always* wins - I've been in this position too when it allocated regs like a drunk. I had to rewrite my code, using C++ and especially inlined templated functions (no matter how insane it seems, the basically 4 registers the compiler selects from had a profound difference) to get it to allocate and (not) flush regs where (not) needed.
Basically, when the compiler screws you, you have no voice - accept or rewrite.
One *can* of course fall back to ASM, but it suck when one have payed $$$ for an "optimizing" compiler that M$ had over a decade to "optimize", doesn't it. (btw, try to use the "intrinsic" versions of e.g. str* and mem* and you know what MS "quality" is...)
|
|
|
|
|
Yup, I am very much aware of this. But when it comes to optimisations, you can often help it by writing your code in a certain way. For example, if I had written &var of the variable somewhere, I would understand that it flushes the var everywhere: it can be accessed by an alias after all. But in my case, I never do anything like this. So I want to find out what code exactly confuses the compiler.
Would be good if the compiler had optimisation warnings
|
|
|
|
|
whoops, that was my reply, not Anonymous. I should get an account.
|
|
|
|
|
All my icons that are associated with a program look
so boring and plain. What really drives me nuts though
is that the icon in the upper left corner of the program
in Windows 98 or 2000 look okay, but the same program on
XP and the icon looks blurry.
How can I take a nice looking bitmap and make that into
a icon, rather than using that little 32x32 box that
Visual C++ forces the developer to create icons with?
There has to be a way since everyone else has a nice
looking icon associated with their software.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|