Congratulation ! You find the right way to solve this problem!
step 1: regenerated .h .cpp .idl file according to http://blogs.msdn.com/b/dandris/archive/2008/06/30/help-how-do-i-send-data-in-my-ws-eventing-subscribe-message.aspx
step2: Create ScanDestinations xml block according to http://blogs.msdn.com/b/dandris/archive/2009/08/11/building-wsdxml-sections.aspx
step3: modify your m_pScannerProxy->SubscribeToScanAvailableEvent(m_pNotifyScanner,NULL,NULL); to
m_pScannerProxy->SubscribeToScanAvailableEvent(m_pNotifyScanner,pScanDestinationsElement,&bodyOut);
step4: The following elements are not found in "ScannerServiceTypeTypes.cpp"(auto
generated code by "WSDCODEGEN.EXE" from "WSDScannerService.wsdl").
- { &Namespace_Scan, L"ScanDestination" }
- { &Namespace_Scan, L"ClientDisplayName" }
- { &Namespace_Scan, L"DestinationResponse" }
Added to "ScannerServiceTypeTypes.cpp".
step 5: because we added 3 items into Namespace_Scan in step 4, so the length of Namespace_Scan grow from 409 to 412, so modify the 409 to 412 in your releted files.
Reference:
http://www.geekpedia.com/Thread44965_WS-Eventing-For-WSD-Scan.html
http://blogs.msdn.com/b/dandris/
Date Posted : March 31, 2012
Original blog Posted : http://blog.csdn.net/lcl_data/article/details/7416390