Solved

ASP component registration

Posted on 2000-05-17
2
195 Views
Last Modified: 2013-11-25
When I build an asp com object (in atl com wiz), i would like it not to be registered automaticaly... how can i do that?
0
Comment
Question by:amirl
2 Comments
 
LVL 1

Expert Comment

by:pepenieto
ID: 2825157
Try to change the settings (debug, release, or what you use):
Project->Settings->Custom build (tab):
Erase de "regsvr32..." command
0
 
LVL 1

Accepted Solution

by:
manoj_srivastava earned 50 total points
ID: 2826733
Hi amir
By default you will always find the FOLOWING TYPE OF DECLARATION IN THE HEADER FILE.
i AM PRODUCING THE CODE WHICH I HAVE WROTE FOR MY COM PROJECT.
AFTER THE CONSTRUCTOR DEFINITION YOU WILL FIND FOLLOWING MACRO

DECLARE_REGISTRY_RESOURCEID( IDR_BSLOCATION)

Use DECLARE_NO_REGISTRY()IN PLACE OF THIS  if you want to avoid any default ATL registration for the class in which this macro appears.



class ATL_NO_VTABLE CBSLocation :
      public CComObjectRootEx<CComSingleThreadModel>,
      public CComCoClass<CBSLocation, &CLSID_BSLocation>,
      public IObjectControl,
      public IDispatchImpl<IBSLocation, &IID_IBSLocation, &LIBID_VCADMINBSLib>,
      public IDispatchImpl<IBSLocationProfile, &IID_IBSLocationProfile, &LIBID_VCADMINBSLib>
{
public:
      CBSLocation()
      {
      }

DECLARE_REGISTRY_RESOURCEID(IDR_BSLOCATION)

DECLARE_PROTECT_FINAL_CONSTRUCT()

DECLARE_NOT_AGGREGATABLE(CBSLocation)

BEGIN_COM_MAP(CBSLocation)
      COM_INTERFACE_ENTRY(IBSLocation)
      COM_INTERFACE_ENTRY(IObjectControl)
      COM_INTERFACE_ENTRY2(IDispatch,IBSLocation)
      COM_INTERFACE_ENTRY(IBSLocationProfile)
      COM_INTERFACE_ENTRY2(IDispatch,IBSLocationProfile)
END_COM_MAP()

// IObjectControl
public:
      STDMETHOD(Activate)();
      STDMETHOD_(BOOL, CanBePooled)();
      STDMETHOD_(void, Deactivate)();

      CComPtr<IObjectContext> m_spObjectContext;

// ILocation
public:
       STDMETHOD (p_AddLocation)(/*[in]*/IDSSession* pDSSession,/*[in]*/BSTR bstrLocName,/*[in]*/BSTR bstrLocDescription,/*[in]*/BSTR bstrCurrentLocation,/*[in]*/BSTR bstrLocId);
       STDMETHOD (p_ModifyLocation)(/*[in]*/IDSSession* pDSSession,/*[in]*/BSTR bstrLocId,/*[in]*/BSTR bstrLocName,/*[in]*/BSTR bstrLocDescription,/*[in]*/BSTR bstrCurrentLocation);
       STDMETHOD (p_DeleteLocation)(/*[in]*/IDSSession* pDSSession,/*[in]*/SAFEARRAY *psaLocIds,/*[out]*/VARIANT* pvntErrorInfo);
       STDMETHOD (p_AssociateUnitstoLocation)(/*[in]*/IDSSession* pDSSession,/*[in]*/BSTR bstrLocId,/*[in]*/SAFEARRAY *psaUnitAssign,/*[in]*/SAFEARRAY *psaUnitRevoke);
       STDMETHOD (p_GetCurrentLocation)(/*[in]*/IDSSession* pDSSession,/*[out]*/BSTR *bstrLocId,/*[out]*/BSTR *bstrLocName);
       STDMETHOD (p_LoginAddLocation)(/*[in]*/SAFEARRAY* psaDBInfo,/*[in]*/BSTR bstrLocId,/*[in]*/BSTR bstrLocName,/*[in]*/BSTR bstrLocDescription);

//ILocationProfile
       STDMETHOD (p_GetLocationDetails)(/*[in]*/IDSSession* pDSSession,/*[in]*/SAFEARRAY *psaLocIds,/*[out]*/VARIANT *vntLocData);
       STDMETHOD (p_GetUnitsofLocation)(/*[in]*/IDSSession* pDSSession,/*[in]*/BSTR bstrLocId,/*[out]*/VARIANT *vntUnitData);
       STDMETHOD (p_GetUsersofLocation)(/*[in]*/IDSSession* pDSSession,/*[in]*/BSTR bstrLocId,/*[out]*/VARIANT *vntUserData);
       STDMETHOD (p_GetLocations)(/*[in]*/IDSSession* pDSSession,/*[out]*/VARIANT *vntUserData);
       STDMETHOD (p_GetLocationsforLogin)(/*[in]*/SAFEARRAY* psaDBInfo,/*[out]*/VARIANT *vntLocData);
};

BYE
THIS WILL SOLVE YOUR PROBLEM. NOW ATL WILL NOT REGISTER YOUR CLASS.


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need to create an object factory 2 44
Changing the installation path of this MSI 5 93
What is MicroStrategy.NET? 2 58
Having a different time zone on your task bar 3 53
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…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

914 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

15 Experts available now in Live!

Get 1:1 Help Now