Click here to Skip to main content
15,888,323 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I know this is probably a dumb question but...

I have a need to create a DLL that displays a windows form when called from another application. However, I also need this form, in certain scenarios, to be a standalone application.

Right now, it's a fully working DLL that when called from another app, works as expected. I've been working on creating a "stub" exe that does nothing but reference and call the function in the DLL that displays the form. But then the thought came to me, is it possible to create this as an EXE that can be executed directly and still be able to reference it as a Class Library from another application?

What I have tried:

searching for info, but found nothing.
Posted
Comments
PIEBALDconsult 10-Jul-16 21:59pm    
Yes, make it an EXE. There is very little differnce between an EXE and a DLL. Other applications can use an EXE like they would a DLL.
Garth J Lancaster 10-Jul-16 22:34pm    
hmm, how does that work ? I'm thinking :-

a) load the exe into a memory stream of bytes
b) use Assembly.Load to load the bytes from (a) into the assembly cache
c) then use reflection on the Assembly to [get] the forms/classes ?
PIEBALDconsult 10-Jul-16 22:42pm    
You could, but you should just use it like a DLL -- add a reference and go.
Garth J Lancaster 11-Jul-16 0:23am    
cool, thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900