Posted By: Viashivan | Dec 1st, 2008 @ 4:55 AM
page 1 of 1
Comments: 6 | Views: 1124
Hi there,
I've just created a WPF application like a simple Player, then I create the relative dll file.
I've also created a Win32 Application and I added my dll file created earlier.
The question is:
How can I do for to call/run that dll file in my Win32 Application?
I hope to be clear,
Thanks a lot,
Carmelo.
It wasn't all that clear.  An "application" is an EXE, not a DLL.  If you really did create a WPF application, just use one of the many "spawn" APIs to start the WPF application (CreateProcess, spawn, ShellStart, etc.).  If, however, you've created a WPF user control or something similar, and what to display that from a Win32 application, you'll need to use interop APIs.  http://msdn.microsoft.com/en-us/library/ms742522.aspx
jh71283
jh71283
Throw new System.Beverage. OutOfCoffeeException​()
Carmelo, a WPF application compiles to a .exe which can be executed alone.

If you have produced a DLL, tyhen it seems that you have created a WPF Control, which fo simplicity's sake, should be used in a WPF project (you need to reference it)

If you need to use it in Winforms, then you need to look up WPF / Winforms Interop. (Again, you need to add a reference to the dll you created, copying it in is not sufficient)

If it is a Win32 MFC app, then I don't think WPF will interop with that, but I could be wrong.
vesuvius
vesuvius
The Curious Incident of the Dog in the Night-time
Why are you trying to do this? Surely if you are writing something from scratch you may as well use the 1 tech, as your application is easier to maintain that way.

If I was upgrading a Winforms application, then I'd look at interop. Is this mostly a win32 app or a WPF one?
page 1 of 1
Comments: 6 | Views: 1124
Microsoft Communities