2013. 10. 10. 10:32

using installer in a CAB

[version]
Signature="$CHICAGO$"
AdvancedINF=2.0

[Deployment]
InstallScope=user  //or machine

[Setup Hooks]
hook1=hook1

[hook1]
run=%EXTRACT_DIR%\install.exe


2013. 10. 10. 10:30

IE8 deploy ActiveX

2013. 7. 24. 17:38

Convert File Format Using OLE API

<html>

<head>

<script language="javascript">

var vHwpCtrl;

function PDF_Print()

{

var app = new ActiveXObject("AcroExch.App");

var doc = new ActiveXObject("AcroExch.PDDoc");

doc.open("c:\\Docs\\01\\TestPdf.pdf");

var jso = doc.GetJSObject(); // retun javascript object (only used by javascript)

jso.addWatermarkFromText("aa");

var avDoc = doc.OpenAVDoc("print"); //print pdf file 

avDoc.PrintPages(0, 1, 2, 0, 0);

}

function WORD_TO_PDF()

{

var wdExportFormatPDF= 17;

var wordApp = new ActiveXObject("Word.Application");

var wordDocs = wordApp.Documents;

var wordDoc = wordDocs.Open("d:\\test\\TestDoc.doc");

wordDoc.ExportAsFixedFormat("d:\\test\\TestDoc.pdf", wdExportFormatPDF);

}

function EXCEL_TO_PDF()

{

var xlTypePDF = 0;

var excelApp = new ActiveXObject("Excel.Application");

var excelWorkBooks = excelApp.WorkBooks;

var excelWorkBook = excelWorkBooks.Open("d:\\test\\TestXls.xls");

excelWorkBook.ExportAsFixedFormat(xlTypePDF, "d:\\test\\TestXls.pdf");;;

}

function PPT_TO_PDF()

{

var ppFixedFormatTypePDF = 2;

var ppFixedFormatIntentPrint = 2;

var ppSaveAsPDF = 32;

var ppSaveAsPNG = 18;

var pptApp = new ActiveXObject("PowerPoint.Application");

var pptPresentations = pptApp.Presentations;

var pptPresentation = pptPresentations.Open("d:\\test\\TestPpt.ppt");

pptPresentation.SaveAs("d:\\test\\TestPpt.pdf", ppSaveAsPDF ); //convert pdf

pptPresentation.SaveAs("d:\\test\\TestPpt.png", ppSaveAsPNG );  //convert image

//pptPresentation.ExportAsFixedFormat("d:\\test\\TestPpt.pdf", ppFixedFormatTypePDF, ppFixedFormatIntentPrint ); // not working, not find the cause.

}

function HWP_PRINT()

{

hwpCtrl.Open("d:\\test\\TestHwp.hwp");

var vPrintAct =  hwpCtrl.CreateAction("Print");

var vPrintSet = vPrintAct.CreateSet();

var vWaterMarkSet = vPrintSet.CreateItemSet("PrintWatermark", "PrintWatermark");

vPrintAct.GetDefault(vPrintSet);

vPrintSet.SetItem("Device", 0);

vWaterMarkSet.SetItem("String" , "bdc");

vPrintAct.Execute(vPrintSet);

}

</script>

</head>


<body onload  >

<form name = "HwpControl">

<input type="button" value='PDF' name="job" onclick='PDF_Print()' >

<input type="button" value='WORD' name="job" onclick='WORD_TO_PDF()' >

<input type="button" value='EXCEL' name="job" onclick='EXCEL_TO_PDF()' >

<input type="button" value='PPT' name="job" onclick='PPT_TO_PDF()' >

<input type="button" value='HWP' name="job" onclick='HWP_PRINT()' >

</form>

<object id=hwpCtrl style="left: 0px; top: 0px" height=80% width=80% align=center classid='CLSID:BD9C32DE-3155-4691-8972-097D53B10052' / >

</body>

</html>

2012. 8. 1. 16:04

dynamic create activeX (javascript)

  1. create
    1. new ActiveXObject 를 이용한다.
    2. var object = new  ActiveXObject(progid);
  2. link event
    1. 해당 activeX 가 IProvideClasInfo2 와 IConnnectionPoint 가 구현되어 있어야 한다.
    2. eval("function object::event1( value ) { event_handler(value); }");


2011. 8. 9. 15:23

InPlaceActivate on ATL control not called until mouse event

IE8 에서 ActiveX 가 mouse가 이동하지 전에는 화면에 안 보이는 현상이 있었다.

http://stackoverflow.com/questions/1891194/inplaceactivate-on-atl-control-not-called-until-mouse-event 

http://minolta.egloos.com/464903   => ActiveX 에 대한 전반적인 글 

IOleObject::GetMiscStatus 라는 함수를 통하여 Container 와 Control 이 세부 설정에 대한 교환작업을 한다.

ATL 에서는 DECLARE_OLEMISC_STATUS macro를 통하여 해당 설정을 setting 할 수 있다.

이런 경우 ATL control class의 OnCreate 가 호출이 안되는 경우이며 아래 링크 의 resolution 코드를 이용하면 Oncreate 가 강제적(?)으로 호출이 된다.

http://support.microsoft.com/kb/195188/en-us