|
Maybe this helps:
[StructLayout(LayoutKind.Sequential)]
public struct MD5_CTX
{
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = System.Runtime.InteropServices.UnmanagedType.U4)]
public uint[] i;
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = System.Runtime.InteropServices.UnmanagedType.U4)]
public uint[] buf;
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] in;
[System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] digest;
}
[DllImport("outlfltr.dll")]
public static extern void MD5Init(ref MD5_CTX context);
[DllImport("outlfltr.dll")]
public static extern void MD5Update(ref MD5_CTX context, Byte[] input, Int32 inlen);
[DllImport("outlfltr.dll")]
public static extern void MD5Final(ref MD5_CTX context);
Greetings
Covean
|
|
|
|
|
Hi,
Actually I've done a video player with the last quicktime SDK , and I would like to detect peak in the audio stream.
This peak will serve to synchronise the video stream with a database.
Thanks
|
|
|
|
|
Hi Experts,
I created a program in Visual Studio 2008 Standard. I left the namespace with standard MyProgram. I created some classes like this one
namespace MyProgram
{
public class MyDerivedPanel:Panel
{
}
}
Die werden dann in Form1.Designer.cs behandelt
namespace MyProgram
{
partial class Form1
{
private void InitializeComponent()
{
this.myDerivedPanel1 = new MyProgram.MyDerivedPanel();
}
private MyDerivedPanel myDerivedPanel1;
}
At the mentioned line, Visual Studio claims to have found an error at compile time:
<quote>Error 7 The type "MyDerivedPanel" does not exist in type "MyProgram.MyProgram"
(vaguely translated from german version)
I can delete the namespace including its "." from the erroring line and all works fine. But Visual Studio Designer re-inserts the namespace every time I change something in the Designer.
Having more than one class with this problem, deleting those namespaces gets annoying.
Is that a known issue?
Is there a known solution?Ciao,
luker
|
|
|
|
|
I tried to reproduce the problem but it works flawlesly.
|
|
|
|
|
lukeer wrote: Visual Studio claims to have found an error
VS never claims; it did find an error.
FYI: when a file contains errors, it does not compile, and the types it defines, are not available to the compiler when trying to deal with remainder of the application, so the compilation of other files may suffer from that as well. I assume you currently have multiple errors. Then first fix the errors in the lowest-level files, the ones holding minor classes needed by many but not needing much themselves, then work you way up.
Extra suggestion: if that fails, temporarily disable large chunks of code WITHIN classes (not entire classes though); you can use #if false and #endif for that purpose.
|
|
|
|
|
I Second what Luc says.
However, I would like to suggest looking at more errors. I believe that there must be more than one errors in case the files are not compiled.
Also, are these two files in the same project? (I know it is too basic a question. But better to confirm).
|
|
|
|
|
Isn't there a class named MyProgram?
If I understood what's happenning, it's something like this:
The Designer will always re-generate code (you change something in the form, it's code is regenerated enterelly).
But, to "avoid" problems, the full namespace is used. Here is the problem, it uses the full namespace, but does not add the global::
So, as you are inside MyProgram namespace, when it puts the "MyProgram." it finds a class with such name, and use it.
I really think that's the problem. To solve this, change the name of your class. I am not 100% sure that you have such class, but that's the only way I can reproduce the error.
|
|
|
|
|
Paulo Zemek wrote: Isn't there a class named MyProgram?
As far as I can tell, there is.
It's a class dealing with resources for multi-language-support. I don't remember if it was automatically generated with the name of "MyProgram.MyProgram", but I think that was necessary for some automated feature to find the files
- MyProgram.resx,
- MyProgram.en-US.resx and
- MyProgram.de-DE.resx.
Can I rename the class without breaking the multi-language-support?
How do I find the class?Ciao,
luker
|
|
|
|
|
In the line where the error with the MyProgram appears.
Right click in the word MyProgram and use the Go to definition function of the menu.
But I don't know how that was made... when I add multi-language support the name of the resource file is not really important, but if you have hand-written the name of the resource in strings you will need to find and replace them.
Another choice is to rename the namespace.
|
|
|
|
|
Paulo Zemek wrote: use the Go to definition function.
Another choice is to rename the namespace.
I tried both ways and they both fail because the resource class is generated automatically every time I change a resource.
I can change the name of the class and the change gets undone as soon as I change a resource.
I can change the namespace and the resource class changes its name accordingly as soon as I change a resource.
It seems like I have to move all of my self-created classes out of the application's standard namespace to avoid the conflict.
Any concerns about that?
Or does anyone have another solution?Ciao,
luker
|
|
|
|
|
How do you check if, for example, an xls file really contains a spreadsheet? If an image called test.jpg is renamed to test.xls, how could I, in C#, figure out that text.xls is actually an image?
|
|
|
|
|
Try opening it in the target application.
I wouldn't bother trying to guess.
|
|
|
|
|
Try and load it using the appropriate library built to parse that kind of file.
Other than that, you have to examine each and every byte yourself, parsing the file yourself, and validating all the data yourself. For every kind of file format, that's an enormous amount of work.
|
|
|
|
|
If your application is meant to handle almost any kind of file, then you have a tough job. Every file essentially is a series of bytes. Unless you scan that and then try to match it with actual pattern, I can't think of a concrete solution.
You can try opening the file with the associated program. That too will not guarantee detection since many file will open (although distorted and with weird characters) in the associated program.
I found this[^] through google. You can check if it helps.
|
|
|
|
|
i search a lot for program in c# that can record from web cam
can any one help!
Sorry and thanks
every time i search more harder in this web i found what i want so if any one wants to know the solution it is DirectShow.NET
for the Administrator you told me not to put the Q and A in the same Message so if you wants to remove it, it is your job.
thank you codeprojectmodified on Tuesday, March 2, 2010 9:02 AM
|
|
|
|
|
Your post doesn't make much sense at all, so, point-by-piont:
sanforjackass wrote: i search a lot for program in c# that can record from web cam
C# and the .NET Framework has no managed classes to do this. You must use an outside library.
sanforjackass wrote: every time i search more harder in this web i found what i want so if any one wants to know the solution it is DirectShow.NET
Yeah. And?
sanforjackass wrote: for the Administrator you told me not to put the Q and A in the same Message so if you wants to remove it, it is your job.
What are you talking about?
|
|
|
|
|
Is there any way to do optional variable declaration in c# 3.5.
I have two alternatives.
(a) Function Overloading
(b) declaring the function arguments in Params Object[] variable
Can i do it exactly the way we can do in vb.net ?
|
|
|
|
|
C# 4.0 introduces optional parameters, you can't do it in 3.5.
abcurl wrote: Can i do it exactly the way we can do in vb.net ?
Why would you ever compare anything to VB? I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: Why would you ever compare anything to VB?
OK, well you can do optional parameters in C++. Would that have been a better comparison? Kevin
|
|
|
|
|
Yes, VB and C++ are much closer. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
VB can compared to many things, normally prefixed with "A big steaming pile of....." Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
Here is how to do it in 4.0:
Named and Optional Arguments[^]
Told you: shameless Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
Mark Nischalke wrote: C# 4.0 introduces optional parameters, you can't do it in 3.5.
Back to the future......Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
I'm polishing up the Delorean now I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I never understood why it gathers that much dust while going back in time; most objects do when aging.
|
|
|
|