|
Nick Parker wrote:
Here is a shot in the dark, but I would think your Attribute class would need to implement the ICustomAttributeProvider and IReflect interfaces.
Im not sure what you mean??
To be more specific, the Attribite need to find the Type (not instance) the Attribute is applied to. I could do some resolving but I rather not.
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
I have a parent form and create a form on it that which it is its child and I want it be always open onn my top of parent form. The problem is when this dialog open it always behind the controls on the parent form not in front of them. How can I solve it?
Mazy
No sig. available now.
window.open=NS_ActualOpen;
orig_onload = window.onload;
orig_onunload = window.onunload;
window.onload = noopen_load;
window.onunload = noopen_unload;
|
|
|
|
|
Is the form created before the other controls have been created? That would put them higher in the z-order.
If you are wanting a sub form on a dialog window, why not make it a user control and use that?
Rocky Moore <><
|
|
|
|
|
I create it in Form_Load.
Mazy
No sig. available now.
window.open=NS_ActualOpen;
orig_onload = window.onload;
orig_onunload = window.onunload;
window.onload = noopen_load;
window.onunload = noopen_unload;
|
|
|
|
|
Form_Load? You mean in the OnLoad event?
If you want the dialog to appear over the controls on the parent dialog (not sure why you would want this) you have to put it higher in the Z-Order. An easy method place to build your dialog and add it to the controls is in the Form's contructor just prior to InitalizeComponent. Yours will be the first control which means anything that is behind it is hidden.
Another method is to use the Controls.SetChildIndex to move you form in the ControlCollection up to the top of the list thus the top of the z-order for the controls.
Rocky Moore <><
|
|
|
|
|
hmmmmm, thank you.
Mazy
No sig. available now.
|
|
|
|
|
Ok, I've been having alot of trouble understanding COM interop.. All the books I read give VERY basic examples that do not really help in the real world. What I want to do is use QEDIT.DLL so that I can use its SampleGrabber or IMediaDet interfaces.
Some books that I've read give very different forms of interop as well, like using "CreateInstance.Activator". The MSDN tutorial for COM Interop uses a totally different approach, using interface definitions. I'm assuming that "CreateInstance.Activator" cannot be used in my case and can be only used for very basic COM objects.
From what I know now, you have to import the COM object using it's GUID. And then layout the interface in the order it is originally layed out in the COM object, but for the parameters you must marshal them into a managed type. But then, there is this thing called a "coclass", I have no understanding of a coclass and why it is used. I am guessing that the coclass actually contains the implementation of the COM interfaces? Please tell me if I am right.
Then there seems to be all sorts of complex things I need to do, like setting up a graph (I think) and connect pins for samplegrabber, and there's also weird pointers and callbacks that I have to use and I have no idea how to put this all together. I'm not sure but I think IMediaDet can work without a graph. What I'm trying to do is make a simple program that opens an AVI and grabs a frame into a BMP file. Anyway, I would appreciate it if anyone could help me understand those few things. Or if someone has the time, maybe someone could write up an article on how this would work, I know it would help alot of people out, but I understand that not many people have the time. I also took a look at NETmaster's Directshow.NET code but that just confuses me, and he does not offer help for his code. Anyway, thanks in advance.
|
|
|
|
|
Consider "tlbimp.exe quartz.dll" (quartz.dll is the main DirectShow type-library). I have also seen explicit Quartz coclass import in a sample from the .NET framework SDK (see sample folders).
|
|
|
|
|
Quartz does work well with the type library imported, unfortunately quartz.dll does not contain the functionality that I want, quartz primarily just plays back video files. I am looking to grab frames from video files and that is something that QEDIT.DLL offers with its IMediadet or SampleGrabber interfaces, however I do not know how to implement them, and the type library importer does not work very well with QEDIT.DLL, it gives many errors and warnings.
|
|
|
|
|
Hi,
do C# exists an function like memset in C?
I want fill initial value for an matrix, has another way to fill value for matrix except use 2 loop?
Thanks.
H.Dung
|
|
|
|
|
|
|
awesome, thanks...
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Thank you
Kannan
|
|
|
|
|
I don't think a book on "Data Structures and Algorithms" should start with assigning nifty constants to all kinds of operations, and then forego and analyze the "running time" of several algorithms. This sets the wrong priorities (and has some distinct errors in the precense of a garbage collector)
The rest seems to be well selected, though. xome important graphics unreadable, but who cares if it's free?
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
peterchen wrote:
I don't think a book on "Data Structures and Algorithms" should start with assigning nifty constants to all kinds of operations, and then forego and analyze the "running time" of several algorithms.
I havent seen any other books do this and that why I find it so fasinating. Futher down it actually implements all the algorhytms. And the book is also available for Java and C++.
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
Hello
I have 2 lines (3 points). I pass these 3 points to Graphics.DrawCurve() function, which in turn draws a smooth curve on some specified graphics surface for me. The problem is that I need the curve line's equation. Maybe at last I have to write such a function myself. The existence of such a function makes my work easier. is there any way for me?
Don't forget, that's " Persian Gulf " not Arabian gulf!
|
|
|
|
|
It's a so called canonical spline.
Basically they are cubic splines where each segment is determined by the bonding points and the two "surrounding" points.
Petzold has a short derivation of it, with sample and "play around" program (i.e. he's doing the spline himself)
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
unfortunately I don't have that book.
Have you got the "play around"'s source code that you mententioned?
Don't forget, that's " Persian Gulf " not Arabian gulf!
|
|
|
|
|
Hi
1. Why cant you have a "params" parameter for the constructor of an attribute?
2. Why do you have to provide a constructor in an inherited abstract class where the base class does not have a default constructor?
Any input welcome
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
leppie wrote:
Why cant you have a "params" parameter for the constructor of an attribute?
This compiled for me:
public class Foo : System.Attribute
{
public int [] bar;
public Foo(params int [] a)
{
bar = a;
}
} leppie wrote:
Why do you have to provide a constructor in an inherited abstract class where the base class does not have a default constructor?
I assume you mean the abstract class has a constructor that takes parameters rather than no constructor at all.
With C# if you don't supply a constructor, a default constructor is supplied for you. Similarly if you don't explicitly call the base class's constructor it attempts to call the default constructor for you.
In the case where the base class has only non-default constructors the compiler still tries to call one from the auto-generated default constructor for the child class, causing an error saying that method "Foo" has no overload that takes 0 arguments.
For example:
public class Foo
{
public int bar;
public Foo(int a)
{
bar = a;
}
}
public class What
{
} Results in the said error message.
Whether the base class is abstract doesn't play a part in this at all
All testing on .NET v1.1
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
James T. Johnson wrote:
This compiled for me:
Did you try use it? Sorry forgot to mention it does compile, but its not usable.
James T. Johnson wrote:
I assume you mean the abstract class has a constructor that takes parameters rather than no constructor at all.
This is what I mean:
class Foo
{
public Foo(string blah){...}
}
abstract class Poo : Foo
{
}
An abstract class may not be constructed, so why do you need to provide a constructor?
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
leppie wrote:
An abstract class may not be constructed, so why do you need to provide a constructor?
It really isn't required, in fact this compiled fine for me (and worked) when I commented out the constructor:
abstract class CreditCard
{
public static bool Validate(string CreditCardNumber)
{
int sum = 0;
for(int i = 0; i < CreditCardNumber.Length; i++)
{
if((int)CreditCardNumber[i]%2 != 0)
{
if((int)CreditCardNumber[i] * 2 > 9)
sum += ((int)CreditCardNumber[i] * 2) - 9;
else
sum += (int)CreditCardNumber[i] * 2;
}
else
{
if((int)CreditCardNumber[i] != 0)
sum += (int)CreditCardNumber[i];
}
}
return(Convert.ToBoolean(sum%10));
}
}
-Nick Parker
|
|
|
|
|
|
leppie wrote:
But alas no base class
You can do something like this, if this is what you mean:
abstract class Poo
{
...
}
public class Foo : Poo
{
Foo(){}
...
}
Foo f = new Foo();
-Nick Parker
|
|
|
|