|
Is it possible to call upon video for windows VFW in C#? Is there any existing code for compressing an AVI in C#? Thanks for any help or links you can provide.
|
|
|
|
|
Anything you do with WIN32 and C/C++ is possible in C# thanks to interop.
When you know the method signature, you just need to declare it in your code with a [DllImport("dllname")] attribute like in ::SendMessage :
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam);
Even more interesting is that in your case there are COM components. And the VS.NET IDE automatically imports their type-library, wrap interfaces and makes them look like any namespace to you. That's what you get for instance when you need integration with Internet Explorer, MS Office, ...
Now about DirectShow itself, this SDK has both COM Components and simple low-level APIs. Just help yourself. Below is 2 CP articles about it :
DirectShow media player[^]
DirectShow.NET[^]
You've got an introductory article about DirectShow in MSDN Mag - july 2002[^].
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
|
|
Nnamdi Onyeyiri wrote:
oh, and im not gonna ask if there is something specific i have to do to my collectionbase derived class, to make the windows forms designer use the collection properly
You just need to implemenet an indexer We had plenty disscussions about that during the last week. Have a look at the CollectionEditor class for more details, I'm still trying to figure out how to add multiple types, it sure did look easy
Cheers
PS: Where have u been?
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
public class EBGroupCollection : CollectionBase
public EBGroup this[int index]
{
get
{
return (EBGroup)this.List[index];
}
set
{
this.List[index] = value;
}
}
public EBGroupCollection()
{
}
public void Add(EBGroup value)
{
this.List.Add(value);
}
}
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
I just don't get those strange indexers.
Nnamdi Onyeyiri wrote:
EBGroup this[int index]
It looks like the good old C++'s operator[]
Ñ There is only one MP Ð
|
|
|
|
|
Yes , the quote button is gone, they are the same
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
|
Oops, make sure the type you are adding has a default constructor, as allways
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
yer, it/they does/do.
EBGroup is a class, with another collection, i dentical to the other one, except for EBItem [also a class]. can i not use classes?
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Nnamdi Onyeyiri wrote:
EBGroup is a class, with another collection, i dentical to the other one, except for EBItem [also a class]. can i not use classes?
Yes you can! I would sugest you make a few small skeleton classes to see where the problem lies...start at the other container iow that 1st collection you mentioned.
Good luck
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
leppie wrote:
We had plenty disscussions about that during the last week.
|
|
|
|
|
|
Nnamdi Onyeyiri wrote:
what do you mean
Havent seen many posts from you lately, was just wondering?
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
Are there any good articles that anyone is aware of that explains in detail specifically what interfaces are and how they are used in C#. Thanks.
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
|
Thanks Paul,
A little further down in that discussion John Burton makes a comment [^] about them which makes me think they are used to describe a virtual function as we do in C++. However with your[^] comment they appear to implement the flavor of inheritance to a class. Both of which make some sense, however I would really like to read a full article where they are described in great detail. Thanks for the link though.
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
The problem is that C# is new enough that it is all a matter of opinion. To offer a single article (which I don't have, or I would do anyway) would be to offer only one person's opinion.
To my mind, neither viewpoint that you've picked out is strictly wrong, nor are they mutually exclusive. An interface is sort of like an abstract class for a language that otherwise doesn't allow multiple inheritance. So in a way, it is like offering a set of virtual functions.
The most useful purpose of this is to offer a flavour of inheritance to the class.
Does that make sense? (it is Friday night!)
Paul
|
|
|
|
|
Paul Riley wrote:
(it is Friday night!)
Don't tell me you shut down on Friday night....I get it, however just because C# is a new language doesn't mean there isn't anything more than someones opinion
As soon as I find out more about them I may just have to put together a little or big article than can clear this all up for us.
Go enjoy your Friday night, not too much though, otherwise Saturday will hurt you.
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
Good news, I found a really good article[^] that pretty much clears it up for me, take a look.
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
That is a good article, well found.
I do think it could be better though . What an interfaces article needs is a single practical example: this is an interface, these are two classes that might implement this interface. What this does is say: this is an interface, and this is how you use one that already exists, proving how difficult it is to find a practical use for interfaces (the StringList example is pointless).
Just thinking aloud. I might be tempted to work on this when my workload calms down over the next few weeks and I get to finish the one I'm already working on.
Paul
|
|
|
|
|
I'm using interfaces on a project right now in a very practical way. I have a database that has 80 some odd tables in it tracking all kinds of entities that are used in reporting.
I have an interface:
public interface ISummarizable{
XmlDocument getSummaryXML();
DataSet getSummaryDataSet();
//... other methods
}
It allows me to write methods like this:
public void printSummary(ISummarizable it){
XmlDocument doc = it.getSummaryXML();
//... print doc
}
But I can apply that to any items in the database - customers, loans, collections, stores...
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
Excellent example, afronaut! Feel like writing an article?
By the way, can I ask [slightly off topic] - why did you choose to use get... methods, rather than read only properties?
eg
public interface ISummarizable {
XMLDocument SummaryXML { get; }
DataSet SummaryDataSet { get; }
} Or was this just an arbitrary decision?
Paul
|
|
|
|
|
Paul Riley wrote:
By the way, can I ask [slightly off topic] - why did you choose to use get... methods, rather than read only properties?
Now for then even MORE off topic answer.
If a property has a ReadOnlyAttribute, the property will only be readonly to the designer, but it is still settable programatically, where only defining only a get property is never settable (pretty obvious)
Cheers
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|