|
Hi,
Just wanted to ask if any body has worked on interactive services using .NET 2.0... MSDN says : "The creation of interactive services is not supported. To workaround this, you can create a non-interactive service and a separate control GUI application that communicates with the service using sockets or remoting.", on ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref11/html/T_System_ServiceProcess_ServiceType.htm.
If some body could help me regarding creation of interactive services, it will be great help...
Thanks in advance.
Regards.
|
|
|
|
|
What it is about "you can't do this" that's hard to understand?? MSDN already described the process I was going to suggest.
You create two applications, one being the service with no UI, and the other being the Windows Forms app that talks to the service app over Sockets or .NET Remoting.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello!
It seems I can´t use SendMessage with WM_GETTEXT either GetWindowText to retrieve a label´s caption =/
I read about it and most of the people used ReadMemory, but it´s too complicated! and reading the label´s caption is not my main goal.
Does anyone have suggestion?
Thanks!
|
|
|
|
|
Then what IS the main goal??
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I use a dll to click on popup windows and what I need to do is just read a caption, then I know what is being clicked!
|
|
|
|
|
Hi,
I want to create Custom Control just like MessageBox.
also want to add all the functionality of the MessageBox.
Plz help me out.
It's Urgent.
|
|
|
|
|
Messagebox is not a control , its a dialog window that is invoked by a static method.
you can create something similair by doing:
public static class MyMessageBox
{
public static MyOwnDialogResult Show(string title,string message,.whatever params you want.)
{
MyOwnMessageBoxForm form = new MyOwnMessageBoxForm ();
form.Text = title;
form.lblMessage.Text = message;
... setup icons etc.
form.ShowDialog();
MyOwnDialogResult result = form.GetMyOwnDialogResult;
return result;
}
}
this way you can make your own messagebox return the kind of result you want yourself.
it is also possible by doing a bit of win32 hacking to display the "real" messagebox and alter things in it.
but I dont see much reason to do so, its easier to roll your own and you can easier adapt it to your own needs.
//Roger
http://www.puzzleframework.com
|
|
|
|
|
|
|
How to use Commandwindow, Immediate to interact with code in a project.
Can use it in Runtime?
Jey
|
|
|
|
|
SysJey wrote: Can use it in Runtime?
Yes
SysJey wrote: How to use Commandwindow
Just start typing in commands
SysJey wrote: interact with code in a project
You can query values in the current scope by typing something like: "? this.Text" which will output the Text property of the current object. You can also set values in a similar manner. Just try typing stuff and see what happens.
The Welsh will always support two teams: The Welsh, and anyone playing England
|
|
|
|
|
Say I want the value of the xml element <name> whats the best/fastest way to retrive it?
Thanks
|
|
|
|
|
See this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXPathXPathNavigatorMethodsTopic.asp
|
|
|
|
|
Thanks but a totaly out of context link to umpteen methods doesn't really point me to the best/fastest way of retriving a single value from an XML file.
Any chance of being more specific?
What I'm after is a way of storing/reading a config file in XML rather than a txt file.
But i wont bother if every method is a lot more convaluted than doing a Readline() on a text file stream.
I was a nice simple way to read an xml value from a given element.
|
|
|
|
|
The easiest way it to use XmlSerialize Class.
Just give your instance to that class, then it will be automatically converted to Xml file.
Or just give the filename, then you can deserialize it, and you get an instance of your class.
|
|
|
|
|
The easiest way is with an XPath query, so if you have a simple document, say:
<Config>
<Name>MySetting</Name>
</Config>
you would load that into an XmlDocument instance using the Load or LoadXML methods, so:
XmlDocument xmlDoc = new XmlDocument();<br />
xmlDoc.Load("C:\myConfig.xml");
XmlNode nameTextNode = xmlDoc.DocumentElement.SelectSingleNode("Name/text()");
string name = nameTextNode.Value;
You can read any value from the xml document with the correct xpath query. XPath is quite a big subject, and takes some getting used to, but there is an Xml forum here for specific path questions.
Note that the above code was written quickly and is untested, it is just to illustrate the sequence... it may not compile but should give you an idea to start playing with.
---
How to get answers to your questions[^]
|
|
|
|
|
|
Hi All,
I have a Client/Server App like VNC developed in C# where server sends the updated regions of its screen as compressed buffer to connected client. Client upon receiving the updates draw them approp. I have used windows hooks to inform my server app about the updates on the screen using windows messages.
I have added MessageFilter to my server app thread to receive my custom messages of screen updates from my hooking dll. The problem is that currently i m using an ordinary approach where i creates a rectangle and make union of it with other incomming rectangular region updates from dll. On the other side i have a thread that receives the final rectangle, clears the rectangle varibale of the messagefilter, take a screenshot of that final rectangle, compress it and send it to the client. This process repeats and each unioned rectangle is captured and sent to the client.
My problem is that in this approach a lot of updates like menu selection, text cursor, text etc. are missed.
Can somebody give me suggestion how can i improve this.
Another approach is to use Win32 Region where each rectangle is added to the Region and hence no chance of missing rectangle. But i need a pseudocode or code snippet if i want to use this one.
Thanx.
"Imagination is much more important than implementation"
|
|
|
|
|
Rashid.Mahmood wrote: and make union of it with other incomming rectangular region updates
Doesn't this just slow the process down (then you miss bits) isn't it better just to send each rectangle as it's updated rather than creating a new rectangle (which they'll be a slight delay, and loss of information if not fast enough).
The Welsh will always support two teams: The Welsh, and anyone playing England
|
|
|
|
|
U r quite right but here are some issues that enforces us to crrate a slight delay:
1. Clinet machine's drwaing speed
2. If i continuously capture each rectangle bitmap using Bitblt and then compress it to stream and then send it client then my CPU usage on server side reaches to upper limit.
So in this situation what should i do.
Thanx
"Imagination is much more important than implementation"
|
|
|
|
|
To be honest I would think that C# isn't quite quick enough to do this kind of thing unless you have a very fast machine. As a simple benchmark why don't you try (if you have a fast network) doing the streaming without compression.
If this is reasonable then you may need to come up with a faster compression and decompression algorithm (there are some benchmarks at http://www.7zip.org[^] I think ).
If it is too slow then either you'll need better performing functions and methods or (unfortunately) change to using either C++ or unsafe code in C#.
It might be worth trying C# with unsafe code (i.e. pointers etc) before trying the C++ route.
The Welsh will always support two teams: The Welsh, and anyone playing England
|
|
|
|
|
Hi All
In my application i read from some log file ( file name is XXX.log ).
I read line by using ASCIIEncoding - but when i read some line that contain the char '-' i see in the debug variable that i got the char '?' beside '-'.
What to do ?
Please someone can help me ?
|
|
|
|
|
If your log file in ASCII format, then you can read it using this code:
using(StreamReader sr = new StreamReader("XXX.log", Encoding.ASCII))
{
while(sr.Peek() >= 0)
{
string text = sr.ReadLine();
}
}
If your log file in Unicode, then change the Encoding.ASCII to Encoding.Unicode
|
|
|
|
|
Maybe there is some other solution ....
|
|
|
|
|
Can anyone tell me how to escape the dollar signs in a code snippet?
As a first attempt at writing a code snippet I've hit a bit of a snag. It seems that, what I thought would be a fairly simple first attempt, isn't.
I attempted to create a snippet so I could insert a block of code that the version control system could use to add its log message to the source file.
i.e.
#region Source Control File Version Log
#endregion
However, it seems in my haste I didn't realise that the $blah$ is supposed to be expanded out to something else when the snippet is inserted. When I insert the snippet in to the code a blank appears where $History: $ appears.
I've had a look around and I can't see anything about escaping the dollar signs (so I'm obviously looking in the wrong places).
Scottish Developers events:
* .NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy
* Developer Day Scotland: are you interested in speaking or attending?
My: Website | Blog
|
|
|
|