|
I guess the problem is getting Windows to do the
necessary things on time every time, which is not easy
(if at all possible) on an OS that does not intend to be real-time.
|
|
|
|
|
Thanks for the input, but do you have a recommendation on what the best way of accomplishing this task?
I am trying to create a video surveillance type program where I am recording actions of a customer, but then be able to rewind to see a specific incident while continuing recording.
I am able to copy the currently recorded video file, but it doesn't contain any indexes.
I am new to directx and never used the sdk before. So maybe I missing some fundamental info on how to use it the best way.
Thanks
|
|
|
|
|
Hi,
I havent done this with DirectX (or any other way on a Windows system).
If DirectX has the file open for write, another process or thread wont be able to read
it; also you said indexes are not available until the file gets closed.
So my best guess is you should record for a limited time (say 5 minutes), stop
recording (closing the file), start a new recording (in another file!), and
maintain some kind of super-index (with apropriate file names that include starting
time, the directory itself could serve that purpose).
In doing so you can watch everything except for the last 0 to 5 minutes while still
recording almost continuously. The drawback is your app produces not one but many
files.
Hope this helps.
|
|
|
|
|
Hi,
I have a Typed DataTable created by the DataSet Designer with a Primary Key (let's say ID). I've setup SQL Server to set the ID field to auto insert if no value is supplied.
The problem is that the DataTable has set the IDColumn.Unique = True and the IDColumn.AllowDBNull = False, so when i insert new rows into the DataTable, the DataTable will assign unique keys to the ID column but the assigned id might already be in the database, so when i update the DataTable it fails.
When i try to set the Unique Property of the ID field to false (so i can set all ID fields to NULL and the db will fill them) Visual Studio will complain that its a primary key field which needs to be unique.
So basically i want to be able to insert into a DataTable 1000 new rows and the db should assign their PrimaryKey and not the DataTable.
Thanks in advanced
|
|
|
|
|
Say I implement a struct, is a .dispose method required for the memory to be cleared, or the .dispose used in specific circumstances?
Jon
|
|
|
|
|
No, it's not. Structures are value types.
Dispose is called on objects that allocated resource, unmanaged or managed, that need to be freed before the object is destroyed. Basically, you call Dispose on any object that implements it when you're done with it.
|
|
|
|
|
The IDisposable interface is used when an object uses unmanaged resources, that needs to be freed before the object is collected.
If you have a structure that would need to implement IDisposable, it should definitely not be a structure.
---
single minded; short sighted; long gone;
|
|
|
|
|
Why am I getting this error? Is the installation corrupted or something?
I couldn't find System.Drawing within the object browser either...
Code:
using System;
using System.Drawing;
namespace Wrox.ProCSharp.StaticConstructorSample
{
public class UserPreferences
{
public static readonly Color BackColor;
static UserPreferences()
{
DateTime now = DateTime.Now;
if (now.DayOfWeek == DayOfWeek.Saturday
|| now.DayOfWeek == DayOfWeek.Sunday)
BackColor = Color.Green;
else
BackColor = Color.Red;
}
private UserPreferences()
{
}
}
}
VS Studio 2003
Error:
C:\Documents and Settings\Jon\My Documents\Visual Studio Projects\TestConsole\startUp.cs(8): The type or namespace name 'Color' could not be found (are you missing a using directive or an assembly reference?)
Jon
|
|
|
|
|
jon_80 wrote: (are you missing a using directive or an assembly reference?)
Exactly what the error says. You're haven't added a reference to the System.Drawing.dll.
Just go to the Project menu, then Add Reference... You should be able to figure it out from there.
|
|
|
|
|
Hello everybody.
Imagine we have a two-dimensional array c[n][m] with ints. How can we make an image in which pixel at place (i,j) has color c[n][m]? The only way I can suggest is to create Bitmap and then use it's method SetPixel, but it works too slowly! Can someone suggest something faster? Thanks
|
|
|
|
|
|
Does any know of a way in C# to contact a web server and get the public SSL certificate information? I know all of this is handled by web service calls over https but I need the certificate to do some offline processing outside of webservices.
Any help would be greatly appreciated.
~Nick
Forever Developing
|
|
|
|
|
Take a look at the System.Security namespace
led mike
|
|
|
|
|
That namespace is used for code access security. I am interested in Public Key Encryption. I am look for a way to contact a web server and have it transmit me its public key.
~Nick
Forever Developing
|
|
|
|
|
Sorry, I fat fingered it.
System.Net.Security
led mike
|
|
|
|
|
led mike,
Thank for the information but I am not using sockets or streams. I have a set of files that are digitally signed and I want to make sure their signatures are valid. After getting the files and the digital signatures I need the URL's public key to validate the Signatures.
Using Fiddler I noticed the following response on a 443 connect. However, I am not sure how this would translate to x509 certificate in C# code.
~Nick
HTTP/1.1 200 Connection Established
This is a HTTPS CONNECT Tunnel. Secure traffic flows through this connection.
Secure Protocol: Tls
Cipher: Rc4 128bits
Hash Algorithm: Md5 128bits
Key Exchange: RsaSign 1024bits
Certificate:
[Subject]
CN=www.intellicheck.com, OU=Secure Link SSL, OU=Data Systems, O="Intelli-Check, Inc.", STREET=246 Crossways Park West, L=Woodbury, S=NY, PostalCode=11797, C=US
[Issuer]
CN=Network Solutions Certificate Authority, O=Network Solutions L.L.C., C=US
[Serial Number]
00F36126851351E1E58CD16C5DA38A430C
[Not Before]
9/5/2005 8:00:00 PM
[Not After]
9/5/2008 7:59:59 PM
[Thumbprint]
BAF241B7E84E5663AE70D7470076EF1D0CAEF222
Forever Developing
|
|
|
|
|
Hi Everybody,
I'm getting DllNotFoundException when trying to execute some code, and I'm lost as to what's happening. Anyways, here's what I've got:
1. I wrote some code on machine A that consists of a C++ dll which interfaces with an external library (lib files for MATLAB). I set the include search path to include the directory that those files are in on machine A.
2. I wrote some C# code on the same machine to access that dll using:
[DllImport("savemat.dll")]
static extern void SaveData(string filename, string colname, double[] data, int length);
3. When I run the code on machine A, everything works fine, but on any other machine I get a DllNotFoundException.
I'm assuming that this is coming from interop not being able to load the MATLAB lib files that I use in the dll. I tried putting copies of those files in the same location on other machines, but that doesn't work. I also tried having those .lib files in the execution directory.
I hope this is a clear enough description of my problem and that somebody can help.
Thanks,
Nick
p.s. Yes, I definitely do have savemat.dll in the execution directory
|
|
|
|
|
Is this a dll that needs to be registered with regsvcr ? Some dlls need to be registered for them to be visible to other applications.
Hope that helps.
Ben
|
|
|
|
|
I don't think it needs to be registered since it worked fine on the initial development machine without being registered. I just tried it anyways, and it says: LoadLibrary("savemat.dll") failed - The specified module could not be found.
Also, I forgot to mention that I wrote an additional dll that doesn't call into any external code (just a hello, world), and that works fine on all machines.
|
|
|
|
|
Run depends on it and see what DLL it can't find.
[My bad, didn't realize that this was the C# forum. Depends might not work on .NET assemblies]
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
|
|
|
|
|
I tried putting the dll I wrote into depends, and it's giving me some information, but I don't know what it means. In the tree view on the left hand side, it lists libmat.dll and libmx.dll underneath my savemat.dll, but libmx.dll is red.
In the column view to the right of that, when I click on libmx.dll, one of the functions listed has a red rectangle with a 'C' in it, but I don't know what that means. I looked through the help files, but couldn't really figure anything out.
Also, I don't understand why in depends, it lists things like libmat.dll instead of libmat.lib, which is what I originally linked with in savemat.dll.
|
|
|
|
|
You should start reading about static linking vs. dynamic linking.
When you're using a lib, you're copying the functions your program is using right into the binary.
When you're using a dll, you only include a reference in the application saying "call function number 3 from mysharedlibrary.dll".
In this case the application must be able to find mysharedlibrary.dll at runtime and every dll mysharedlibrary.dll is depending on.
In your case savemat.dll seems to be found but it cannot be loaded because libmx.dll cannot be found.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
That's the thing that's so confusing to me!
I was using libs when I wrote the C++ library, and it seems like they're being copied into savemat.dll, since it's only like 20 lines of code, but it comes out at 220KB.
I'm really confused that depends would have dlls listed as dependencies of my dll since i didn't link to any dlls.
I'll have to double check all of this, so I don't look like a huge idiot...
|
|
|
|
|
heloo guys..thanks alot u really doing agreat job ..any way i have finally created strings for each shape (lines,polygons,..) each string contains informations about the shape( x1,y1,x2,y2,R,G,B,pen width) ..Now how can i make my prog read from the text and draw the shapes ..as example the line string :
public void AddSv(Line l , ref string str)
{
if(drawwhat==1)// as one means lines
str +="1"+"\n"+l.First.X.ToString()+"\n"+
l.First.Y.ToString()+"\n"+
l.Second.X.ToString()+"\n"+
l.Second.Y.ToString()+"\n"+
l.Pen.Color.R.ToString()+"\n"+
l.Pen.Color.G.ToString()+"\n"+
l.Pen.Color.B.ToString()+"\n"+
l.Pen.Width.ToString()+"\n\n";
after i draw the line i click on save to send the informations to the text :
private void button1_Click(object sender, System.EventArgs e)
{
//save
System.IO.FileStream fs = new System.IO.FileStream("c:\\graphics.txt", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
StreamWriter streamWriter=new StreamWriter(fs);
streamWriter.WriteLine(LineSv);
streamWriter.Flush();
streamWriter.Close();
fs.Close();
}
Regards;P;
|
|
|
|
|
Don't cross post
only two letters away from being an asset
|
|
|
|