|
There is no solution other than the unreliable approach of "pinging" each port on the remote PC.
Unless, of course, you can upload an .EXE to the remote PC and execute it, reporting back to your machine, but I get the feeling this is highly unlikely.
|
|
|
|
|
For the past few weeks iv been working on a C# app to record from a webcam and make notes on it via button presses during said capture. The problem now is that by default the app freezes during capture, and stops capturing with a mouse click. I know that i need to change it using the captureparms structure which holds information on the default behaviour of the capture, but my attempts up to now just dont work. My sendmessage to set the capture parameters is successful and returned true when i put in code to check, so it leaves me a bit stumped and im thinking it must be something related to me doing the structure wrongly. Is there any chance anyone could help shed some light on why it isnt working?
CAPTUREPARMS CaptureParams = new CAPTUREPARMS();
CaptureParams.fYield = 1;
CaptureParams.fAbortLeftMouse = 0;
CaptureParams.fAbortRightMouse = 0;
CaptureParams.dwRequestMicroSecPerFrame = 66667;
CaptureParams.fMakeUserHitOKToCapture = 0;
CaptureParams.wPercentDropForError = 10;
CaptureParams.wChunkGranularity = 0;
CaptureParams.dwIndexSize = 0;
CaptureParams.wNumVideoRequested = 10;
CaptureParams.fCaptureAudio = 0;
CaptureParams.fMCIControl = 0;
CaptureParams.fStepMCIDevice = 0;
CaptureParams.dwMCIStartTime = 0;
CaptureParams.dwMCIStopTime = 0;
CaptureParams.fStepCaptureAt2x = 0;
CaptureParams.wStepCaptureAverageFrames = 5;
CaptureParams.dwAudioBufferSize = 0;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
public struct CAPTUREPARMS
{
public System.UInt32 dwRequestMicroSecPerFrame;
public System.Int32 fMakeUserHitOKToCapture;
public System.UInt32 wPercentDropForError;
public System.Int32 fYield;
public System.UInt32 dwIndexSize;
public System.UInt32 wChunkGranularity;
public System.Int32 fCaptureAudio;
public System.UInt32 wNumVideoRequested;
public System.Int32 fAbortLeftMouse;
public System.Int32 fAbortRightMouse;
public System.Int32 fMCIControl;
public System.Int32 fStepMCIDevice;
public System.UInt32 dwMCIStartTime;
public System.UInt32 dwMCIStopTime;
public System.Int32 fStepCaptureAt2x;
public System.UInt32 wStepCaptureAverageFrames;
public System.UInt32 dwAudioBufferSize;
public void SetParams(System.Int32 fYield, System.Int32 fAbortLeftMouse, System.Int32 fAbortRightMouse, System.UInt32 dwRequestMicroSecPerFrame, System.Int32 fMakeUserHitOKToCapture,
System.UInt32 wPercentDropForError, System.UInt32 dwIndexSize, System.UInt32 wChunkGranularity, System.UInt32 wNumVideoRequested, System.Int32 fCaptureAudio, System.Int32 fMCIControl,
System.Int32 fStepMCIDevice, System.UInt32 dwMCIStartTime, System.UInt32 dwMCIStopTime, System.Int32 fStepCaptureAt2x, System.UInt32 wStepCaptureAverageFrames, System.UInt32 dwAudioBufferSize)
{
this.dwRequestMicroSecPerFrame = dwRequestMicroSecPerFrame;
this.fMakeUserHitOKToCapture = fMakeUserHitOKToCapture;
this.fYield = fYield;
this.wPercentDropForError = wPercentDropForError;
this.dwIndexSize = dwIndexSize;
this.wChunkGranularity = wChunkGranularity;
this.wNumVideoRequested = wNumVideoRequested;
this.fCaptureAudio = fCaptureAudio;
this.fAbortLeftMouse = fAbortLeftMouse;
this.fAbortRightMouse = fAbortRightMouse;
this.fMCIControl = fMCIControl;
this.fStepMCIDevice = fStepMCIDevice;
this.dwMCIStartTime = dwMCIStartTime;
this.dwMCIStopTime = dwMCIStopTime;
this.fStepCaptureAt2x = fStepCaptureAt2x;
this.wStepCaptureAverageFrames = wStepCaptureAverageFrames;
this.dwAudioBufferSize = dwAudioBufferSize;
Sorry about the length but without providing this i dont think anyone would really have known what i had done.
|
|
|
|
|
Dear friends,
i have a shape like these ........
Path Name="MainBrush" Data=" " Margin="0,0,-5,6">
Path.Fill>
LinearGradientBrush MappingMode="Absolute" StartPoint="141.363,201.300" EndPoint="141.363,252.324">
LinearGradientBrush.GradientStops>
GradientStop Offset="0.00" Color="#ffffffff"/>
GradientStop Offset="1.00" Color="#ff020202"/>
/LinearGradientBrush.GradientStops>
LinearGradientBrush.Transform>
MatrixTransform Matrix="1.000,0.000,-0.000,-1.000,-81.196,252.324" />
/LinearGradientBrush.Transform>
/LinearGradientBrush>
/Path.Fill>
/Path>
(sorry i could not poste the code correctly so i have removed first "<" in all the lines)
i want to change these colours at runtime (in C# event) .... i am new to WPF ........i do not know how to modify these two colous at run time
help me ..........
By
Joe.I
|
|
|
|
|
First: To paste it correctly, use the "encode HTML tags when pasting" option below the message entry box - this replaces the < and > characters with more protable ones.
Second: Try the correct forum - there is one for WPF where you will probably get better help than a dedicated C# forum.
If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
|
See following thread. There is code that will animate the color.
It is in code-behind though, but maybe it's useful.
WPF Forum[^]
hope this helps.
(ps: The code in the thread combines two animations, strip out the color animation)
|
|
|
|
|
Thank You friend .for your reply ...
i have solved the problem ....
solution like these
private LinearGradientBrush Setcolour(string FirstColour, string sSecondColour, Point StartPoint, Point EndPoint, MatrixTransform MatrixTr)
{
LinearGradientBrush lgb = new LinearGradientBrush(GetColour(FirstColour), GetColour(sSecondColour), 0);
lgb.MappingMode = BrushMappingMode.Absolute;
lgb.StartPoint = StartPoint;
lgb.EndPoint = EndPoint;
lgb.Transform = MatrixTr;
return lgb;
}
MainBrush.Fill = Setcolour("#ffffffff", "#ff020202", new Point(141.363, 201.300), new Point(141.363, 252.324), new MatrixTransform(1.000, 0.000, -0.000, -1.000, -81.196, 252.324));
Thank u all ......
|
|
|
|
|
I have developed a user control in .net 2.0 framework. on user control i used table layout panel. to place the controls but in some cases i have to need to put 2 lable in a one cell so i used panel to put the 2 label one was windows lable and another was gobicode html lable in next ce4ll of table layout panel i put the text box. now i have arranged tab indexes properly. and short cut key given to the windows lable as i cant give short key to the gobicode. but in this case short cut for that text box is not working. Please help me.
|
|
|
|
|
Hey guys!
I have a question and I think the answer is 'Remoting', but I want to know for sure. I want to write an application which contains modules. Customers buy the 'base' software. If required, they buy additional modules which enables the software to 'do more'. Now all these modules are seperate projects (and thus seperate dll's). I want the software to check if a module is 'active', and then check for the existance of the dll, if both are OK, the system can reference the dll and use it.
Ofcource all modules are available at design time so referencing the dll's is no problem, but when starting the system with one or more dll's missing i'll receive a JIT Debugger message. Is there a way to not deliver all modules, but only deliver the 'active' modules and change that (change db values and copy the module dll's) without having to compile the software again?
And... Can I also accomplish this without module versioning? What I mean here, is that I may want to change (update or fix) modules which result in a new module dll (and a new version). Can I still use that dll from the 'base' system without having to decompile? (I am aware here, that I need to be very carefull what to change and not change (for example) return value types or so).
Hrmmm... a fairly large story, but I wanted to explain exactly what I want to get a satisfying answer. Since English is a foreign language for me I may have used some unneeded words Cheers guys!
|
|
|
|
|
|
hi,
i have a multithreaded application in which i m downloading files and updating GUI.it runs fine when i debug it but dnt update the GUI when i run it in release mode.tell me where i m wrong?
|
|
|
|
|
Member 590310 wrote: tell me where i m wrong?
By giving us a vague description with no code to review. That's where you are wrong.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
You've asked this very same question before and I asked you to tell us more about the problems you were having and to post some code. But you ignored my (and Luc's) reply and now you just post it again. This day didn't start very well, and you just made it worse...
|
|
|
|
|
private void LoadKeywordsCombo()
{
using (var db = new momdbDataContext())
{
keywordsComboBox.DataSource = db.Books.Select(c=> c.Keywords !=null
c=>new{ID=c.ID,Name=c.keywords});
keywordsComboBox.DisplayMember = "Name";
keywordsComboBox.ValueMember = "ID";
}
}
I'm wanting to somehow select everything from the book table where keywords is !=null and populate my combo box accordingly. i thought it might be the .where() method but i'm not sure
thanks in advance for the help
|
|
|
|
|
Are you sure Keywords is null and not an empty string? Best use the IsNullOrEmpty method.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
could you give an example of how i might use the isnullorempty in this instance ?
what i'm trying to avoid is a combobox witha bunch of blank fields where the keyword isn't added
|
|
|
|
|
Read the documentation, Select take a predicate that returns a bool. string.IsNullOrEmpty returns a bool. Ergo...
keywordsComboBox.DataSource = db.Books.Select(c=> !string.IsNullOrEmpty(c.Keywords))
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello all, my name is Sundeepan and I am new to this board and to coding as well. To train myself and get familiar with OOP concepts using the C# language I am reading, "Microsoft .NET Framework - Application Development Foundation" book by Tony Northrup. I am finding this book very informative. I do have a question that I was not able to find an answer to by querying Google. The question is as follows:
If a method requires an object as one of its parameters why should one not pass an object of a base class, instead one must pass an object of the derived class?
I understand that this might be a foolish question, but I am at a very early stage of my learning, any help would be appreciated. Metaphors are equally as helpful as a technical answer.
Regards
Sundeepan
http://sundeepinthought.blogspot.com
modified on Friday, February 5, 2010 12:32 AM
|
|
|
|
|
class Animal
{
protected void Foo(){}
}
class Cow : Animal
{
public vod Moo(){}
}
class Farm
{
public void Pet(Animal animal){}
}
If you pass Animal to a method then you can only access the Foo method. However, if you pass Cow, you will have access to both Moo and Foo methods since Cow derives from Animal.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
So if I wrote
class Farm
{
public void Pet(Cow chicken){}
}
I can access both Foo and Moo?
But if I wrote
class Farm
{
public void Pet(Animal man){}
}
then I can only access the Foo method?
Lol..nice example though....clarification is needed if you don't mind
|
|
|
|
|
sundeepan wrote: Cow chicken
and
sundeepan wrote: Animal man
was a really comical. Anyway i don't see any clarification to make since it is just as you say. When you inherit, you get the members you inherit and in addition any member you make in the new class. Just like if someone left you some items to travel to an unknown land ( ) then, you'd have the items you originally owned plus the ones he left you. But he would not have the items you own since you never gave it to them.
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
sundeepan wrote: why should one not pass an object of a base class
Who says you shouldn't? There are many cases where you would.
|
|
|
|
|
This is the paragraph that threw me off:
"Another benefit of inheritance is the ability to use derived classes interchangeably, a concept called polymorphism. For example, there are five classes that inherit from the System.Drawing.Brush base class: HatchBrush, LinearGradientBrush, PathGradientBrush, SolidBrush, and TextureBrush. The Graphics.DrawRectangle method requires a Brush object as one of its parameters however, you never pass an object of the base Brush class to Graphics.DrawRectangle. Instead you pass an object of one of the derived classes. Because they are each derived from the Brush class, the graphics.DrawRectangle method can accept any of them. Similarly if you were to create a custom class derived from the Brush class, you could also pass an object of that class to Graphics.DrawRectangle. "
|
|
|
|
|
It sounds like the author isn't a very good technical writer. Which is one of my complaints about mass-market programming books. And one of the benefits of taking a class with a real live teacher -- you can ask the teacher for clarification.
That may not be a good example -- System.Drawing.Brush is abstract, so you can't have an instance of it anyway. But if you do have an instance of it, then you could go right ahead and pass it (but who knows what would happen).
|
|
|
|
|
Its a "Microsoft Press" book for the 70-536 cert exam...this guy better be a good technical writer lol!
|
|
|
|