|
I tried to play with it, but I get the error:
"Cannot move file: Cannot read from then source file or disk"
So i take it, that my C# app is not compatible with windows.... or... something... *tired*
Will try tomorrow, but I think i'm going down with a severe case of man flu (runny nose = imobalisation for weeks, fatigue, and a life saving labotamy)
Cheers
Cata
|
|
|
|
|
The_Catalyst wrote:
I tried to play with it, but I get the error:
"Cannot move file: Cannot read from then source file or disk"
Umm... maybe you don't have a "c:\test.txt"?* Or did you forget to make it be @"c:\test.txt" or "c:\\test.txt"?
*I always have a "c:\test.txt" because that's such a convenient test filename.
|
|
|
|
|
I guess it's as Heath says, this won't work for me.
Oh well... time to go the hard way
Cata
|
|
|
|
|
Well, there's a number of different things you can do, provided that you have control of the application it's dropped to. Whether you have that control or not, I would have to have more details about what the circumstances are - what's being dragged and dropped, and to where, etc.
|
|
|
|
|
He wants to use an IStream that is a COM object so that the shell understands it. The IDataObject interface in .NET is much different than the IDataObject that is defined in objidl.h. The internals of how the .NET version is "marshaled" to the COM version is hidden in the System.Windows.Forms assembly (if memory serves me correctly), and it does basically what I've been telling Cata to do.
To my knowledge and from experience, the above code only sends filenames so the shell copies or moves those filenames (based on the allowed action). This person wants to know what the drop target is and apparently wants to do something when the target starts accessing the file(s). The only good way I could think of - since there aren't any notification interfaces I could find (in all my research and development with COM over the last many years) - was to use a stream because Cata would then know when the target was attempting to access the files.
If there is a better way to get notification that the object has been dropped (like, before the targets starts accessing the data object), I'm all ears. I've been looking for a solution for a couple years to this specific problem - even googling for discussions or samples - and have never found a good solution.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Sorry, didn't see your reply to yourself (I just use the emails I get to jump right to the topic and yours was off the screen.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath, I've got a lot of things I want to do.
But yeah, i'd like to be able to drag an object from my listview, which will then produce the drag drop object from the data associated with the listview object that is dragged.
That is the simple part, as I can do it. But to get outside... there is where the real challenge is
I might even have to change the way I store the information in my program, which is a simple structure with Name, Type (File Extention), Data (the object). That's the thing i've packed up.
I'll look to basicaly write the object data to disk via the stream, and callit: <name>.<extention>
Then, when reversed, I can simply disect the file name back to my format, and drop the object data into my ObjectData object.
At least, that's the plan.
Cata
|
|
|
|
|
Hi,
How can I create from the outlook bar written in C++ by Dheth a control witch I can directly use in C#?
See: http://www.codeproject.com/miscctrl/outbar2.asp?target=outlook
Thanks in advance.
Gaby
|
|
|
|
|
Gaby,
I would suggest that you take a look at Marc Clifton's article: An Outlook Bar Implementation[^] written in C#, it is truely a great article from the ground up.
-Nick Parker
VB gets under people's skin because one can be ignorant of computer architecture and ASM and still
get a lot done. -Don Box
|
|
|
|
|
Hi,
Is there a simple way to print the current form to the default printer? I am working on a project for school and want to use a button on my form which does a "print screen"
|
|
|
|
|
Please search the comments for this forum. I just gave some advice to one person a few days ago about this. Basically, it's not very easy at all on C# but I gave some function reference that you should know and understand. The tips are there, but you have to figure out the solution. Besides, obviously, this is a homework question and we don't answer those in this - or any other - forum on CP. We'll give you tips and help if you're having a specific problem though.
It's just not right, and you won't learn anything by being given the answer.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I think there needs to be a message added to this board advising people to search the message board before posting and also trying msdn or google.
|
|
|
|
|
Suggestions should be posted here[^].
AK wrote:
I think there needs to be a message added to this board advising people to search the message board before posting and also trying msdn or google.
There is a saying: "You can lead a horse to water, but you can't make him drink."
You're assuming people will take the time to read it. For example, people still post programming questions in the Lounge even though there is a statement above the threads that indicates 'no programming questions'.
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
I dont know how basic this is but I am trying to create a file using a C# program.
Basicly I want a program that when you run it creates a text file that has on it a list of users.. Just like Console.WriteLine("Hello!") I want to put "Hello!" in a text file. Is this possible, if so -- please help Thanks alot
|
|
|
|
|
There are a myriad of different ways to write to a text file, take a look at the System.IO Namespace[^], in particular the TextWriter class if you are just starting out.
-Nick Parker
VB gets under people's skin because one can be ignorant of computer architecture and ASM and still
get a lot done. -Don Box
|
|
|
|
|
There are quite a few ways of creating files. Here's an easy one:
Using System.IO;<br />
<br />
string path = @"C:\MyTextFile.txt";<br />
StreamWriter writer = new StreamWriter(path, true);<br />
writer.WriteLine("Howdy!");<br />
writer.Close();
This appends text to the file if it already exists or creates a new one if it doesn't. There are many other options if you need more fine-grained control over the file's behavior. Check out the System.IO namespace for more info on them.
Charlie
Here I am. Love me.
|
|
|
|
|
try this as the first line in Main:
Console.SetOut( File.CreateText("console.log") );
Now everything goes to that file
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Thanks alot everyone!
|
|
|
|
|
Hi everyone,
I want to do something like XMLSpy or may tools like DreamweaverMX.
1) When you type this:
Before: (ignore the "")
========
"<"MyCompany">" //then the xml editor will automatically add the
After:
=======
"<"MyCompany">" "<"/MyCompany">"
I just want to do a very simple xml editor for c#. And at the end, save it into a xml file. I had been coding xml in notepad, and it is very troublesome.
I am not sure what areas i need to research in. Is there any tutorial on this or any source code, which i can refer to?
Any help, please?
Thanks.
Regards,
Chua Wen Ching :p
|
|
|
|
|
we are a small component company and a bit short on time , so we are always interested in people making samples with our controls.
if the project is not indended to be opensource you can get a license for free for our
syntaxbox (http://www.compona.com/wikiengine/WikiPageViewer.ascx?id=5[^])
supposing we get the right to publish the editor as a sample on our website.
//Roger
|
|
|
|
|
Hi there,
Thanks for the url.
I am looking to how to do that, not using any component.
I just want to write a xml editor, so i can save up money and code xml much easier.
Any help, on areas which i can achieve the thing i want, please?
Thanks.
|
|
|
|
|
Save money by using notepad, gvim, emacs, or some other vanilla text editor! If your typing skills are good enough, such "helpful" features are, IMO, actually just hinderances.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Are there any other requirements on what type of projects would qualify for this? Do they have to be freeware type projects or can it be a program that we might possibly sell?
|
|
|
|
|
Sorry, that last message was meant for Roger J
Blake
|
|
|
|
|
what we are looking for is sample applications for our users , code samples using our free controls.
so we are not looking for huge binary demos of any sort , just easy to follow code samples.
//Roger
|
|
|
|