|
Thank you for your help.
After some research I found the following:
--
Let's assume you have two Windows Forms applications, running on a single machine and you want the two applications to be able to communicate with each other. Or suppose you have a Windows service which should exchange data with your GUI application. Which protocol can you use? Remoting!
This is one of the cases where the TCPChannel is extremely helpful as it allows you to specify rejectRemoteRequests="true" upon its construction which limits all incoming connections to the ones originating from your own machine. No need to take too many precautions about security in this case.
However: If you use fixed port numbers for WinForms to WinForms communication, you might run into troubles when running on Windows Terminal Services with two or more users trying to use your application at the same time
--
Unfortunately this is my case.
Spiros Prantalos
Miami the place to be!!
|
|
|
|
|
Okay, sorry, didn't understand quite what you were asking in the first post.
You could have a remoting object that merely keeps track of which ports are currently being used by a pair of applications, and perhaps even hands out ports to use. Of course, you'd have to configure the remote objects yourself, but this isn't a difficult thing (just more difficult to change since you have to recompile for some things).
If security is an issue, you could assign each user a key (if you have ActiveDirectory with Certificate Services installed and setup, just use the user's key) to communicate between application domains. If you configure the apps to use the same port, of course only the first user would be able to run it.
Finally, if you use a client-server type setup, you could use single call well-known objects so that multiple users don't interact with each other's sessions.
Just a couple of thoughts.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi i am inetrested in finding out if the caplock button is active or not ... Thats when the form loads... or if there is a way to like toggle the button to disable when it loads ...
Thanks
DaIn
|
|
|
|
|
P/Invoke the native function GetKeyState :
[DllImport("user32.dll")]
private static extern short GetKeyState(int virtKey); You would then pass 20 (VK_CAPITAL ) to get the CAPS LOCK key state. Fortunately (for good reason), the System.Windows.Forms.Keys enumeration members match up with the virtual key constants defined in winuser.h, so you can use (int)Keys.CapsLock instead for more readable code:
short value = GetKeyState((int)Keys.CapsLock);
bool on = (value & 0x0001) != 0;
myButton.Enabled = !on; It's important to mask out the high-order bit so you can check the status of the low-order bit. This is documented in the Platform SDK documentation for the GetKeyState , see so that for more information.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Before I go re-inventing the wheel, can anyone tell me if they have an SSL Stream Socket class? I already use TCP based cleartext socket communications to a server and want to enable SSL support for the same protocol going through an SSL proxy.
|
|
|
|
|
Mentalis.org (http://www.mentalis.org/soft/projects/seclib/) has a SSL Socket Class Library. It implements a SSL version of the Socket, NetworkStream, TcpClient, and TcpListener classes.
|
|
|
|
|
How do you add the bitmaps (without pulling teeth) to the menus?
Larry J. Siddens
|
|
|
|
|
Dr. GUI on MSDN had an article some time back that presented a pretty easy way of doing it: http://msdn.microsoft.com/library/en-us/dnaskdr/html/askgui11062001.asp[^].
You should also check out the articles here on CodeProject by searching the site. There has been several articles discussing other ways or even providing libraries if you don't want to write your own.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
So, there is no easy way to enable the XP styles for the menus like you can for the controls? Fooie!
Larry J. Siddens
|
|
|
|
|
XP visual styles have nothing to do with bitmaps on menu items. They are entirely independent of each other. You asked about menu item bitmaps - not XP visual styles.
I have written an article on XP visual styles here: http://www.codeproject.com/csharp/dotnetvisualstyles.asp[^]
If you are using .NET 1.1 or higher, you can also call Application.EnableVisualStyles() before you call Application.Run in your entry point method (Main ). That's also mentioned in the article forum for the article link I gave you above.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
You could use the Magic Library. It has Windox XP style menu components. You can get it on the code project site.
|
|
|
|
|
The user is going to be able to move listbox items up and down in the listbox. I want to use two buttons with upp-and-down arrows. Like the characters < and > but rotate them så they point up or down instead
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
So what's the problem? You want to know how to do it?
Either make a couple of images and use them on a couple of Button objects, or set the Font for the Button objects to Wingdings or something and choose the appropriate character for an up or down button (there are several). Use the Character Map application in Windows to help find which one is appropriate (Start->Programs->Accessories->System Tools->Character Map).
Using images as embedded resources in the dialogs you see with up/down arrows is what the .NET BCL uses, but either way works. Using a font to do it will also allow the arrows to match the system's current ControlText color.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
Either make a couple of images and use them on a couple of Button objects, or set the Font for the Button objects to Wingdings or something and choose the appropriate character for an up or down button (there are several). Use the Character Map application in Windows to help find which one is appropriate (Start->Programs->Accessories->System Tools->Character Map).
doh...
Thanks, I didn't think that far.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
In my app I want to create some tool windows, which can be auto-hide and docking like that tool windows of VS.net, with VC++.net. But I looked the MSDN and some samples, the tool window is like only to be created as addin to be used by other app. Please tell me how to do, thank you very much.
If you have some samples , could you send to me?
|
|
|
|
|
There's plenty of samples in this site, though most are in C#. If you truly understand .NET, however, you won't have any trouble translating this code to VC++.NET, because they all have equal access to the .NET base class library (BCL), or any other assembly for that matter.
Also, this is the C# forum. This question would've been more appropriate in the Managed C++ forum.
There are also existing libraries that do this, including a decently-priced commercial one developed by one of CodeProject's members, Phil Wright, at http://www.dotnetmagic.com[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
you can go to http://www.csdn.net and to search it that you want
|
|
|
|
|
Hi out there!
Anyone having a suggestion why this code doesn't work?
The transformer doesn't seem to interpret xsl.
<br />
XslTransform xslt = new XslTransform();<br />
xslt.Load(this.xslFile);<br />
<br />
XPathDocument mydata = new XPathDocument(this.xmlfile);<br />
<br />
StreamWriter sw = new StreamWriter(this.outFile);<br />
XmlWriter writer = new XmlTextWriter(sw);<br />
<br />
xslt.Transform(mydata, null, writer, null);<br />
<br />
<br />
writer.Close();<br />
Help appreciated a lot.
|
|
|
|
|
The code looks fine - your XSLT is probably wrong. Make sure you use XPath expressions in your XSLT document that use a namespace prefix assigned to the same namespace as the namespace-qualified elements and attributes in your XML document.
You can test to make sure it is correct by adding <?xml-stylesheet href="yourxsltfile.xslt" type="text/xsl"> to the top of your XML document, where "yourxsltfile.xslt" is an absolute or relative path to your XSLT document. Then open the XML document in Internet Explorer and see if you get what you want.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
how we can use winapi methods in c#
regards' Amir Jalaly
|
|
|
|
|
Nick Seng already gave you a helpful link below. P/Invoke uses the DllImportAttribute on external function declarations. You should read the SDK documentation for the System.Runtime.InteropServices namespace elements, include the MarshalAsAttribute which helps the framework marshal parameters (when necessary) for native functions and COM interop.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
How we can shut down the computer programically?
or Log off?
Regards' Amir Jalaly
|
|
|
|
|
ExitWindowsEx WinAPI function
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
|
|
|
|
|
I can not find this method and when i write method name in code i recieved compile error
Regards' Amir JAlaly
|
|
|
|
|
It's a function in the User32.lib API. Use P/Invoke to call this function from a C# Application.
Read more about P/Invoke here[^]
and ExitWindowsEx here[^]
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
|
|
|
|