Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7063023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:39:52+00:00 2026-05-28T04:39:52+00:00

I am developing an extension for existing application via COM. Current interface of the

  • 0

I am developing an extension for existing application via COM.

Current interface of the application to extend allows to create custom property windows and use them inside that application.


Now, I am using .NET for that purpose and have strange problems:

    extensionForm = new Form();
    extensionForm.SetBounds(0, 0, 100, 100);
    extensionForm.Controls.Add(new Button());
       
    ExApplAPI.AddCustomPropertyWindow(extensionForm.Handle.ToInt32(), "Ololo");

As you can see below, the property sheets actually get extended, but after that something strange starts to happen.

enter image description here

Basically, if I switch to Ololo tab, then back to any of other 3 tabs (Attributes, Drawing or Services), the application freezes. I also know that the freeze happens inside of some unmanaged code block.


Another interesting fact here is that if I don’t write the extensionForm.Controls.Add(new Button()) (with or without the Suspend / Resume Layout calls), everything works fine. So, if the recently constructed form has no controls (buttons or any other) on it, it doesn’t freeze.

Here is a Spy++ log on the Ololo window right before the freeze (last message is the WM_CTLCOLORBTN, right after that the application became frozen):

enter image description here


Combining everything together:

  • Freezing happens only if I switch from Ololo to some other tab and then switch to the Ololo tab again.
  • Freezing only happens if the integrated form has at least one control on it, forms without controls don’t freeze.
  • Application is not running any managed code at the moment and is not spending any CPU time.

So – any ideas / similiar problems solved / etc to help me in this case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:39:53+00:00Added an answer on May 28, 2026 at 4:39 am

    The Win32 HWND handles for the Forms in .NET are lazy initialized.
    And I think this may be a problem here.

    You may argue that the handle is created in your line ExApplAPI.AddCustomPropertyWindow(extensionForm.Handle.ToInt32(), "Ololo"); due to accessing Handle property.
    It is true and what documentation acknowledges.

    However, it creates the handle for the Form itself, but handles for child controls (Button in this case) are not created. This can be forced by calling CreateControl method. See more documentation.

    I don’t know if not having a handle for button may be a cause of your problem, but this is definitely something I would investigate.

    To summarize, I suggest changing your code to:

    extensionForm = new Form();
    extensionForm.SetBounds(0, 0, 100, 100);
    extensionForm.Controls.Add(new Button());
    
    extensionForm.CreateControl();
    ExApplAPI.AddCustomPropertyWindow(extensionForm.Handle.ToInt32(), "Ololo");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are developing an extension (in C# .NET env.) for a GIS application, which
I'm developing an extension to MATLAB's PsychToolbox that allows for better control of the
While developing a firefox extension, I create a wizard window from overlay.js using: this.wizard
I am developing a web application. I would like to extend my error messages
I'm am developing a Firefox extension which interfaces with an underlying Windows service (which
I'm developing a Firefox extension and would like to track its use with google
I'm developing a chrome extension where I need to create dynamic sub-contextMenus based on
I am developing an extension to an existing app which uses sqlalchemy 0.6. The
I’m interested in developing an iPhone application using Visual Studio and C#.NET on Windows
I'm developing an extension, and basically need to replace text in current window. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.