Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

564 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