473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Modeless Form Ignores Keystrokes ONLY when called from VB.Net

I'm on a team converting a large VB6 enterprise solution
into a VB.Net solution. We've started small. In other
words, we're taking MS' advice and beginning with small
pieces. I've created a Windows Application (VB.NET) that
calls an ActiveX DLL (VB6) using a CreateObject followed
by a call to a visual class method in the object that
exposes UI functionality. If I load the VB6 dll in the
VB6 IDE and leave it running, then run the VB.Net
application, everything works fine. However, when I try
to run without preloading the VB6 dll, I get a 406 error
when executing frmForm.Show vbModeless. I found a
workaround on the web that indicated I should use
ShowWindow frmForm.hWnd, SW_SHOWNORMAL to show the form.
I implemented a wrapper function that shows the form this
way and call it everywhere I am showing a modeless form in
VB6. The form now displays properly, but now the form and
controls don't respond to keystrokes. I've put debugging
code in the ActiveX dll that shows that the Form
(KeyPreview = True) gets KeyDown, KeyPress and KeyUp
events. Also, the controls on the form all get the
KeyDown, Keypress and KeyUp events. I found a trouble
report on MS KB <http://support.microsoft.com/default.aspx?
scid=kb;en-us;187988> that indicated that the problem
arises because the ActiveX Control (or in this case DLL)
doesn't own the message pump for the VB6 form that is
loaded. I'd have to assume that the VB.Net form is the
parent who owns the message pump for the form. The events
are firing (as stated earlier), but the VB6 form isn't
getting them. Where are the events going? How can I
reroute them back to my VB6 form(s)? Any help would be
appreciated greatly.

Thanks!

Tony
Jul 19 '05 #1
0 2244

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

Similar topics

0
by: Andrew | last post by:
I get a Null Reference Exception if I close a modeless form (that is, a form displayed using Show()) when a selection is made from a ComboxBox. If the form is modal (displayed using ShowDialog())...
6
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
2
by: Legendary Pansy | last post by:
Hello, I'm trying to accomplish the impossible by trying to do something equivalent of this example found here http://www.c-sharpcorner.com/Code/2003/Dec/DialogTutorial.as Starting with "Listing...
1
by: andrew | last post by:
Hi there, I'm having a problem with a modeless form in my app. I have a main form in my app and a socket that waits on data from a server (I use BeginReceive/EndReceive for that) and when I...
0
by: Tony Pirkle | last post by:
I'm on a team converting a large VB6 enterprise solution into a VB.Net solution. We've started small. In other words, we're taking MS' advice and beginning with small pieces. I've created a...
2
by: proit_123 | last post by:
I am working on a windows forms application and have the following requirement. · I need to display a modeless dialog from the main form. o This allows user to continue to work with the...
8
by: proit_123 | last post by:
I am working on a windows forms application and have the following requirement. I have two projects in my application Project A and Project B. And Project A has the reference of Project B. I...
0
by: PGP | last post by:
When a form is created and shown modeless when is the form's finalize called? When would the the form's resources are getting released? when it is closed? I can have the following code in a...
5
by: PGP | last post by:
Sorry i asked the same question yesterday but did a bad job on describing the issue so here is a better description. This is in .NET Compact Framework. I have a form which creates modeless...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...

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.