Solved

Automation

Posted on 1998-02-17
3
204 Views
Last Modified: 2012-05-04
I am sorry that the following problem may not have enough information but I will try my best to explain my situation.

I have written an automation object by Visual C++ 5.0 using its Class Wizard.  Then, the object is used in Visual Basic.  This object has several mehtods.  The methods are computational type and very TIME-CONSUMING but have been tested in the Windows Console mode and can be assumed that they are error-free.  

1) Now, the problem is when these methods are called by VB, it may sometimes pop out the Error Message Box "Automation Error".  

2) However, sometimes it works without any error but the result is different from what I obtained in the Windows Console mode.

 I'd like to know what's going on.  I really have no idea and if anybofy has appropriate suggestion given, I would grant the marks.
0
Comment
Question by:Harvey
  • 2
3 Comments
 
LVL 1

Author Comment

by:Harvey
ID: 1182413
Edited text of question
0
 
LVL 1

Author Comment

by:Harvey
ID: 1182414
Adjusted points to 200
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 1182415
The problem is that most OLE automation controllers have a timeout that when the time expires, it displays an error message saying that the server failed. You should look into breaking up your computation into smaller parts if possible. If it isn't possible, then you probably would want to change your mechanism from an RPC to a callback scheme.

That is instead of calling a function directly, you should call the server to set up some variables, set a callback function and call a function. The function should start a thread and the computation. When the computation is done, the server will call the callback with the results. This way, the actual connection time between the controller and the server is kept to a minimum.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now