|
This[^] should do it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
How would you do this because I've had the same problem before and have had to find a less-than-perfect workaround. I don't think properties would work because the first form wont know when the selected index of the listbox on the second form has changed and therefore wont know when to update its textbox(unless you had a thread that continually checked). How would you use delegates to do it?
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
smyers wrote: I don't think properties would work because the first form wont know when the selected index of the listbox on the second form has changed and therefore wont know when to update its textbox(unless you had a thread that continually checked
That's why you use delegates.
smyers wrote: How would you use delegates to do it?
Create a delegate that passes the value you want to broadcast, in the form with the control that changes. Hook this delegate to a method in the form that you want to inform of a changed value.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
So,delegates are the best answer?
|
|
|
|
|
Yes, almost always.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
They are the only answer
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
Thanks, will try this out
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
Does anyone understand ComImport usage?
I am trying to expand the XPBurn library to allow me to set the AudioGap field, which would in my estimation allow me to control the gap between cd tracks when burning an audio cd. My question is, in exploring the XPBurnCD class, the AudioGap field is read-only, and has no set function, so...i want to write a set function. The get function uses IPropertyStorage interface to retrieve this information from the drive, using a method called ReadMultiple(). IPropertyStorage also has a function WriteMultiple(), which i assume is the means to set this value rather than retrieve it. Exploring the XPBurnCom class, where all the ComImports are done, you find that IPropertStorage interface has both functions in it. My major question I guess, is that in XPBurn, in the get, IPropertyStorage is declared but never instanced, and then ReadMultiple is called from it, and it works, but if you try to call WriteMultiple the same way you get a compile error that propStg, the IPropertyStorage declared, in never instanced, so why does one function work that way but not the other, I guess that is where I am lost. I would really like to figure this out so that XPBurn can be advanced a little, also the same methoed should be used to set the VolumeName and WriteSpeed fields as well, which are also read only for the moment but would be nice if there were writable. Does anyone have any suggestions, I can post some code if need be
Thanks for any help
|
|
|
|
|
Hi everyone,
I need a sample application that works on linux.
much better if you can give me some links. or sample codes.
thanks in advance,
Jeoffrey
to know everything is to know yourself...
|
|
|
|
|
I think you're looking for Mono. It's the .NET framework for Linux.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Like Christian said, look at Mono. If I recall, it doesn't support WinForms in full. But, still worth looking at.
"That's no moon, it's a space station." - Obi-wan Kenobi
|
|
|
|
|
I`ve read the MONO introduction recently. I will install this and code it here. How about my C# codes or i will start from a scratch..
to know everything is to know yourself...
|
|
|
|
|
In linux c# is called as GTK#
you can get alot of sample code and tutorials of c# in linux(GTK# ) from google.
evil
|
|
|
|
|
That is hardly an accurate description. GTK# is not a language but a GUI toolkit that can be used by Mono.
|
|
|
|
|
umm, mono is the framework like vs.net in windows for linux and gtk# is a C# binding of GTK+graphical library.
in linux
GTK->C & # -> #= GTK#
evilinside
|
|
|
|
|
EvilInide wrote:
In linux c# is called as GTK#
Yes, so GTK# is not the linux name for C#.
|
|
|
|
|
Hi, i'm currently working with drag and drop between windows explorer and a form using the .net drag and drop.
I have a file and a directory with the same name and i want to drop one of them from explorer to my form.
Is there a way of telling whether the item i'm dropping into the form is a file or a directory?
Thanks in advance
|
|
|
|
|
Doesn't it deliver a path ? File.Exists will tell you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yep, it delivers the path, but the problem arises when there's both a file and a directory with exactly the same name. If I use File.Exists and I'm actually dropping the directory then I would get the wrong item.
|
|
|
|
|
You will need to load the file in as a FileInfo and then look at the attributes to see if it's a directory or not...
<br />
FileInfo f = new FileInfo(strFileName);<br />
if ((f.Attributes & FileAttributes.Directory) == FileAttributes.Directory)<br />
{<br />
}<br />
else<br />
{<br />
}<br />
|
|
|
|
|
You CANNOT have a file and a folder with the same name in the same location.
However, as already suggested, you can use the attributes to find out if the entity in question is a directory.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
This is true, I never knew that, I just tried it. But surely your file would have an extension which makes its filename different to the folder's filename anyway.
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
smyers wrote: But surely your file would have an extension which makes its filename different to the folder's filename anyway.
You can have a file without an extension.
You can equally well have a folder with an 'extension'.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|
|
True that. What I meant though was that your file will more than likely(almost definately) have an extension and your folder will not. Why would anyone create a file without an extension or a folder with one for that matter.
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|