小编use*_*763的帖子

Syslog - 如何显示彩色消息?

我需要澄清一下,我不打算为日志输出着色,我只对写入syslog.

所以这里是场景,我有一个systemd运行脚本的单元服务,它指示 Bash 中的 256 种颜色。

这是服务单元文件:

[Unit]
Description=Bash Color Service

[Service]
Type=simple
EnvironmentFile=/etc/environment
ExecStart=/home/username/colors.sh

StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=bashcolors

Restart=on-failure
RestartSec=10

User=username
Group=username

[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)

这是下面的 Bash 脚本/home/username/colors.sh(从这里抓取):

#!/bin/bash

# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, …
Run Code Online (Sandbox Code Playgroud)

bash syslog tail ansi-escape systemd

4
推荐指数
1
解决办法
2811
查看次数

已注册的COM DLL在VBA中工作,但在VBScript中不工作

我在VS2012上用ATL创建了一个基本的COM DLL.它被称为testCOM.dll,它只有一个名为CSimpleObj的类.CSimpleObj只有一个名为addValues的方法,它添加了两个值.

我已经使用Windows 7 64位注册了DLL.在VBA中,我手动添加对DLL的引用,以下代码正常工作

Dim Obj As New testCOMLib.SimpleObj
MsgBox Obj.addValues(1,2)
Run Code Online (Sandbox Code Playgroud)

它给出了一个3号的消息.

现在如果我运行包含以下内容的vbs:

Dim Obj
Set Obj = CreateObject("testCOMLib.SimpleObj")
Run Code Online (Sandbox Code Playgroud)

它经常出错并且无法创建对象.但是如果我使用"Excel.Application"ProgID(作为示例)用于CreateObject方法,它可以正常工作.

我认为注册DLL存在问题.我已经检查了注册表,COM和类型库的键已经存在.

我该怎么办?

com dll vbscript vba

1
推荐指数
1
解决办法
952
查看次数

标签 统计

ansi-escape ×1

bash ×1

com ×1

dll ×1

syslog ×1

systemd ×1

tail ×1

vba ×1

vbscript ×1