|
Since System.Windows.Forms.Button inherits from MarshalByRefObject, instances of System.Windows.Forms.Button could be used as cross-process proxies. No field of a potential proxy can be allowed to be passed by reference.
There's a fairly good treatment of it at here[^]
Why do you want to pass the structure by reference?
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
you should probably post some more code for people to be able to help you such as your definition of MyInfo struct and your setInfo function
|
|
|
|
|
Hi,
I have a C# windows app and I need to create a desktop short cut and a IE favorites short cut. Can anyone tell me how to programatically do this? I'd like to do this when my application first runs.
Thanks
|
|
|
|
|
|
I am running Visual Studio .NET 2002. When I create a user control via a project and add a reference to its DLL in a test project it does not appear in the toolbox. How do place my control in the toolbox?
Gary A. Hyslop
|
|
|
|
|
Right-click on the Toolbox and select Customize. Browse to your assembly and check the controls you want to add to the toolbox. There are other ways you can do this using the designer interfaces. See the System.ComponentModel namespace for more information (as well as System.ComponentModel.Design ).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How do you do it? Write click on your ToolBox and select Customize ToolBox , then select your dll from .NET Component tab.
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
I have written a consle application and wabt to exit the program if the user select the exit program option. Can u please write the code and the namespace details as well.
|
|
|
|
|
See the Environment.Exit method documentation in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
It ends the console window as well, I only want to exit the program.
|
|
|
|
|
No, it unloads the CLR and quits the application. If you start the command prompt and then run your application, you'll see it doesn't close the command prompt. If you simply execute your console application, a command prompt is started. When your application exits, the command prompt exits as well because it was only started for your console application.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
If the program is launched by double-clicking on the .EXE, the Console window will close when the app closes. You can't stop it.
But, if you double click on a shortcut icon that has a target line like this:
cmd /K "C:\full path to.exe"
then the Console will stay open after the user exists the program.
RageInTheMachine9532
|
|
|
|
|
Probably you could try
Process myProcess = Process.GetCurrentProcess() ;
myProcess.Kill();
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
The console that is launched with the process will also be killed. He wants to the console to stay open when the app is killed off. This has to be done by launching two seperate processes. The command shell first, then the command shell has to launch the app for this effect to be seen.
RageInTheMachine9532
|
|
|
|
|
Hi
I have a COM+ .NET components that runs as a Server application. I have to configure it for ExceptionManagement blocks, but I don't how to do it (not the ExceptionManagement block, but the location of the configuration file).
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
|
I forgot to mention that it is on Win2K. There is no Application Root Directory for this version of Windows.
For now, I only know of 2 ways, none of them elegant:
1- Put it in the Machine.config file
2- Create a dllhost.exe.config file
The problem with both solutions is that the configuration settings will be the same for all serviced components.
Tx for your time.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
I wonder if it's possible to simulate the mouse's click behavior thru SendMessage API function. I just want to know If you have came up to this idea before. For example, consider there is a File menu in the upper-left corner of my form, and say its (x, y) coordinates are (20, 20). Now, is it possible to open the File menu by sending a Click event with appropriate x,y coordinates using SendMessage API?
Don't forget, that's Persian Gulf not Arabian gulf!
Murphy: Click Here![^] I'm thirsty like sun, more landless than wind...
|
|
|
|
|
Yes. That's one of the things that SendMessage does. If you're not sure how to use it, read about the P/Invoke (Platform Invoke) functionality of C# and .NET.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
Hi.
im new to c# so pls bear with me and teach me.....
i have created an MDI app, so i have three forms. frmMain , frmChild1 and frmChild2.
in frmMain i have a button which will call frmChild2..
button click event
{
frmChild2 c2 = new frmChild2();
this.MdiParent();
c2.Show();
}
and in frmChild2 i have a button callin frmChild3(this is also a child of frmMain)
button click event
{
frmChild3 c3 = new frmChild3();
/* how do i assign frmMain as the parent form?... */
c3.Show();
}
i also have another problem when i click the button twice, two identical forms pop up...how do i check to see if the form is already open, just direct the user to it and if its closed then open one?...
|
|
|
|
|
At the button click event in form2 use
objfrm3=new frm3();
objfrm3.MdiParent=this.MdiParent;//Assigns Parent of frm2 as parent of frm3
objfrm3.Show();
and regarding your problem of multiple forms opening
use a counter to count no of instances of form and before instantiating check the value of the counter
|
|
|
|
|
Is it possible to use Cache in a windows form application? if yes, how do i do that? pls advice...
|
|
|
|
|
Sure. But the methods used depend entirely on what your trying to cache.
RageInTheMachine9532
|
|
|
|
|
Basically values from the database that has been stored into a hashtable... this hashtable will then later be inserted into a cache... i have tried doing it in asp.net by using System.Web; using System.Web.Caching to enable the use of Cache. so now i m actually wondering whether this could be used in a windows form application. can a windows form application call to this cache...?
|
|
|
|
|