COM, DCOM, ActiveX potAto, pOtato... 🙂 I've been studying a bit this afternoon. COM came in '93 and was succeeded by DCOM. ActiveX is a kind COM (actually a modified Visual Basic VBX).... Today the names are used more or less interchangely...
I've tried everything. I think the only solution is a new version of cocreate.dll.
However, I've made it work in another way... I run a VB script by issuing e.g.:
wscript \"pathtovbscript\vbscript.vbs" Text Serial0123
with the command execution vi (wscipt should be in all newer version of windows). And vbscript.vbs looking like:
set Args = Wscript.Arguments
textField = Args(0)
barcodeField = Args(1)
' Print using the template
DoPrint("C:\path\template.lbl")
Sub DoPrint(strFilePath)
Set ObjDoc = CreateObject("BrssCom.Document")
bRet = ObjDoc.Open(strFilePath)
If (bRet <> False) Then
ObjDoc.SetText 0, textField
ObjDoc.SetBarcodeData 0, barcodeField
ObjDoc.DoPrint 0, "0"
End If
Set ObjDoc = Nothing
End Sub
Not very elegant but it's quite fast and it's working 🙂
- Martin