|
<< Click to Display Table of Contents >> Navigation: Telegram > 2019 > 01 > 25 > Telegram_2019-01-25T23 |
2019-01-25T23:02:34
I need CustomContentHandlers Demo code in C++
2019-01-25T23:02:58
In my project I need to send xml data to client depending on the parameter they have provided and CustomContentHandlers demo is doing exactly what I want but it is in delphi and I am unable to convert it to C++ code.
2019-01-25T23:06:56
I tried but not working it says (404 file not found)
code writen by me
in ServerController.cpp
void __fastcall TIWServerController::IWServerControllerBaseConfig(TObject *Sender)
{
THandlers::Add(\\, \ GiveMeSomeXML\, new TContentXML());
}
in IW.Content.XML.cpp
__fastcall TContentXML :: TContentXML ()
{
}
__fastcall TContentXML ::
TContentXML ()
{
}
bool __fastcall TContentXML ::Execute(Iw::Http::Request::THttpRequest* aRequest, Iw::Http::Reply::THttpReply* aReply, const System::UnicodeString aPathname,
Iwapplication::TIWApplication* aSession, System::Classes::TStrings* aParams)
{
aReply->ContentType = \text/xml\;;
aReply->WriteString(\My xml content here\);
}
in IW.Content.XML.h
class TContentXML : public Iw::Content::Base::TContentBase
{
private: // User declarations
public: // User declarations
__fastcall virtual TContentXML ();
__fastcall
TContentXML (void);
virtual bool __fastcall Execute(Iw::Http::Request::THttpRequest* aRequest, Iw::Http::Reply::THttpReply* aReply, const System::UnicodeString aPathname, Iwapplication::TIWApplication* aSession, System::Classes::TStrings* aParams);
};
I know I have not converted it properly please help me