Python嵌入vb
PrivateDeclareFunctionPy_InitializeLib"python25"()AsLongPrivateDeclareFunctionPy_IsIn...
Private Declare Function Py_Initialize Lib "python25" () As Long
Private Declare Function Py_IsInitialized Lib "python25" () As Long
Private Declare Function Py_Finalize Lib "python25" () As Long
Private Declare Function Py_GetPath Lib "python25" () As Long
Private Declare Function Py_GetVersion Lib "python25" () As Long
Private Declare Function PyRun_SimpleString Lib "python25" (command As Any) As Long
Sub Main()
Py_Initialize
init = Py_IsInitialized
MsgBox init
MsgBox Py_GetPath
ver = PyGetVersion
MsgBox ver
PyRun_SimpleString "import sys"
PyRun_SimpleString "1+1"
PyRun_SimpleString "print 'Hello'*5" + Chr$(13)
Py_Finalize
End Sub
这是VB6中的代码,运行时提示“Dll调用约定错误” 在“PyRun_SimpleString "import sys"”这一行
请高手解答,并留下QQ或邮箱 展开
Private Declare Function Py_IsInitialized Lib "python25" () As Long
Private Declare Function Py_Finalize Lib "python25" () As Long
Private Declare Function Py_GetPath Lib "python25" () As Long
Private Declare Function Py_GetVersion Lib "python25" () As Long
Private Declare Function PyRun_SimpleString Lib "python25" (command As Any) As Long
Sub Main()
Py_Initialize
init = Py_IsInitialized
MsgBox init
MsgBox Py_GetPath
ver = PyGetVersion
MsgBox ver
PyRun_SimpleString "import sys"
PyRun_SimpleString "1+1"
PyRun_SimpleString "print 'Hello'*5" + Chr$(13)
Py_Finalize
End Sub
这是VB6中的代码,运行时提示“Dll调用约定错误” 在“PyRun_SimpleString "import sys"”这一行
请高手解答,并留下QQ或邮箱 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询