Go Premium for a chance to win a PS4. Enter to Win


Component Request Pending

Posted on 1998-11-09
Medium Priority
Last Modified: 2008-02-20
I have an ActiveX EXE and and ActiveX Dll and from within the EXE I call a standard form from inside the Dll. This form uses the EXE as the background and the standard form from the Dll is shown in the foreground. At this point if I was to click on the EXE in the background I get an Ole Component Request Pending message that I would like to capture and do away with. The VB help file doesn't seem to give that much information on this topic. Is it even possible?

Thanks for any help you may have.
Question by:Profund
  • 2
  • 2

Author Comment

ID: 1443945
LVL 13

Accepted Solution

Mirkwood earned 600 total points
ID: 1443946
I can tell you what is happening.

An ActiveX exe is a process on its own. It gets its own processor time. When you call an ActiveX exe, the caller has to wait for the answer of the ActiveX exe. This means that the application need to be synchronized. Your calling EXE is not disabled but only waiting. That means that when you click on a form of the calling process (EXE) that windows has to remove this message since your EXE is waiting. At this moment the dialog box comes up.
What can you do to solve it? Not much.
First of all. Don't make the caller wait. With that I mean that the ActiveX exe should return with an answer as quick as possible but this is ofcourse not always possible.
Another solution is to make the ActiveX exe a DLL, which is also not always possible.
The third solution is to make the calls asynchronious. The ActiveX exe receives the call, marks it self as busy (and thereby ignoring all other calls, you have to make sure of that yourself) and return immediatelly. When it is finished it can notify the parent that it is finished. The most easiest way to do it is using a timer. The best way to do it is to start another thread, which is not easy is VB (very difficult).

Here is some psuedo code. This code is controlling the state of the EXE in stead of letting windows do it. Like you have seen with the window. It makes it sometimes a littlebit harder.

---Caller EXE---
sub command1_onClick
end sub      

sub ActiveXExe_Done
    msgbox "ActiveX EXE is finished"
end sub

---ActiveX EXE---
event Finished
Dim withevents form1timer1 as timer

public Sub DoitAsync
    if (busy) then err.raise -1, "Server is busy"
    busy = true
    form1timer1.enabled = true
end sub

private sub form1timer_tick
    form1timer1.enabled = false
    <Do your stuff here>
    busy = false
    raiseevent Finished
end sub

private sub class_initialize
   load form1
   set form1timer1 = form1.timer1
end sub

private sub class_terminate
   set form1timer1 = nothing
   unload form1
end sub

Author Comment

ID: 1443947
Thanks for the input but I think we are not quite on the same page. I only have an ActiveX EXE which is my caller and the ActiveX Dll is what I am calling. The ActiveX Exe opens a form, in my case an MDI, and then at some later time the user can call a form from within the ActiveX Dll which I make the foreground window through an API call. Now I have the small Dll form in the front and the MDI form from the ActiveX Dll behind it. It is when I click on the MDI that I get this Request Pending message saying a request to the Dll is still waiting. I do not want to end the connection to the Dll, however, until the user closes out the small form. Will your code and use of a timer still work? You also mentioned that making one of my apps a Dll would be a solution. If so, does this change or give you some new ideas?

LVL 13

Expert Comment

ID: 1443948
Who calls the activeX executable?
If nobody calls your activex executable, change it to a standard exe.
BTW: Microsoft warns for loading forms from another DLL.

You can also make one form the owner or parent of the other form and start the form modal. This way the user will not be able to close the other form until the topmost one is closed.


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

885 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