?
Solved

COM In-process components and modal forms

Posted on 1998-09-19
5
Medium Priority
?
206 Views
Last Modified: 2008-02-26
VB5/Win98

I have written an in-process component in VB that displays both modal and non-modal forms based on actions in the client app (also written in VB.) The problem is, when I display a modal form in my component and then click on the client apps form I get a strange message that reads: "Component Request Pending"
"An action can't be completed because component (Project1) is not responding. Choose switch-to to activate the component and correct the problem."  I have to buttons to choose, "Switch-to..." and "Retry". The "Switch-to" button gives the focus back to the component modal form. What is this message about and how can I prevent it from being displayed to the end user.
0
Comment
Question by:armg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:clifABB
ID: 1435696
I've never seen this error with an in-process component, only an out-of-process component.
Basically and in-process is just that.  It's running in the same process space as the application that's calling it.  There can be nothing to "switch to".  Perhaps you have compiled it incorrectly?
0
 

Author Comment

by:armg
ID: 1435697
One very important thing I failed to mention is that my client app is itself compiled as an ActiveX EXE. The reason is that my server component needs to make callbacks to the client app.
0
 
LVL 6

Accepted Solution

by:
clifABB earned 400 total points
ID: 1435698
Strictly speaking, your in-process is actually out-of-process.
While VB5 now allows you to use Modal dialogs in out-of-process, you are seeing the prime caveat to using them.
I would suggest, and indeed am going to answer, that you display your dialogs as non-modal.

0
 

Author Comment

by:armg
ID: 1435699
Do I understand you correctly to say that when a standalone ActiveX EXE instantiates an in-process ActiveX DLL component, that it actually is equivalent to and out-of-process component? This seems to be a significant weakness of COM or VB's implementation of it. From what I can tell, if I were able to invoke the components modal form .Show method like this, Form1.Show 1, ClientForm , then the client apps form could not be activated while the components modal form is displayed. The only problem is, I can't pass a Form reference from the client app to my server component because Form objects are built from a private class that can't be declared as parameters or return values from methods/properties of public class modules. My client app and server component can only communicate via public class interfaces. This seems to be a flaw in VB to me, is this still the way it works in VB6?
0
 

Expert Comment

by:geira
ID: 1435700
I have had the same problem, the only way I have found out to solve this problem is to implement async. callback, - cut the connection between the calling app. and you COM-module with the settimer function, and give notification back to the calling app. via a raiseevent.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month12 days, 13 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question