Solved

ASP component registration

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

760 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

21 Experts available now in Live!

Get 1:1 Help Now