|
Hello,
I have this piece of code which i am using in my application developed on VS2003. i have migrated the code to VS2005 and have cleaned the code, but now i have to port it to Vista.
The code uses SHFILEOPSTRUCT and SHFileOperation which are nwo deprecated and a new interface IFileOperation has been introduced for Vista. I did a lot of head banging but still i could not figure out how to modify my code except the use of SetOperationFlag() function of IFileInterface. So please see if you could help.
Here are the snippets
<br />
SHFILEOPSTRUCT shfileop;<br />
<br />
shfileop.hwnd = NULL;<br />
<br />
shfileop.wFunc = FO_DELETE;<br />
<br />
shfileop.pFrom = pstrfrom;<br />
<br />
shfileop.pTo = NULL;<br />
<br />
shfileop.fFlags = FOF_NOCONFIRMATION;<br />
<br />
shfileop.fAnyOperationsAborted = 0;<br />
<br />
shfileop.hNameMappings = 0;<br />
<br />
shfileop.lpszProgressTitle = 0;<br />
<br />
SHFileOperation(&shfileop);
I get the pFrom and pTo from LPCTSTR type strings. I would also like to know about the double null termination of strings.
Thanks and regards,
Mustanseer
|
|
|
|
|
SHFileOperation is deprecated, not removed. Deprecation simply means that they have added a new method which they advise is used in future, and that they might remove the old way in future operating systems. However, IFileOperation is not available before Windows Vista which means that if you need to support older operating systems, SHFileOperation is the best choice.
The double null-termination is because SHFileOperation can work on a queue of items, not just a single item. Each item is a normal null-delimited string, and the queue is represented by all the item strings concatenated together. The end of the list is marked by an empty string, i.e. a single null character. To remove a single item, therefore, you pass the string (null-terminated) followed by another null, so it appears to be double-null-terminated.
Example: you want to delete items Item 1 and Item 2. Therefore you specify the string
Item 1<NUL>Item 2<NUL><NUL> I have to admit, I can't see how you get hold of an IFileOperation pointer. They seem to have forgotten to document that.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hi Mike,
I agree SHFileOperation is deprecated but i wish to replace it with Vista compatible interface. the new version of my application is concerned only with running on Vista and later versions. i have got the idea of how to modify the code for copying, moving etc. but pertaining to deletion i am yet unenlightened.
Also, there is one more problem that i am facing. The new IFileOperation interface is placed in an Interface Definition Language file named "ShObjIdl.idl". i don't know how to import this file into my program to support the interface.
This is where i relate to you that how to get hold of the IFileOperation pointer.
PS: I am running my code on Vista currently and trying to debug.
Thanks and regards
Mustanseer
|
|
|
|
|
what is the use of PDB files on dotnet. i am developing a profiling application
shall i use the pdb file to point the exact code?
My small attempt...
|
|
|
|
|
|
as i said i am developing a profiling application.
in that i want to display the exact code using the pdb.
My small attempt...
|
|
|
|
|
Sorry about that, I guess I read too fast. I think the pdb won't do what you need though. The pdb file is basically used by the debugger to attach/link to its corresponding application. In the case of profiling, I've read before that .Net has a Profiling API.
|
|
|
|
|
i just used that, but in the case of user defined methods i want to point out the exact code
suppose i have a method "SayHello()" in my app, after profiling that will show
classname SayHello() 0.0000002(sec)
This is done successfully, now i want to display the exact code inside the method "SayHello{}"
My small attempt...
|
|
|
|
|
As the code is run from IL, you can reverse it back into a version of the original (in the same way that Reflector does).
|
|
|
|
|
assemblin and disassemblin i already did.
as i said now i want to diplay the exact code.
Can we use PDB for that? to display the code
My small attempt...
|
|
|
|
|
Yes the PDB file is the mapping between the IL code and the source file.
|
|
|
|
|
Yes, you can use the pdb file. The magic word here is the ISymbolReader.
See this discussion here[^]
|
|
|
|
|
if i am having the source code file with me, can i display the source code using the line info from pdb?
how can i do that?
My small attempt...
|
|
|
|
|
I guess you can do that, at least the article I linked in does mention it.
You'll have to do the research, but since you writing a profiling app that shouldn't be so hard for you.
Most of the time you'll get directions here, not complete solutions.
|
|
|
|
|
i know i know anyway i will continue the same will post if i get any info
My small attempt...
|
|
|
|
|
I just delete them.
|
|
|
|
|
no problem it will generate when you start the app from IDE
My small attempt...
|
|
|
|
|
As you see, whenever installing an new software, you must have a license number to register your application.
Now, i have assigned to do that license part in my task but i don't know how to generate a license num or how to make a license checker professionally (in C#). So, anybody can help me this?
|
|
|
|
|
Well, no-one is going to tell you how they make THEIR license keys, b/c that would let you generate your own. There's all sorts of ways to do it, the simplest is probably a variation on hashing the username, perhaps salting it first.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi all experts,
as i'm new to this, can someone plz advice me?
my project requirements:
1. images upload with adding texts/descriptions attached to it (save it in notepad/html??) using microformats (not too sure also as need details from lecturer)
2. search images via information in the notepad/html saved to the images
3. display searched results images
should i use C#, VB, C++ for this project? as i want to start on the right path... can someone plz refer to any guide?
i've found this:
http://www.codeproject.com/KB/aspnet/netimageupload.aspx
is this the right on to start on? so i can add on later...
please help thanks a million.. waiting on your reply!!
my email/MSN : narmon@gmail.com
plz help
|
|
|
|
|
I think that article's a good start. Though I don't think you'll be using C++. You can choose between C# and VB.Net, whatever you're comfortable with.
|
|
|
|
|
Wow - you cross posted teh whole site. How rude....
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
"as i'm new to this, can someone plz advice me?"
Not really relevevant to the specific question, but:
1.) You have a "Shift" key - Don't be afraid of it (Seeing as the only capitals are C#, VB, C++, KB, MSN)
2.) Encrypt your given e-mail address. People can Phish it. Change to something like 5narmon5@gmail.com - And ask people to remove the 5's. (If they DESPERATELY want to e-mail you, they can use your Profile )
Hey - It's a start
-= Reelix =-
|
|
|
|
|
Is there something in WPF which would be an equivalent of CustomLineCap in GDI+? How do I implement a custom line ending in WPF? Thanks!
|
|
|
|
|
Not much WPF traffic here, but what there is, is mostly in the WPF forum.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|