|
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)
|
|
|
|
|
Use any icon creation programs like
Axialis Ax-Icons
Awicons
MicroAngelo
Awicons is my favorite.
Sorry all are shareware. But 30 days is enough for creating an icon.
Hari Krishnan
|
|
|
|
|
DanYELL wrote:
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?
Perhaps by reading up on, and downloading code for, high quality scaling? Google is your friend.
Give a man his food and he'll be back tomorrow for more. Teach him how to fish and he's self-sustained.
|
|
|
|
|
I need to make program, that will open given video file in any
format for which the system has installed codec.
All I need to do is getting the movie length in seconds.
How to do this in most simple way ?
I don't know anything about direct show, and I won't study
whole the thing because I don't need more than getting
movie length.
Does anyone have piece of code for this, or idea where to
start ?
Thank you
rrrado
|
|
|
|
|
Hi There!
Probably the best (quickest) way to do this is using the IMediaDet interface in DirectShow.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/htm/usingthemediadetector.asp
This article talks about retrieving all sorts of information from a media file - assuming that the codec is installed on the machine we should be able to work out the stream time. Perhaps someone else has some code which will do this straight away for you.
Good Luck!
|
|
|
|
|
Hi,
I have an application which contains a lot of OCXs. The Problem is that an OCX is loading twice. How can I prevent that an OCX or a Dll is loading more then once?
Any idea?
thanks,
Walter
|
|
|
|
|
This is one of those problems that demands lateral thinking. The OCX is being loaded twice,
because it is being *asked* to...
The solution depends on *why* you want to prevent it from loading twice. You could let it
load multiple times, but only on the first instance let any calls succeed.
Or you could go the brute force way, and set DllMain to return FALSE when being attached to
by a second process. How you detect this is another question. Involving shared segment, or
memory mapped files, etc.
Iain.
|
|
|
|
|
Hi Iain,
Thanks for your answer.
The same OCX is loaded twice in the same process.
I detected it in the Developer Studio->Debuger->Modules…
How can I ask/prvent an OCX to load twice?
We have a Framework, I think the Framework call the OCX twice but I don't know why
If the same OCX is loading twice in the same process, I have a problem with the “AFX_MANAGE_STATE(AfxGetStaticModuleState( ))” because it gets a different address for the same OCX.
What can I do to have only an OCX in the process?
Tanks a lot
Walter
|
|
|
|
|
... you know - the dialog box that come up when runtime calls abort ? DrWatson doesn't dump anything. Is there some kind of try-catch thing I can put somewhere? I can not use debug build and/or debuger - it's at clients site
Urgent... Please help!
|
|
|
|
|
Hi,
I have a tapi application which drives the voice modem. After dialing I would like to get an indication whether the call was connected (LINE_CALLSTATE with param1 equals LINECALLSTATE_CONNECTED) or if the call was disconnected and why (for example line is busy).
I do know how to use the messages that are generated and sent to my callback function.
I dial the number using lineMakeCall. The last parameter for this function is the CALLPARAMS. Whenever I set the dwMediaMode of the CALLPARAMS to LINEMEDIAMODE_DATAMODEM I get an indication for why the call got disconnected (in case of an error) but I never get an indication that the call is connected (if no error occurred). When I change it to LINEMEDIAMODE_INTERACTIVEVOICE I get the other way around (only success indication).
Any idea how I can get both notifications?
thanks,
Liat.
|
|
|
|
|
Here's what my code section is:
"mailto:abc@abc.com?Body=WHATever..."
Result in Outlook 2000 and 98:
Body --> WHATever
Result in Outlook 97:
Body --> whatever
Anyone please let me know why Outlook 97 convert letters from upper case to lower case? Is mailto only work for Outlook 98 and after?
|
|
|
|
|
This question belongs in the Web Development forum, as it is nothing to do with Visual C++...
Repeat offenders suffer the WRATH OF !
That said, you might want to try enclosing your BODY in quotes. Or just use lower case the
whole time, in which case you won't care!
Iain.
|
|
|
|
|
Iain Clarke wrote:
Or just use lower case the whole time, in which case you won't care!
That's really helpful...
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:
That's really helpful...
I try, I really do!
Enough work, it's time to go to the pub and have a now...
Iain.
|
|
|
|
|