本文整理汇总了C++中OpenDocument函数的典型用法代码示例。如果您正苦于以下问题:C++ OpenDocument函数的具体用法?C++ OpenDocument怎么用?C++ OpenDocument使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OpenDocument函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: OpenDocument
STDMETHODIMP CECR::Cut(BSTR FirmID, LONG CutType, LONG* ErrorCode)
{
if(!bDocOpened)
{
OpenDocument(FirmID, DEP_NO, ErrorCode, NonFiskDocument);
if (*ErrorCode == E_SUCCESS)
PrintBuffer(FirmID, ErrorCode);
}
InitCmd();
// команда
to_numeric(215, m_Cmd, 3, m_Len); //CLOSE
// пароль
to_char(OPERATOR_PASSWD, m_Cmd + m_Len, 4, m_Len);
// обрезать чек
to_numeric(CutType, m_Cmd + m_Len, 1, m_Len);
m_RspLen = 0;
m_ECRList.PassCmd(FirmID, m_Cmd, m_Len, m_Rsp, m_RspLen, ErrorCode);
if (*ErrorCode == E_SUCCESS)
{
ClearPrintBuffer();
bDocOpened = FALSE;
}
return S_OK;
}
开发者ID:Dennis-Petrov,项目名称:Cash,代码行数:27,代码来源:ECR.cpp
示例2: LogError
BOOL DocRoot::OnOpenDocument(const char* pszPathName)
{
if (gs_pPrj->pPrjDoc==NULL && !gs_pPrj->bDoingLoad)//sPrjFile.Length() > 0)
{
LogError("SysCAD", 0, "A project must be opened or a new project created.");
bIsOpen = True; //ensures document/window is closed properly
return False;
}
gs_pCmd->ProcessAStr("\x1b"); //Ensure there are no half complete commands
gs_pCmd->ProcessAStr("\x1b"); //Ensure there are no half complete commands, call more than once!
OnAttachDoc(); // to connect and attach document to cmdblks
//Strng Cmd;
//Cmd.Set("LOAD DOCUMENT %s\r",pszPathName);
//gs_pCmd->ProcessAStr(Cmd());
OpenDocument(pszPathName);
bIsOpen = True;
//OnActivate(True); // to connect and attach document to cmdblks
//gs_pCmd->SetDocForCmds(NULL);
return True;
}
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:25,代码来源:Docroot.cpp
示例3: TEST_F
TEST_F(FPDFDocEmbeddertest, DestGetPageIndex) {
EXPECT_TRUE(OpenDocument("testing/resources/named_dests.pdf"));
// NULL FPDF_DEST case.
EXPECT_EQ(0U, FPDFDest_GetPageIndex(document(), nullptr));
// Page number directly in item from Dests NameTree.
FPDF_DEST dest = FPDF_GetNamedDestByName(document(), "First");
EXPECT_NE(nullptr, dest);
EXPECT_EQ(1U, FPDFDest_GetPageIndex(document(), dest));
// Page number via object reference in item from Dests NameTree.
dest = FPDF_GetNamedDestByName(document(), "Next");
EXPECT_NE(nullptr, dest);
EXPECT_EQ(1U, FPDFDest_GetPageIndex(document(), dest));
// Page number directly in item from Dests dictionary.
dest = FPDF_GetNamedDestByName(document(), "FirstAlternate");
EXPECT_NE(nullptr, dest);
EXPECT_EQ(11U, FPDFDest_GetPageIndex(document(), dest));
// Invalid object reference in item from Dests NameTree.
dest = FPDF_GetNamedDestByName(document(), "LastAlternate");
EXPECT_NE(nullptr, dest);
EXPECT_EQ(0U, FPDFDest_GetPageIndex(document(), dest));
}
开发者ID:was4444,项目名称:pdfium,代码行数:26,代码来源:fpdfdoc_embeddertest.cpp
示例4: TEST_F
TEST_F(FPDFParserEmbeddertest, Bug_481363) {
// Test colorspace object with malformed dictionary.
EXPECT_TRUE(OpenDocument("testing/resources/bug_481363.pdf"));
FPDF_PAGE page = LoadPage(0);
EXPECT_NE(nullptr, page);
UnloadPage(page);
}
开发者ID:azunite,项目名称:libpdfium,代码行数:7,代码来源:fpdf_parser_parser_embeddertest.cpp
示例5: DoReturn
STDMETHODIMP CRegistrator::DoReturn(BSTR FirmID, BSTR ReturnText, LONG Quantity, LONG Price, LONG DepNo, LONG* ErrorCode)
{
*ErrorCode = E_SUCCESS;
CRegistratorInfo* regInfo = m_RegistratorList.GetInfo(FirmID);
if(!regInfo)
{
*ErrorCode = E_NOT_FOUND;
return S_OK;
}
LONG nAmount = 0;
// проверяем состояние документа
BYTE nDocumentStatus;
if(!GetDocumentStatus(regInfo->hCommPort, &nDocumentStatus, ErrorCode))
return S_OK;
// если документ не открыт
if((nDocumentStatus & 0x0F) == 0)
{
// открываем документ
if(!OpenDocument(regInfo->hCommPort, DepNo, '3', szCashierStoredName, ErrorCode))
return CheckPaperStatus(regInfo, ErrorCode);
if(!PrintBuffer(FirmID, ErrorCode))
return CheckPaperStatus(regInfo, ErrorCode);
m_nReturnAmount = 0;
}
if(RegisterInternal(regInfo->hCommPort, ReturnText, Quantity, Price, DepNo, &nAmount, ErrorCode))
m_nReturnAmount += nAmount;
return CheckPaperStatus(regInfo, ErrorCode);
}
开发者ID:Dennis-Petrov,项目名称:Cash,代码行数:34,代码来源:Registrator.cpp
示例6: Cut
STDMETHODIMP CRegistrator::Cut(BSTR FirmID, LONG CutType, LONG* ErrorCode)
{
*ErrorCode = E_SUCCESS;
CRegistratorInfo* regInfo = m_RegistratorList.GetInfo(FirmID);
if(!regInfo)
{
*ErrorCode = E_NOT_FOUND;
return S_OK;
}
// открываем документ
BYTE nDocumentStatus;
if(!GetDocumentStatus(regInfo->hCommPort, &nDocumentStatus, ErrorCode))
return S_OK;
// если документ не открыт
if((nDocumentStatus & 0x0F) == 0)
{
if(!OpenDocument(regInfo->hCommPort, 1, '1', szCashierStoredName, ErrorCode))
return CheckPaperStatus(regInfo, ErrorCode);
if(!PrintBuffer(FirmID, ErrorCode))
return CheckPaperStatus(regInfo, ErrorCode);
}
if(CloseDocInternal(regInfo, ErrorCode))
m_ReceiptLines.RemoveAll();
// PassCommand(regInfo->hCommPort, (LPBYTE) "25", NULL, 0, nReceivedMessage, ErrorCode);
return CheckPaperStatus(regInfo, ErrorCode);
}
开发者ID:Dennis-Petrov,项目名称:Cash,代码行数:31,代码来源:Registrator.cpp
示例7: TestOpenDocument
void TestOpenDocument( void )
{
Err err;
DocumentInfo docInfo;
OS_Init();
ReadPrefs();
SetStandardFunctions();
DeleteMetaDocument( TEST_DOCUMENT, 0 );
StrCopy( docInfo.name, TEST_DOCUMENT );
docInfo.cardNo = 0;
docInfo.size = 550;
docInfo.created = -1139389298;
docInfo.attributes = 512;
docInfo.categories = 1;
docInfo.location = 0;
docInfo.active = true;
docInfo.timestamp = 0;
docInfo.volumeRef = 0;
docInfo.numRecords = 0;
err = OpenDocument( &docInfo );
ASSERT_MSG( "UnitTest.pdb must be installed", err == errNone );
CloseDocument();
OS_Release();
}
开发者ID:TimofonicJunkRoom,项目名称:plucker,代码行数:29,代码来源:genericfiletester.c
示例8: m_pStrategy
CWordBinaryMetadataDiscoveryWorker::CWordBinaryMetadataDiscoveryWorker(
const CStdString& sFilePath, CWordBinaryDiscoverStrategy* pStrategy) :
m_pStrategy(pStrategy),
m_bDetailedDiscovery(true)
{
Initialise();
OpenDocument(sFilePath);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:8,代码来源:WordBinaryMetadataDiscoveryWorker.cpp
示例9: TEST_F
TEST_F(FPDFParserEmbeddertest, Bug_544880) {
// Test self referencing /Pages object.
EXPECT_TRUE(OpenDocument("bug_544880.pdf"));
// Shouldn't crash. We don't check the return value here because we get the
// the count from the "/Count 1" in the testcase (at the time of writing)
// rather than the actual count (0).
(void)GetPageCount();
}
开发者ID:JinAirsOs,项目名称:pdfium,代码行数:8,代码来源:fpdf_parser_parser_embeddertest.cpp
示例10: TEST_F
TEST_F(FXGETextEmbedderTest, BadItalic) {
// Shouldn't crash.
EXPECT_TRUE(OpenDocument("bug_601362.pdf"));
FPDF_PAGE page = LoadPage(0);
EXPECT_NE(nullptr, page);
FPDF_BITMAP bitmap = RenderPage(page);
FPDFBitmap_Destroy(bitmap);
UnloadPage(page);
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:9,代码来源:fx_ge_text_embeddertest.cpp
示例11: TEST_F
TEST_F(FPDFViewEmbeddertest, Page) {
EXPECT_TRUE(OpenDocument("about_blank.pdf"));
FPDF_PAGE page = LoadPage(0);
EXPECT_NE(nullptr, page);
EXPECT_EQ(612.0, FPDF_GetPageWidth(page));
EXPECT_EQ(792.0, FPDF_GetPageHeight(page));
UnloadPage(page);
EXPECT_EQ(nullptr, LoadPage(1));
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:9,代码来源:fpdfview_embeddertest.cpp
示例12: TEST_F
TEST_F(FPDFRenderLoadImageEmbeddertest, Bug_557223) {
// Should not crash
EXPECT_TRUE(OpenDocument("bug_557223.pdf"));
FPDF_PAGE page = LoadPage(0);
EXPECT_NE(nullptr, page);
FPDF_BITMAP bitmap = RenderPage(page);
CompareBitmap(bitmap, 24, 24, "dc0ea1b743c2edb22c597cadc8537f7b");
FPDFBitmap_Destroy(bitmap);
UnloadPage(page);
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:10,代码来源:fpdf_render_loadimage_embeddertest.cpp
示例13: TEST_F
TEST_F(FXCodecEmbeddertest, Bug_631912) {
// Test jbig2 image in PDF file can be loaded successfully.
// Should not crash.
EXPECT_TRUE(OpenDocument("bug_631912.pdf"));
FPDF_PAGE page = LoadPage(0);
EXPECT_NE(nullptr, page);
FPDF_BITMAP bitmap = RenderPage(page);
FPDFBitmap_Destroy(bitmap);
UnloadPage(page);
}
开发者ID:gradescope,项目名称:pdfium,代码行数:10,代码来源:fx_codec_embeddertest.cpp
示例14: MsgBox
void MainFrame::OnOpenSelection(const std::string& value)
{
auto fullPath = Wex::Path::Combine(project.GetProjectDirectory(), value);
if (Wex::String::ToLower(fullPath) == Wex::String::ToLower(project.GetFileName()))
MsgBox("Edit Project");
else
OpenDocument(fullPath);
superBox.Close();
activeWindow.SetFocus();
}
开发者ID:jmfb,项目名称:cpp-project-2,代码行数:10,代码来源:MainFrame.cpp
注:本文中的OpenDocument函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论