Skip to content

运行指定程序 - RunApp

函数简介

运行指定的应用程序。

接口名称

RunApp

DLL调用

c
int RunApp(long instance, string appPath, int mode);

参数说明

参数名类型说明
instance长整数型OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。
appPath字符串要运行的程序路径。
mode整数型运行模式:0 普通模式,1 加强模式。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
ola.RunApp("notepad.exe", "",0);
csharp
using OLAPlug;

var ola = new OLAPlugServer();
ola.RunApp("notepad.exe", "",0);
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
ola.RunApp("notepad.exe", "",0)
java
import com.olaplug.OLAPlugServer;

OLAPlugServer ola = new OLAPlugServer();
ola.RunApp("notepad.exe", "",0);
go
import "github.com/ola/olaplug/olaplug"

ola, _ := olaplug.NewOLAPlugServer("OLAPlug_x64.dll")
defer ola.ReleaseObj()
ola.RunApp("notepad.exe", "",0)
rust
use olaplug::OLAPlugServer;

let ola = OLAPlugServer::new("OLAPlug_x64.dll").unwrap();
ola.run_app("notepad.exe", "");
cpp
var ola = com("OlaPlug.OlaSoft")
ola.RunApp("notepad.exe", "",0);
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
ola.RunApp("notepad.exe", "",0);
text
.局部变量 ola, OLAPlug
ola.创建 ()
ola.RunApp("notepad.exe", "",0)
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
ola.RunApp("notepad.exe", "",0);
text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
ola.RunApp("notepad.exe", "",0);
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
ola.RunApp("notepad.exe", "",0);

原生 DLL 调用

cpp
long instance = CreateCOLAPlugInterFace();
RunApp(instance, "notepad.exe", "");
csharp
long instance = CreateCOLAPlugInterFace();
RunApp(instance, "notepad.exe", "");
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
RunApp(instance, "notepad.exe", "")

返回值

返回值说明
非 0成功,返回 子进程ID。
0失败。