Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. C++ ATL Server project

C++ ATL Server project

Scheduled Pinned Locked Moved ATL / WTL / STL
c++sysadminoopquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    devvvy
    wrote on last edited by
    #1

    I was working on a C++ ATL server project and been using m_HttpResponse object like "cin" object to stream response back to client. However, I can't find where this m_HttpResponse object comes from, I searched the entire handler class declaration. m_HttpResponse is nowhere to be found. And what's more interesting is that the handler class doesn't derive from anything!?? And there's no #include or#using statements at the top of the header file: #pragma once [ request_handler("Default") ] class CMyHandlerClass //Derive from nothing - no inheritance observed! { //m_HttpResponse declaration?? }; The code works fine, just not sure why/how it worked. norm

    S N 2 Replies Last reply
    0
    • D devvvy

      I was working on a C++ ATL server project and been using m_HttpResponse object like "cin" object to stream response back to client. However, I can't find where this m_HttpResponse object comes from, I searched the entire handler class declaration. m_HttpResponse is nowhere to be found. And what's more interesting is that the handler class doesn't derive from anything!?? And there's no #include or#using statements at the top of the header file: #pragma once [ request_handler("Default") ] class CMyHandlerClass //Derive from nothing - no inheritance observed! { //m_HttpResponse declaration?? }; The code works fine, just not sure why/how it worked. norm

      S Offline
      S Offline
      Steve S
      wrote on last edited by
      #2

      Erm, aren't all request handlers done as CRequestHandlerT< yourclass [, CComSingleThreadModel [,CHtmlTagReplacer< yourclass >]] > anyway? That means they that yourclass doesn't need to derive from it... Steve S [This signature space available for rent]

      1 Reply Last reply
      0
      • D devvvy

        I was working on a C++ ATL server project and been using m_HttpResponse object like "cin" object to stream response back to client. However, I can't find where this m_HttpResponse object comes from, I searched the entire handler class declaration. m_HttpResponse is nowhere to be found. And what's more interesting is that the handler class doesn't derive from anything!?? And there's no #include or#using statements at the top of the header file: #pragma once [ request_handler("Default") ] class CMyHandlerClass //Derive from nothing - no inheritance observed! { //m_HttpResponse declaration?? }; The code works fine, just not sure why/how it worked. norm

        N Offline
        N Offline
        Nemanja Trifunovic
        wrote on last edited by
        #3

        Note this line: norm wrote: [ request_handler("Default") ] From MSDN: "The request_handler attribute will usually add CRequestHandlerT as a base class. If the soap_handler attribute has been applied to this class, CSoapHandler will be added as a base class instead. If the class to which this attribute is applied already derives from IRequestHandler, then no base classes will be added." To be honest, I don't like these attributes - they hide too much IMHO.

        D N 2 Replies Last reply
        0
        • N Nemanja Trifunovic

          Note this line: norm wrote: [ request_handler("Default") ] From MSDN: "The request_handler attribute will usually add CRequestHandlerT as a base class. If the soap_handler attribute has been applied to this class, CSoapHandler will be added as a base class instead. If the class to which this attribute is applied already derives from IRequestHandler, then no base classes will be added." To be honest, I don't like these attributes - they hide too much IMHO.

          D Offline
          D Offline
          devvvy
          wrote on last edited by
          #4

          Thanks. norm

          1 Reply Last reply
          0
          • N Nemanja Trifunovic

            Note this line: norm wrote: [ request_handler("Default") ] From MSDN: "The request_handler attribute will usually add CRequestHandlerT as a base class. If the soap_handler attribute has been applied to this class, CSoapHandler will be added as a base class instead. If the class to which this attribute is applied already derives from IRequestHandler, then no base classes will be added." To be honest, I don't like these attributes - they hide too much IMHO.

            N Offline
            N Offline
            nativespirits
            wrote on last edited by
            #5

            :confused: I understand what you've said here, however I cannot find why I constantly receive the error: error C3358: 'CSoapHandler': symbol not found I have the code exactly like the sample OnlineAddressBook from the MSDN library yet I get the error whereas that app does not. Such simple things can stop a programmer for hours. Here is the code I am using. Note that the Web Service this code is in compiles fine, it's when I compile the SRF (ATL Server) project that the error occurs, let me know if you need to see more code. // DataConsumerWS.h : Defines the ATL Server request handler class // #pragma once namespace DataConsumerWSService { const wchar_t MYDATASOURCE[] = L"Provider=SQLOLEDB.1;Persist Security Info=False;User ID=me;Initial Catalog=mine;Data Source=SERVER;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False"; // all struct, enum, and typedefs for your webservice should go inside the namespace // IDataConsumerWSService - web service interface declaration // [ uuid("2E179D71-E436-42EE-A1D6-00758BF3D7AA"), object ] __interface IDataConsumerWSService { // HelloWorld is a sample ATL Server web service method. It shows how to // declare a web service method and its in-parameters and out-parameters [id(1)] HRESULT GetStudents([out] int *arrSize,[out,size_is(*arrSize)] BSTR **NameList,[out,size_is(*arrSize)] LONG **IDList); // TODO: Add additional web service methods here }; // DataConsumerWSService - web service implementation // [ request_handler(name="Default", sdl="GenDataConsumerWSWSDL"), soap_handler( name="DataConsumerWSService", namespace="urn:DataConsumerWSService", protocol="soap" ) ] class CDataConsumerWSService : public IDataConsumerWSService { public: // uncomment the service declaration(s) if you want to use // a service that was generated with your ISAPI extension CDataConnection m_dc; HTTP_CODE InitializeHandler(AtlServerRequest *pRequestInfo, IServiceProvider *pProvider) { if (HTTP_SUCCESS != CSoapHandler::InitializeHandler(pRequestInfo, pProvider)) return HTTP_FAIL;

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups