在python 中调用Dll
来源:互联网 发布:apache重启不了 编辑:程序博客网 时间:2024/05/16 18:59
1.首先写DLL文件,环境是在VC 6.0中
如下所示:
// funDll.cpp : Defines the entry point for the DLL application.//#include "stdafx.h"#include <iostream>using namespace std;#ifdef _MANAGED#pragma managed(push, off)#endif#ifdef __cplusplus #define EXPORT extern "C"__declspec(dllexport)#else#define EXPORT __declspec(dllexport)#endifEXPORT int HelloWorld(){ cout <<"hello world" <<endl; return 0;}BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ){ return TRUE;}#ifdef _MANAGED#pragma managed(pop)#endif
2.然后书写python调用DLL代码。
#coding=utf-8'''Created on 2011-12-5@author: LONMID'''from ctypes import *fileName = "funDll.dll"func = cdll.LoadLibrary(fileName)#print func.HelloWorld()ffd天下第一func.HelloWorld()
如果出现"Hello world",说明运行成功。
- 在python 中调用Dll
- Python中调用dll
- 在Delphi中调用DLL
- 在ASP中调用dll
- 在C#中调用DLL
- 在VS2008中调用dll
- 在MFC中调用DLL
- 在director中调用dll
- 在lua中调用DLL
- 用python开发window dll,并用在web中调用dll
- 在python中调用dll,并将dll以及python合并打包成一个exe文件的方法
- 在ASP文件中调用DLL
- 在ASP文件中调用DLL
- 在ASP文件中调用DLL
- 如何在ASP中调用dll
- 如何在sqlserver中调用dll
- 在ASP中调用.NET的DLL
- 在c#中如何调用dll
- TI OMAP35X系统为什么需要x-load
- 动态表格,通过按钮增加行,删除时删除选择的checkbox那一行
- Domino错误信息的详细分析
- Linux下的多线程编程
- 配置 SQL SERVER2008 数据库邮件 功能
- 在python 中调用Dll
- 怎么退出整个框架
- 动态表格,通过点击按钮增加或者删除一行表格!
- 通过VBS获取磁盘剩余空间
- pig安装及问题
- spring 的优点?什么是DI机制? 什么是AOP?
- servlet
- Android触摸屏输入系统
- RAC 的一些概念性和原理性的知识