zoukankan      html  css  js  c++  java
  • ActiveX control view HTML format files in X++

    ActiveX control view HTML format files in X++

    remark by Jimmy July 2th 2010

     

    LoadHtmlFile method

     

    boolean loadHtmlFile()
    {
        container   con;
    
        URL URL;
        ;
        element.lockWindowUpdate(true);
        if (docuRef.docuValue().File)
        {
            //file in database
            DocuFileWatchDog::create(); //update old files
    
            URL = DocuActionFile::saveTempFile(docuRef);
            htmlView.navigate(URL);
    
            DocuOpenFile::add(docuRef, URL);
            curUrl = URL;
            DocuFileWatchDog::createDelayed(); //ensure that watchdog is started
        }
        else
        {
            URL = docuRef.completeFilename();
            con = WinAPI::findFirstFile(URL);
            if (!conpeek(con, 2) && conpeek(con, 1) == -1)
                return false;
    
            htmlView.navigate(URL);
            curUrl = URL;
        }
    
        return true;
       element.lockWindowUpdate(false);
    }
    
    

    saveTempFile method

    static public Filename saveTempFile(DocuRef docuRef, boolean internetCache = true)
    {
        BinData     binData;
        Filename    filename;
        FilePath    filePath;
        str endSlash(str _str)
        {
            return (strscan(_str, '\\',strlen(_str),-1)) ? _str : _str + '\\';
        }
    ;
        binData = new BinData();
        binData.setData(docuRef.docuValue().file);
    
        filePath = endSlash(internetCache ? WinAPI::getFolderPath(#CSIDL_INTERNET_CACHE) : xInfo::directory(DirectoryType::Temp));
        filename = docuRef.completeFilename(filePath);
    
        binData.saveFile(filename);
    
        return  filename;
    }
    

     

    completeFilename method

     

    display Filename completeFilename(FilePath path = this.path())
    {
        ;
        if (this.docuType().TypeGroup == DocuTypeGroup::Note)
        {
            return '';
        }
    
        return path + this.docuValue().fileName();
    }
    
    

  • 相关阅读:
    算法---大整数相加
    Openxml入门---Openxm读取Excel数据
    一个有用的网络监控软件
    C#基础---C#如何对Json字符串处理
    C#基础---IComparable用法,实现List<T>.sort()排序
    OpenXml入门---word里面插入图片
    OpenXml入门
    OpenXml入门----给Word文档添加表格
    拼图
    小锤子
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1769654.html
Copyright © 2011-2022 走看看