0

I have a class library which is called through COM from a Third Party RAD application (Omnis Studio), the library provides .NET functionality such as a SQL/Web Service bridge. I've had to add further methods to display a WPF form which fires events back to the original application.

This all works fine, the project has to be a class library and could not be an executable which meant that I cannot select a manifest for the project in the Application Options Tab. The main problem I have now is that without the piece of XML below in my manifest file I cannot get the modern windows dialog buttons so the buttons in message boxes look somewhat antiquated.

<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->

<dependentAssembly>
  <assemblyIdentity
      type="win32"
      name="Microsoft.Windows.Common-Controls"
      version="6.0.0.0"
      processorArchitecture="*"
      publicKeyToken="6595b64144ccf1df"
      language="*"
    />
</dependentAssembly>

So is there a way that I can achieve the same effect from having those lines in the manifest file but performed by bespoke code in an entry point into the class library?

Thanks

Paul

EDIT

To add clarification for Rahmound's comment:

I don't think you understood the question. Firstly I made no mention of this being a Windows Form application, there are zero Windows Forms assembly references in the project, only WPF presentation assemblies. The project has to be a class library as the THIRD party application (which is a C++ unmanaged application) can only consume .NET class libraries, there was a need to display a very custom form, this could be achieved in the current project and I chose WPF because that's where most of my desktop app skills lie and it suited WPF's databinding model. We are very pleased with the end result, the only issue I have is with my application needing to use XP+ themed Windows controls, if that section above is not in the app.manifest then instead message boxes use the old style OK, Cancel buttons which is not in keeping with all other buttons I have in my application.

This question explains the message box problem

What I need is to be able to achieve the same thing but without having the embedded app.manifest.

Community
  • 1
  • 1
Paulie Waulie
  • 1,690
  • 13
  • 23
  • Why did you use WPF when the rest of your application is Windows Forms? Furthermore if you needed a "class library" why did you use create a WPF application to begin with? I should add that you can host WPF content within a Windows Form. – Security Hound Mar 08 '12 at 17:38
  • @Ramhound I've appended to my question with further information. – Paulie Waulie Mar 09 '12 at 08:58
  • The manifest in the main EXE selects the visual style used in all the app's windows. Including yours. This is an odd problem to have in a WPF app, styling is its middle name. Create your own MessageBox, I guess. – Hans Passant Mar 09 '12 at 09:15
  • @HansPassant Thanks for the suggestion, it is an odd scenario but as is often the case the business needs defy standard logic, I was actually thinking this morning of doing that or maybe use the WPF Extended ToolKit. – Paulie Waulie Mar 09 '12 at 09:21

1 Answers1

0

I couldn't solve this and time was running out, following on from Hans suggestion I ended up using the Extended WPF Toolkit as I also wanted to use other controls such as the ColourPicker.

Paulie Waulie
  • 1,690
  • 13
  • 23