|
Hi..
i would like some pointers to links that can guide me on this task..
i want to create remote objects with callback functions and use them in the window host.
with due regards to Jibin Pan. I found a article at -->
http://www.c-sharpcorner.com/Code/2003/March/RemoteObjectsP1.asp
this is perfectly what i want ..but problem is when i try to register a callback method..I get some sort of security exception...can anybody tell me where i have gone wrong..
if we go to the link i mentioned ..we see there are some figs illustrated..On channel server fig ..i'm not able to send message from server to client..
Jibin Pan Sir,If u happen to read this posting..plz do not get angry..as i tried contacting you.
Regards
God is Great..
|
|
|
|
|
Why don't you tell us what the SecurityException read? There's many reasons that can be thrown.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
The exception i got is -->
System.Security.SecurityException.
Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level.
God Is Great
|
|
|
|
|
The solution to your problem is here Ingo Rammer[^]
Free your mind...
|
|
|
|
|
Thanks a lot Guillermo ...........
it worked..
WHew...it saved a couple of my hours..rather days ..;P )
God Bless u..;)
God Is Great
|
|
|
|
|
Hi,
i've created an MDI app. there is main form which contains some buttons..and a register form which runs after any one of the buttons are clicked...the problem is when the register form shows itself as a child window the buttons from parent window come onto the child window and are overlapping the form.
whats wrong?...how do i handle this problem.
Arvinder Gill
|
|
|
|
|
I think u can creat a panel and dock it a side first. Then put your buttons into it.
<font=arial>Weiye Chen
When pursuing your dreams, don't forget to enjoy your life...
|
|
|
|
|
Hi All!!!
i am checking the double click event of ComboBox but it is not triggered on double clicking, but if we register it with TextBox, it works fine. Click event of comobo also works fine. but there is some problem with doublecliking it.
Can soemone help?
Thanx in advance
sorry for my bad English.
|
|
|
|
|
Almost all the controls in System.Windows.Forms encapsulate their Windows common controls equivalents. Not all of these controls support all the notification messages that raise events in .NET. The ComboBox, for instance, pops up and hides its scrolling popup window used for the drop down on WM_LBUTTONDOWN and is not double-click aware. If you want to make it so, you're going to have to extend the ComboBox controls in .NET, override WndProc , and handle many of these messages yourself. To handle messages like WM_LBUTTONDOWN though, you might have to use an IMessageFilter .
Anyway, you'll have to capture this message before it goes to the base class's WndProc method (which you should call base.WndProc(ref m) after your code) and start a timer. If the timer elapses, call SendMessage (which you'll also have to P/Invoke) with the original data that came with the WM_LBUTTONDOWN message. If the user clicks again before the timer elapses, then you've got your double-click event and should throw-out the WM_LBUTTONDOWN message (i.e., don't send it). The easiest way to raise this event is to just call base.OnDoubleClick , which will raise the DoubleClick event.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I need to be able to turn off the screensaver or disable it some how while my app is running. You see, I developed a Media Player, so the screensaver should not be able to take over while watching a longer video.
Does anybody knows how to...??
|
|
|
|
|
You'll need to P/Invoke the SystemParametersInfo API like so:
[DllImport("user32.dll")]
private static extern bool SystemParametersInfo
(
[MarshalAs(UnmanagedType.U4)] int action,
[MarshalAs(UnmanagedType.U4)] int param,
IntPtr data,
[MarshalAs(UnmanagedType.U4)] int winini
)
private const int SPI_SETSCREENSAVEACTIVE = 0x0011; When you call this, you'll want to make sure that you activate it again, so you'll want to design your code something kind of like this:
try
{
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, null, 0);
}
finally
{
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 1, null, 0);
} Optionally throw a catch in there if you want, but make sure you use a finally block or some other means of re-activating the screensaver in case of success OR failure (if possible). The calls above also do not update the user profile, so this change will not persist after a reboot (which seems to be the way you'd want it for what you're doing).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks Heath Stewart, it works, you ar:-De the man!!!
|
|
|
|
|
Hello, Im new to all this. I was looking for an algorithm that display the sin function graphic. Can you help me please?
Thanks
|
|
|
|
|
Gosh! This is going back a bit... I haven't worked with trig' functions since I was a developer on a team building a GIS product.
double y;
for(double x= 0.0; x=< (Math.PI*2.0); x+=0.01)
{
y = Math.Sin(x);
}
This will generate the coorinates for one cycle.
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"Get in touch with your Inner Capitalist - I wish you much success!" -- Christopher Duncan, Lounge 9-Feb-2004
|
|
|
|
|
I have a project that generates graphis for math formulas:
http://www.adersoftware.com/?page=aderplotter
|
|
|
|
|
I have an application in which I require event triggers every 1-5ms or so. I am using C# and as far as I can tell, the usual triggering method in C# actually uses the DateTime.Now.Ticks
property to generate event triggers. Thus its resolution is also limited to the resolution of DateTime.Now.Ticks which is 15.625 ms on my m/c (i.e. the smallest time interval whch DateTime.Now.Ticks can measure is 15.625 ms).
If I set my trigger interval to anywhere between 1 - 15 ms I actually get triggers only
after 15.625 ms. If I set my trigger interval to 16-31 ms I get triggers after
every 31.25 ms and so on. I can email you a .cs file that illustrates this point. If you run the program it asks you the trigger interval you want to set. Then it generates around 200 triggers and saves the measured intervals (using QueryPerformanceCounter) in a file.
Can anyone tell me if its possible to get triggers every 5ms or so?
|
|
|
|
|
First, I don't think that you mean miliseconds (ms). 1000 miliseconds are one second, so you are saying that it only triggers every 15 seconds(!). I suppose you mean nanoseconds (or something alike, something small).
Second, much work is done 'behind the screen' when you do something in your program. Therefor, I suggest that you use a (for , do , while(true) ) loop to get what you want. You might even want to place the loop on a separate thread.
For the rest, I think that getting the intervalls lower is just a matter of optimization (i.e. using unsafe code blocks, maybe even P/Invoke to some Windows API).
- Daniël Pelsmaeker
"I will quote you when you say something memorable."
|
|
|
|
|
i meant what i wrote: 15.625 ms. Note the decimal point. Do you know any way I can change the resolution of DateTime.Now.Ticks so it can measure finer intervals?
|
|
|
|
|
fd97207 wrote:
Can anyone tell me if its possible to get triggers every 5ms or so?
Although I've never tinkered around with them myself, you should take a look a multimedia timers. They were designed for this kind of resolution. I think you're still going to have a problem with the garbage collector. Sooner or later it's going to want to do its business and halt every thread in your application.
|
|
|
|
|
I want to program a app that use Producer-Consumer Multithread model, I used to use WinAPI WaitForSingleObject & ReleaseSemaphore as a PV operator. Which .Net class can I use to implement to same ?
Thank you!
Let's roll!
|
|
|
|
|
See the class documentation for the System.Threading namespace in the .NET Framework SDK. There's lots of information in there. WaitHandle and its derivates have several wait methods that wait for the WaitHandle to be signaled. There's also classes for mutexes and monitors. If you use the lock keyword in C# against an instance of an object (a static object for synchronizing static resources, and an instance - if you prefer - for instance resources).
There's a good section on programming in .NET with threads. See Threading[^] in the .NET Framework SDK on MSDN Online for more information, which should be the first place you check (such as scanning what's available in the class library reference).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I need access to C# scripts for validating zip codes in three formats: ##### or #####-#### or
##### #### (no dash) & strings entered in forms @ ASP pages (running on .NET platform). Any help would be most appreciated! Many thanks!
Reed Eichner
reichner@satx.rr.com
|
|
|
|
|
Take a look at the validators -- RequiredFieldValidator, RangeValidator, and RegularExpressionValidator -- as they encapsulate all of the functionality that should allow you to determine if something is in the right format to be a zipcode. There are samples here on CP and in MSDN.
What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
|
|
|
|
|
John: thanks for your feedback! However, I'm not a proficient coder...do you have the links to the respective script (pre-written code) that I can download & incorporate into an ASPX page?
Reed
Reed Eichner
reichner@satx.rr.com
|
|
|
|
|
Great - don't even try, and rip other people's code off for something so simple. You won't learn anything that way.
Try reading the class documentation for these validators in the .NET Framework SDK. They even include samples. And things like the RequiredFieldValidator are so simple - all you have to do is set the control name to validate (ControlToValidate property) and an error message (ErrorMessage property) at the bare minimum.
Microsoft MVP, Visual C#
My Articles
|
|
|
|