Click here to Skip to main content
15,915,324 members
Home / Discussions / C#
   

C#

 
GeneralRe: DoubleClick and Click Events ... Left Mouse Button Pin
Heath Stewart21-Dec-04 13:01
protectorHeath Stewart21-Dec-04 13:01 
GeneralTabPage and DataGrid - weird behavor Pin
Wjousts21-Dec-04 6:23
Wjousts21-Dec-04 6:23 
GeneralUsing WMI Pin
realmontanakid21-Dec-04 4:58
realmontanakid21-Dec-04 4:58 
GeneralRe: Using WMI Pin
Heath Stewart21-Dec-04 12:41
protectorHeath Stewart21-Dec-04 12:41 
GeneralC# app stopping windows from shutting down Pin
mikey_g21-Dec-04 2:56
mikey_g21-Dec-04 2:56 
GeneralRe: C# app stopping windows from shutting down Pin
Michael Potter21-Dec-04 5:07
Michael Potter21-Dec-04 5:07 
General.NET DLL with Main() method to be put on separate process Pin
Kausthubh Rajendran21-Dec-04 2:47
Kausthubh Rajendran21-Dec-04 2:47 
GeneralRe: .NET DLL with Main() method to be put on separate process Pin
CoolDadTx21-Dec-04 4:02
CoolDadTx21-Dec-04 4:02 
If I understand your question correctly then I don't think it is possible. You want to define your application entry point in a separate assembly. I know the IDE won't let you do it and I believe the command-line compiler will not let you do it either. The problem is that .NET uses delay-load on assemblies so the dll containing the entry point won't be loaded until it is needed (after the application starts). The entry point has to be defined before the application starts. I may be wrong here but I don't see a way of doing it directly. You could possibly do it through MSIL.

In regard to your intentions I don't think it'll give you what you want anyway. You can't "put" a DLL into another process directly. Due to the way dlls are loaded into Windows you can't simply load a dll into a process and then move it to another process. It would be a security hole. Debuggers and profilers get around it by debugging the app. This gives them direct access to the process'es memory. There is also an API to access a process'es memory directly but you have to basically be an admin before it'll work.

Irrelevant of all this if a method throws an exception, inside a dll or otherwise, then the parent application will be affected unless the method or one of its callers catches the exception. Having your entry point in a dll does nothing toward exception handling.

A way to get some of the functionality you want, putting the entry point into a dll, would be to call the entry point within the dll directly in the application main.

For the exception handling you should hook into the unhandled exception framework defined by .NET. For Windows Forms handle Application.ThreadException event. For all apps you can also handle the AppDomain.UnhandledException event. In both cases though you'll have no idea what happened and your program state should be considered to be corrupted.
QuestionCompiler directive for classname/membername insert ? Pin
fracalifa21-Dec-04 2:26
fracalifa21-Dec-04 2:26 
AnswerRe: Compiler directive for classname/membername insert ? Pin
Daniel Turini21-Dec-04 4:37
Daniel Turini21-Dec-04 4:37 
AnswerRe: Compiler directive for classname/membername insert ? Pin
leppie21-Dec-04 9:38
leppie21-Dec-04 9:38 
GeneralDoubleBuffer problem .. Pin
Sharpoverride21-Dec-04 1:28
Sharpoverride21-Dec-04 1:28 
GeneralRe: DoubleBuffer problem .. Pin
Gary Thom21-Dec-04 4:39
Gary Thom21-Dec-04 4:39 
GeneralRe: DoubleBuffer problem .. Pin
Dave Kreskowiak21-Dec-04 5:28
mveDave Kreskowiak21-Dec-04 5:28 
GeneralRe: DoubleBuffer problem .. Pin
Heath Stewart21-Dec-04 12:38
protectorHeath Stewart21-Dec-04 12:38 
GeneralRe: DoubleBuffer problem .. Pin
Dave Kreskowiak21-Dec-04 16:20
mveDave Kreskowiak21-Dec-04 16:20 
GeneralRe: DoubleBuffer problem .. Pin
Heath Stewart22-Dec-04 6:12
protectorHeath Stewart22-Dec-04 6:12 
GeneralRe: DoubleBuffer problem .. Pin
Dave Kreskowiak22-Dec-04 11:53
mveDave Kreskowiak22-Dec-04 11:53 
GeneralRe: DoubleBuffer problem .. Pin
Skynyrd21-Dec-04 10:44
Skynyrd21-Dec-04 10:44 
GeneralRe: DoubleBuffer problem .. Pin
Sharpoverride22-Dec-04 23:40
Sharpoverride22-Dec-04 23:40 
Generalcalling a function in a subclassed window Pin
stefan houtz21-Dec-04 1:28
stefan houtz21-Dec-04 1:28 
GeneralC# XPath Problems Pin
Chua Wen Ching20-Dec-04 23:00
Chua Wen Ching20-Dec-04 23:00 
GeneralRe: C# XPath Problems Pin
Heath Stewart21-Dec-04 12:36
protectorHeath Stewart21-Dec-04 12:36 
GeneralDisplaying IIS directories/sites in C# Application Pin
Adnan Siddiqi20-Dec-04 22:43
Adnan Siddiqi20-Dec-04 22:43 
GeneralRe: Displaying IIS directories/sites in C# Application Pin
Heath Stewart20-Dec-04 22:53
protectorHeath Stewart20-Dec-04 22:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.