a .net framework bug

S

Shwu

I don't know where to report a bug to MS.

Here is the bug description:
I have an activeX created by ATL/C++, which shows a tree view with multiple
state checkboxes and icons. It works fine to embed the activeX to the main
form of a C# form application. If I create another subform to host the
activeX, let the main form calls the subform.ShowDialog() when a button on
the main form is clicked. The activeX's tree view in the subform does not
show any icon and checkbox at all.
If I call Application.Run(subform) in the Main method, the tree view's icon
and checkbox are all showed just fine.
I believe this is a bug of .Net Framework 2.0.

Thanks,

Shangwu
 
G

Gigasoft

Hi

This doesn't sound like a bug with the framework.

I can't follow your problem totally and I have some ActiveX or native DLL to
managed form experience. In my experience, I've never seen a problem.

When mixing native and managed code on a form, dynamically creating native
portions, best to maintain singularity of your forms. .NET can actually
create multiple separate instances of your forms if you're not careful,
which can cause oddness. Google .NET WinForm or Form Singularity. My
guess is this would solve your issue. Be sure to destroy native portions
when your form closes, best to do this explicitly and not rely on garbage
collection when mixing native/managed code.

best regards,

Robert Dede
Gigasoft, Inc.
www.gigasoft.com
 
S

Shwu

Thanks Robert for the response.

I am not mixing native code and managed code in my C# project. The ActiveX
control is a third party DLL. My .Net project is pure C#, nothing with
native code. As I said it is no problem to host the control in MainForm. The
problem is that the main form instantiates another form that hosts the
control.
Does your ActiveX show some image list and icons? What is the difference
between dynamically creating a control and dragging & dropping by the
Designer? What is the purpose to maintain singularity of a form?

Thanks again,

Shangwu
 
G

Guest

Shwu said:
Here is the bug description:
The activeX's tree view in the subform does not show any icon and checkbox at all.

This generally means that the application is using a comctl32 v5 ImageList
with a comctl32 v6 TreeView. Applications need to use matched versions. To
fix this, turn off EnableVisualStyles until you can get a version of the
ActiveX control which directly supports comctl32 v6.

Vista also makes the two versions compatible so this won't repro there.

--Rob
 
M

Michael C

Shwu said:
Thanks Robert for the response.

I am not mixing native code and managed code in my C# project. The ActiveX
control is a third party DLL. My .Net project is pure C#, nothing with
native code.

The native code robert is refering to is the dll. Things like this can
happen and they are not necessarily a problem with the dotnet framework.
Possibly the control has a bug that doesn't make it work too well in dotnet.
It is the control that is showing the fault isn't it? :)

Michael
 
S

Shwu

Thank you, Rob. You are right. The problem is related to the comctl32
version.

Shangwu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top