?????: AppWizard Win32 SAX ?????? ??? ??????? SAX C++ ?????

?????? ????????? ?????? ?????????
???? ???????: 276505 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

????? ?? ??????? ???? ???? ??????? (DOM) ? ????? ??????? API ?????? ?? XML (SAX) ?????? API ??? ??????? ????? ?????? XML ???? ???? ?? ???? ??? ???? ???? ????? ??? ????? ??????? ?????. ??? ???? ??????? ?????? ??????? ??? preprocess ?? ????? ????? ??????? XML ??? ???????? ??????.

?? ????? SAX ????? ??? ???? ?????? ?? APIs Java. ????? ???? XML Microsoft (MSXML) ??????? 3.0 ?????? Java COM ?????? ?? ????? ?? ??????? 2000 ??? ?? ?? ????????? ?????? ?? ?????? ?????? ?????? ??? ??? ????? ??? SAX ????? ?? Microsoft Visual C++ ? Microsoft Visual Basic. ?????? ??? ????? ?????? ????? (SDK) ????? ??????? ??? ?????, ???? ???? ???? ????? Microsoft (MSDN) ?????? ??? ?????:
http://msdn.microsoft.com/xml
?? ?????? ????? ??????? ?? SAX ???? ??? ????? ??????? ?? ????????. ??????? ??????? ?? SAX ?? Visual C++ ? ????? ??? ??????? ??? AppWizard Win32 SAX ???????? ??? ????? ?????? ???? ?? ?????? ???????? ??? ???????.

?????? ??? ?? ????? ?? ????????? ???????? ?????? ????? Appwizard Win32 SAX ????? ?? ?????? ???????? ? ??? ???? ???? ?? ??? ????? ??? ??????.

??????? ????

????? ????? ?????? ??????? ?? "???? ??????? ?? Microsoft":
SAXAppWizard.exe
????? ??? SAXAppWizard.exe ??? ??????? ???????:

?? ??? ??????????? ??? ??????
??? ????????
SAXAppWizard.awx116 ????????
a1.dsw1 ???? ????
a1.dsp2 ????????
a1.cpp???????? 5
a1ContentHandler.h2 ????????
a1ContentHandler.cpp3 ????????
SAXContentHandlerImpl.h3 ????????
SAXContentHandlerImpl.cpp4 ????????
StdAfx.h2 ????????
StdAfx.cpp1 ???? ????
Stock.xml1 ???? ????

????? ??? ?????? SAX ??????? ?? AppWizard

????? ?????? ?????? ?????? ????? COM. ?????? AppWizard ??????? ??????? ?????? ????????? ???? ????? ??? ????? SAX:
#import "msxml3.dll?" raw_interfaces_only
				
?????? ????? ?? ??? ?? ????? ?????? ?????? ???? ???? ??????? ?????? ????? COM ??????? ??? ??????? ???????? ????? DOM ?? SAX ? ??? ?????? ???? ????? COM ?????????? C++ ?? ?????? ??? ???? ????? _variant_t ? _bstr_t. ?? ??? ??????? ????? ??????? ?????? ?????? ????? ?? ???:
#import <msxml3.dll> exclude("IErrorInfo") high_method_prefix("_") raw_method_prefix("")
				
??? ???? ?? ????? ??? ?????? ????? ????? ?? ??????? ?????? ??????? ? ?? ??? ???? ?????? ???? ???????? ?? ???????. ??? ????? ?? ???? ???? ???? ??????? ???? ?? ??????? ?? ???????? SAX (??? ISAXContentHandler) ????? ??????? ???. ??? ??? ???????? ?? ?????? AppWizard ??? ????? ?????? (??? ???? ??????? SAXContentHandlerImpl) ???? ???? ????? SAX ?????? ???? ???????.

???????? ??? ???? ????? ???????? ???????? ?? ????? COM ??? ????? (QueryInterfaceAddRef ? ???????) ?? ??? ?????. ??? ?? ???? ??????? ???? ???? ?????? ? ??? ????? ??? ????? ?? ??? ??????? ??? ???????? ??? ??????? ????? ??; ??? ?? ??? ?????? ???? ??? ????? ?????? ??????? (??? ???? ??????? "????? A1ContentHandler: SAXContentHandlerImpl ??????").

????? ??????? AppWizard Win32 SAX

???? ??????? AppWizard ?? ????? ????? SAX Visual C++ ????? ????? XML ??? ???? ???? ????. AppWizard ???? ?????? ??? Stock.xml ?? ???? ??????? ???? ???????? ??????? XML ??????? ?????? ???????? ??????.

