Solved

ASP component registration

Posted on 2000-05-17
2
203 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

832 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