|
You want a new process, not a new thread.
System.Diagnostics.Process.Start(@"C:\MyApp.exe");
|
|
|
|
|
I load the other reference in the form of .dll. So how would I call that as another process? Other thing, my main window, that is launches the other processes, will show all the windows open in the window menu, and the only way to interact with the other windows is by using the worker threads.
Thank you.
|
|
|
|
|
Read up on .Net app domains. What are you trying to do? Do you have to have a separate application or process running? Ok, only having one running app makes life easier so that you can use object references and all that. The app is already running, just show some forms without using threads. The UI is the UI. It should be thin. You don't have to model the UI after the physical implementation details (threads). Use the minimal amount of threads to do some work so that the UI isn't hung up waiting for a calcuation to finish (the UI remains snappy). When the thread is done, update the form UI to present it to the user. A form should not have much code in it, it is just the presentation to the user. Lookup BeginInvoke() on CP and google.
If you really want to have some fun, you could use .Net Remoting to talk between apps. This way you can have independent apps up and they can talk to each other. Usually this is done when you have the exes running on separate machines.
Jim
|
|
|
|
|
Thank you for your reply.
I decided to use BeginInvoke, insted of creating a new Thread. What I am trying to do, is to have a main window application, which basically will have a list of applications to run. These apps are coded in C# as well, so I have to add them as references to the main window application. If the user launches one of these apps, I needed to be independent, because if that app displays a dialog box, it should only lock the access to the parent of that dialog box (built in), but not the access to the main window application, or other apps that might of being launch from the main window application. I hope that creates a picture for you.
Thank you again
|
|
|
|
|
If you are going to launch exe's, then Process.Start (as previously mentioned) is what you want to call.
Personally, I would not be launching exe's, but rather referencing the assemblies and creating an object which does what the Main entry point does for each "app." This way you can setup communication (if you want to down the road) since everything is running under the same app domain. If there is a modal dialog, then well, shouldn't the user be held hostage in order to reconcile the OK/Cancel dialog
Jim
|
|
|
|
|
how create a toolbar that is active when the main window is active then deactive when the main is so too?
p.s. i want it will be conform to windows xp and vista.
tnx
|
|
|
|
|
Hrm... I've never done anything like this, but you might look up MDI... or Controled Single Document Interface.
Otherwise, you can have one Form be your parent Form... Once that form loads, have another Form pop up, with it's parent the main form. Both methods should be compatable with XP and Vista... You can set all properties on the parent... Or you can have the parent subscribe to a custom event fired by the child...
|
|
|
|
|
Hello,
I want to build what would appear as a TAPI driver to an application, but actually uses a proprietory protocol for call functionality, using a VoIP softswitch. The "driver" can be detected and used by apps like Outlook, ACT, Goldmine etc (as far as the app is concerned it's a TAPI driver) but under the hood, it's all different.
I don't know much about TAPI (but don't know if I need to.) How could I encapsulate my code so that other applications think it's a TAPI driver? When an application (like those above) searches for a TAPI driver on the system, how does it identify them?
Any suggestions would be appreciated.
Thanks
|
|
|
|
|
You need to build a TSPI.
Have a read of This[^] as a starting point,
If you want to make life easy, JulMar[^] have a nice library for taking the hard work out of writing a TSPI.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
|
How can I change the refresh rate to my monitor using a C# code? Do u have a sample of somthing like this? Thanks.
Da_Masca
|
|
|
|
|
Hi,
I'm trying to access functions residing in a VB6 exe. Does anyone know of a way to access these functions in C#.NET?
Thanks,
Shehzad
|
|
|
|
|
Hello,
Would anyone please give me any idea about making a trial version (time limited) of my C# Windows Software. Or if you know any cheap software tool who can do that. Is there any nice tool available who will do the following things
1] Obfuscators
2] Setup maker (installer) (With checking .Net framework and sql server installed or not, ..)
3] time limited trial version.
I would highly appreciate your responses..
Thanks and regards
|
|
|
|
|
Hi,
I have a background worker in my C# Winform who is responsible for inserting a record in a SQL table. At the same time I (as an user) can insert or delete a record in the same table while the background woerker is busy in the background. Now, when I perform some insert/delete in that table sometimes, I get Exception named "Exception has been thrown by the target of an Invocation". I think may be it was the time when two threads conflict by trying manipulating sql table at the same time. Can anyone give me any clue how to identify the problem and how to solve that problem please....
|
|
|
|
|
Hi,
I can only guess but I had this problem once when using Reflection. When you call some method/constructor with reflection and an exception is thrown within this call than this kind of exception will come up.
|
|
|
|
|
Perhaps you can catch the exception in code and take a look at the stack trace property on the exception object. Maybe that can help get you to a line of code that might lead you to the offending object.
Jim
|
|
|
|
|
Hi,
I'm writing a program which needs to know on which of the Desktop Icons a user has just clicked with the mouse (one left click, so it is 'selected').
Any help is appreciated
tnx
roy
|
|
|
|
|
Is there something you can do when you get the following error?
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {704A5DF0-5E32-11CE-BBBA-080036D90402} failed due to the following error: 80040154.
at IdispOleTest.Form1..ctor() in D:\Projects\IdispOleTest\Form1.cs:line 33
I'm trying to use functions exposed by a tlb file.
-> I've first tried just importing it, but that fails.
-> Then I tried by using Interaction.CreateObject and Interaction.CallByName . That worked except when You had to pass a *BSTR parameter.
-> Now I've tried importing the tlb in a C++ project (6.0) and importing it like that. That worked, but the methods (are public) aren't exposed (I even tried to compile it with the /clr command).
-> The last thing (which gaves this error) I've tried is using the tlbimp, that creates the dll for me (and exposes the functions)
Now I'm really at a loss... .
I hope somebody has some hint or something... Tnx!
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
|
Even that I've tried, however no change.
tnx for your idea.
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|
|
Hi,
I have a little socket problem. I'm writing a little Client/Server application. The server listens on a TCP port, using asynchronous methods (Callback methods). The client uses synchronous methods.
On both sides, I use a 1024 bytes buffer (byte[1024]) to get the data.
On the way Client -> Server, sending 1 Mbyte of data takes 11 seconds, whereas on the way Server -> Client, the same data transfer is almost instantaneous ! Knowing that both applications are running on the same machine, and the client calls the server "localhost". I also did the test on two separate machines using 100Mb ethernet, for the same result. Also, all is compiled in Release mode, as in Debug mode it took much longer !!!
Has anyone an idea for this performance issue ?
Thanks by advance !
Stéphane
|
|
|
|
|
Sorry, the time was lost in an underlying method ... The problem wasn't one !
Thanks !
|
|
|
|
|
Hi
I am a novice in c# (I am a Java programmer) but I have to make a dll in c# and before I begin, I have a question.
Will the dll I make run on winXP/2000 without any additional installations?
Frank
|
|
|
|
|
No, you will need the .NET framework which is not on those OS' by default. (same as Java needing the JVM)
|
|
|
|
|
Thanks that was what I thought. But is it not include in Service packs?
|
|
|
|