473,513 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in COleObjectFactory::UpdateRegistryAll in VC.Net

Hi Friends,

In our Automation server on VC++ 6.0, we are calling a static function,
UpdateRegistryAll(), of COleObjectFactory class
to register a list of factory objects of the server. In addition to the
interfaces, these factory objects includes a COleTemplateServer object as a
member object of the CWinApp derived class. The function UpdateRegistryAll
was registering all the interfaces successfully in VC6 but in VC7 it's just
registering one interface. This is because the second factory is the
COleTemplateServer and registration for this fails, after which the
registration does not proceed further leaving the remaining interfaces
unregistered. On debugging in source code for these classes I found that the
implementation of COleObjectFactory::UpdateRegistry is changed from VC6 to
VC7. I searched the MS knowledgebase but couldn't found any relevant
article. Please tell me if there's any clean was of getting all the
factories registrered.

Thanks a lot.

Regards,
Devender Khari
Nov 17 '05 #1
2 3173
I found the answer to this one. This was caused by a v 7.1 fix in the
Microsoft code (in UpdateRegistry) which uncovered another Microsoft
bug.

The solution is to remove the COleTemplateServer m_server in the
application object and all references to it. This only works if you are
not using the COleTemplateServer m_server.

This COleTemplateServer m_server code is put in by Microsoft when you
create an MFC doc/view project with Automation enabled. It is still put
in there in VC .Net 2003 v 7.1 and the call to UpdateRegistryAll fails.

Warm Regards,
Steve Graber

Nov 17 '05 #2
Thanks Steve for your response. We have done the following to work around
this problem.

We have derived our own class CMyOleObjectFactory from COleObjectFactory and
calling its UpdateRegistryAll which behaves like the earlier version. The
actual code changes are appended below.

Thanks again,
Devender...

//Included these three lines for header
#if !defined(CRIT_OBJECTFACTORYLIST)
#include "afximpl.h"
#endif //!CRIT_OBJECTFACTORYLIST

//Then defined my own class
class CMyOleObjectFactory:public COleObjectFactory
{
public:
static BOOL PASCAL UpdateMyRegistryAll(BOOL bRegister);
BOOL UpdateRegistry(BOOL bRegister)
{
COleObjectFactory::UpdateRegistry(bRegister);
return TRUE;
}
};

//Then replaced the call to COleObjectFactory::UpdateRegistryAll() with the
following line
CMyOleObjectFactory::UpdateMyRegistryAll(TRUE);

//Function definition
BOOL PASCAL CMyOleObjectFactory::UpdateProbeRegistryAll(BOOL bRegister)
{
AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
AfxLockGlobals(CRIT_OBJECTFACTORYLIST);
COleObjectFactory* pFactory;
for (pFactory = pModuleState->m_factoryList;pFactory != NULL; pFactory =
pFactory->m_pNextFactory)
{
((CMyOleObjectFactory*)pFactory)->UpdateRegistry(bRegister);
}
AfxUnlockGlobals(CRIT_OBJECTFACTORYLIST);
return TRUE;
}
<sg*****@neo.rr.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
I found the answer to this one. This was caused by a v 7.1 fix in the
Microsoft code (in UpdateRegistry) which uncovered another Microsoft
bug.

The solution is to remove the COleTemplateServer m_server in the
application object and all references to it. This only works if you are
not using the COleTemplateServer m_server.

This COleTemplateServer m_server code is put in by Microsoft when you
create an MFC doc/view project with Automation enabled. It is still put
in there in VC .Net 2003 v 7.1 and the call to UpdateRegistryAll fails.

Warm Regards,
Steve Graber

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3047
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
4
1890
by: David Morgan | last post by:
Hi This is a really weird problem. We have a website that has been running for about six months with no problems. We have recently moved it to a new server with a new ISP. The server is of a...
11
3733
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
7
3764
by: Keith Dewell | last post by:
Greetings! My current job has brought me back to working in C++ which I haven't used since school days. The solution to my problem may be trivial but I have struggled with it for the last two...
117
7102
by: Peter Olcott | last post by:
www.halting-problem.com
28
5172
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
3785
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
4870
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
4534
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
9
3621
by: AceKnocks | last post by:
I am working on a framework design problem in which I have to design a C++ based framework capable of solving three puzzles for now but actually it should work with a general puzzle of any kind and I...
0
7259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7158
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7380
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7523
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5085
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.