473,748 Members | 7,118 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hidden Toolstrips cause CFormView to crash

I am using CFormView and CWinFormsContro l in C++ to show a C# control.
The control includes a toolstrip container and various toolstrips. If
all the toolstrips are hidden (visible = false) on any of the
container's panels, a mouse click will cause a stack overflow.

The problem is in the PreTranslateMes sage() function of CFormView. It
calls _AfxNextControl . When that function tries to get the parent of
the hidden toolstrip, it gets null which throws it into an infinite
loop. If the toolstrip is visible, the correct parent is retrieved and
all works well.

Does anybody know how to fix this so the correct parent is returned?

Thanks,
Mike

Oct 12 '07 #1
1 1741
In case anyone else has this problem, it seems to be resolved by
removing the WM_EX_CONTROLPA RENT style from the toolstrip controls.

If there is a better way to resolve it, or if someone knows any reason
why I would not want to remove that style, please let me know.

On Oct 12, 9:19 am, Mike <MLM...@hotmail .comwrote:
I am using CFormView and CWinFormsContro l in C++ to show a C# control.
The control includes a toolstrip container and various toolstrips. If
all the toolstrips are hidden (visible = false) on any of the
container's panels, a mouse click will cause a stack overflow.

The problem is in the PreTranslateMes sage() function of CFormView. It
calls _AfxNextControl . When that function tries to get the parent of
the hidden toolstrip, it gets null which throws it into an infinite
loop. If the toolstrip is visible, the correct parent is retrieved and
all works well.

Does anybody know how to fix this so the correct parent is returned?

Thanks,
Mike

Oct 12 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1401
by: MLM450 | last post by:
I want to have toolbars that behave similar to those in Microsoft Word. I am using toolstrips and toolstripcontainers. How do I get them to allow the user to pull the toolstrip off the window edge and become a free floating window? Do I need to do this myself and, if so, what event should trigger this?
0
1221
by: Danielle | last post by:
This article here support.microsoft.com/support/kb/articles/q155/9/18.asp shows how to add scrolling to a CFormView. Its a shor paragraph of code. It works, but when I keep the progra with the scrolling open and then click another program I get an error at this line if (GetFocus()->m_hWnd == pWnd->m_hWnd
1
2467
by: Joe | last post by:
I have a few ToolStripContains and ToolStrips in my app and only want certain ToolStrips to be able to be dropped on certain ToolStripContainers. Is there anyway to do this? I tried the DragEnter event of the ToolStripContainer but it didn't help. Thanks, Joe
3
1584
by: guy | last post by:
If i have an MDI form, with tollstrips such as Menu, ToolBar or Status how do i stop a child form sliding under these toolstrips? eg when dragged or maximized. *guy*
0
1782
by: Jack | last post by:
This is probably trivial, but I'm unable to find the answer. In vb.net 2005, if I'm merging 2 toolstrips together using ToolStripManager.Merge, how do I control the order of the merged buttons? I've got a main toolstrip with 6 items. When I merge it with a second toolstrip, I want the second toolstrip inserted between items 3 and 4 of the main toolstrip. Thanks.
351
13051
by: CBFalconer | last post by:
We often find hidden, and totally unnecessary, assumptions being made in code. The following leans heavily on one particular example, which happens to be in C. However similar things can (and do) occur in any language. These assumptions are generally made because of familiarity with the language. As a non-code example, consider the idea that the faulty code is written by blackguards bent on foulling the language. The term...
1
1935
by: Rudderius | last post by:
Hey, I'm working on a winform app in VS 2005. I'm wondering if someone knows some best practices on how to organize the toolstrips. I have a menuToolStrip and some other toolstrips. As in many apps, the functionality of the toolstrip en the menubar overlap. (e.g. cut & copy etc) The commands I'm using for my application are more complex off course than just a copy and a paste.
0
1077
by: =?Utf-8?B?SnVzdGluIFJvYmVydHM=?= | last post by:
Hi I am developing a windows app. in VB using VS2005. I have multiple toolstrips (and toolstrip containers) where I want users to move buttons around (using {Alt} + drag) inside the toolstrips, and to move toolstrips across containers. However I want to prevent users dragging toolbuttons to different toolstrips. I thought MergeAction of MatchOnly would achieve this, but apparantly not. Does anyone know how I can stop this action?
1
1434
by: ramprat | last post by:
I am using a Dlookup to pull a value from my traffic table for a record prior to moving that record to a traffic_history table. I want to take the value and store it in a variable and then populate a new record in the traffic table with that value based on a unique PCID. This code is triggered by the click event of a button on my form after someone enters a new traffic count into my continuous form. The code takes the old count and puts it into...
0
8823
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9530
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8237
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4593
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.