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

x
?
Solved

Error when creating a second instance of a COM control

Posted on 2004-09-21
7
Medium Priority
?
290 Views
Last Modified: 2013-11-26
Hi Experts,

I am developing a small COM control using Visual Basic 6.0. Everything works fine with the control until I try to make two simultaneously running instances of it. The first instance is created without any problems, however the second does give the following error:

Not enough storage is aviable to complete this operation

I have enough RAM and hard drive space available. I tried the same control with ASP and with a small Delphi application and I get the same error.

I suppose my control is somehow configured to run only a single instance, but I don't know how to control this. Can someone help?

Thanks!
TheAvenger
0
Comment
Question by:TheAvenger
7 Comments
 
LVL 10

Accepted Solution

by:
fds_fatboy earned 1000 total points
ID: 12110719
As a first guess:

Do you have any
        global variables?
        module level or static variables held in standard (not class) modules?
If so, be aware that all these variables will be shared between ALL instances of your control running. This can give unexpected results. If you have, you are almost certainly better off replacing them with other options - ask me if you need to know.

Otherwise - please post some code to let us see what is happening.
0
 
LVL 5

Expert Comment

by:KarcOrigin
ID: 12110740
What is your OS and which service pack you have installed?


0
 
LVL 20

Author Comment

by:TheAvenger
ID: 12110793
The OS is Windows XP, SP 1 and SP2 (two machines).

I have some global variables. I will try to move them in a class and come back with a post after it.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 26

Expert Comment

by:EDDYKT
ID: 12111130
0
 
LVL 20

Author Comment

by:TheAvenger
ID: 12111357
@EDDYKT: Unfortunately not
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 12111540
What do you do inside your COM object? Database accessing?


Is your COM object ocx or dll?
0
 
LVL 20

Author Comment

by:TheAvenger
ID: 12112824
It was a problem with the log I was using - it was using a file and probably locked it. I now use the Event Log of NT and it works just fine.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

971 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