mardi 26 mai 2015

How test function in window?

class CTest : public CWindowImpl<CTest>
{
public:
  CTest();
  ~CTest();

  BEGIN_MSG_MAP_EX(CTest)
    MESSAGE_HANDLER(WM_CLOSE, OnClose)
    ...
    CROSS_PROCESS_HANDLER(WM_HTTP_REQUEST_DATA, OnRequest)
  END_MSG_MAP()

  ...
};

class CTestXYZ : public CWindowImpl<CTestXYZ>
{
    // Accept DOWNLOAD_DATA Message 
    CROSS_PROCESS_HANDLER(WM_DOWNLOAD_DATA, OnDownload)
};

class CTestResponse : public CWindowImpl<CTestRes>
{
    // Accept DOWNLOAD_DATA_RESPONSE Message
    CROSS_PROCESS_HANDLER(DOWNLOAD_DATA_RESPONSE , OnResponse) 
};

First, I send message WM_HTTP_REQUEST_DATA to window CTest and execute function OnRequest;

Second, the function OnRequest will send message WM_DOWNLOAD_DATA to window CTestXYZ and ececute function OnDownload in other process;

Third, the function OnDownload download data and return it, and the function sends DOWNLOAD_DATA_RESPONSE to window CTestResponse, the function OnResponse will accept data.

Now, I need test the function OnRequest in according to the function OnResponse, so I want to use other function replace OnResponse.

So, how do I ? Thanks!

Aucun commentaire:

Enregistrer un commentaire