?????? ????? ????? ???? ??????? ???????:
  1. ??? ??? SAXAppWizard.awx ??? ???? ???? MSDev. ???? ???????? ???? ??????? Studio\Common\MSDev98\Template C:\Program Files\Microsoft ?????.
  2. ?? ?????? Visual C++ ?? ????? ????? ????. ???? AppWizard Win32 SAX ??? ????????. ??? ? ???? ??? ??????? (??? "?1") ?? ???? ??? ??????.
  3. ?? ???? ?????? ?????? ???? ?? ??????? ????????? ???? ??? ?? ???? ???? ?????. ??????, ??? ????? ????? ??????? ??????? ??????? ?????? ?? ??? ??????: startElement ??????? endElement. ???? ????? ??????? ??? (?? ??????? << ?? >>) ??? ????? ?? ???????. ???? ???"?????" ?????? ???????.
  4. ??? ????? ???????, ???? ??? ????? ??? ????? ?? ???? ????? ????? ?????? ????? ???????. ?? SAXContentHandlerImpl ? ??? ????? ?? ????? IXMLSAXContentHandler. ??? ????? ????? ?????? ?????? ?????? COM (QueryInterfaceAddRef ? ???????) ?? ??? ????? ????? ????? ?? ???? ???? ??????.
  5. ???? ????? ??? ??? ???? ???? ???? a1ContentHandler ???? ?? ??????? ???????? ????? ?????? (startElement?????? ? endElement) ??????? ??????? ???? ??????. ??? ????? ????? ??????? ??????: prt ????? ????? ??????? ??????? CreateInstance ??? ????? ???? a1ContentHandler.
  6. ?? ????? ????? "?????" ? ??? ???????, ???? ??? ???? ??????? ?? ?? ???? ?? ??????? ??????? SAX:
    1. ????? ??????.
    2. ????? ???? a1ContentHandler.
    3. ??????? ??????? putContentHandler ??????? ?? ???? XML.
    4. parseURL ?? ???? XML ? ??? ?????.
?????? ????? ????? ??????? ???? ??????? ???????:
  1. ?? ????? ????? "?????" ? ???? ????? ??????? ??? startElement ???????? ??? ??? ????? ??? ???????. ???? ?? ?????? ???????: pwchLocalName ?? ??? ????? ?????? ? pAttributes ?? ?????? ?????? ??????. ??????? getLength ?????? ??? ??? ?????? ???????? ????? ???? ?????? ????? ????????. ??? ???? ??????:
    prt(L"<%s", pwchLocalName, cchLocalName);
    int lAttr;
    pAttributes->getLength(&lAttr);
    for(int i=0; i<lAttr; i++)
    {
    	wchar_t * ln, * vl; int lnl, vll;
    	pAttributes->getQName(i,&ln,&lnl); 
    	prt(L" %s=", ln, lnl);
    	pAttributes->getValue(i,&vl,&vll);
    	prt(L"\"%s\"", vl, vll);
    }
    printf(">");
    					
  2. ???? ????? ??????? ??? ?????? ?? ????? ??? ????? ??? ?? ??? ???? ?????? ????????? ????????. ????? ???? ?? ????. ??? ???? ??????:
    prt(L"%s", pwchChars, cchChars);
    					
  3. ???? ????? ??????? ??? endElement ?? ????? ??? ????? ??? ?? ??? ???? ?????? ????????? ????????. ?? ???? ????? ????? ?? ??? ???????; ??? ????? ????? ???????. ??? ???? ??????:
    prt(L"</%s>",pwchLocalName,cchLocalName);
    					
  4. ????? ?? ?? ?????? ???????. ??? ??? ??????? ???? ?????? ??? Stock.xml ?????? ??????? ???????? (??????? ???????). ??? ????? ?? ??? ???? ????, ????? ?????? ??????? Stock.xml ?????? ?? ???? ???? ??????.

???????

???? ???????: 276505 - ????? ??? ??????: 14/????/1428 - ??????: 3.5
????? ???
  • Microsoft XML Parser 3.0
  • Microsoft Visual C++ 6.0 Enterprise Edition
  • Microsoft Visual C++ 6.0 Professional Edition
  • Microsoft Visual C++, 32-bit Learning Edition 6.0
????? ??????: 
kbmt kbproductlink kbdownload kbdownload kbfile kbhowto kbmsxmlnosweep KB276505 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????276505

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com