Bug Report B18108
Visible to All Users

Failed to use Skins in a DLL form

created 18 years ago

Hello!
I am writting in connection with the following problem: when I use ExpressSkins in .exe application everything is ok, but when I use ExpressSkin in dll_form - skins do not work.

Is it possiable to use ExpressSkins in dll or not?

Please help me to decide this problem.

Thank you.
Waiting for your reply

Comments (2)
Serge (DevExpress Support) 18 years ago

    Hi Alexandr,
    Yes, you can use Skins in DLLs. Sorry, but we cannot precisely detect why the problem occurs in your situation due to the lack of information. Could you please supply us with a sample project demonstrating this problem? We can then take a look at it and try to find a solution.
    Thanks,
    Serge

    Serge (DevExpress Support) 18 years ago

      Hi Serg,
      Thank you for your reply. Here it is my project (skins in dll.zip) compiled in BDS 2006. DeveloperExpress v.27
      As I wrote in .exe skins work, but in .dll do not work.
      Thanks,
      Alexander

      Answers approved by DevExpress Support

      created 18 years ago (modified 12 years ago)

      Thank you for the sample, Alexander. It was very helpful. To resolve the problem, you must initialize GDI+ in your DLL. Here is the corrected code:

      Delphi
      Unit2.pas uses dxGDIPlusAPI; {$R *.dfm} procedure ShowForm(Handle: THandle); export; stdcall; begin Application.Handle := Handle; Form2 := TForm2.Create(Application); try Form2.ShowModal; finally Form2.Free; end; end; initialization dxInitializeGDIPlus; finalization dxFinalizeGDIPlus;

      In the meantime, I recommend that you follow the instructions described in the following Knowledge Base article:
       "How to avoid the "A class named AClassName already exists" error when using DLLs in your applications"
       Article ID: A1994 (http://www.devexpress.com/kb=A1994)
      The main idea is that you should compile both the main module of your application and all the loaded DLLs with the runtime packages of our components. This will prevent possible errors and in addition, you will be able to use our controllers through the entire application and its dynamic modules. I.e. you can put a SkinController only on the main module of your application.
      Feel free to contact us if you need any further assistance on this item.
      Thanks,
      Serge

        Show previous comments (2)

          Hi Alexander,

          DevExpress version 12.2.6 the unit dxGDIPlusAPIhas no statement dxInitializeGDIPlusDo you know why?

            I'm using Delphi XE4

            DevExpress Support Team 12 years ago

              In new versions, the dxInitializeGDIPlus and dxFinalizeGDIPlus methods were renamed to dxInitialize and dxFinalize, respectively, and moved to the dxCore unit.
              I hope you find this information helpful.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.