Giter VIP home page Giter VIP logo

dll_export's Introduction

dll 导出及动态调用

导出: 普通函数导出 extern "C" __declspec(dllexport) int __stdcall add(int a, int b);

class 导出
    导出接口类为抽象类,析构函数为虚函数
    并添加createExportObj和destroyExportObj函数,作为生成和销毁对象接口
    实际导出类继承接口类,接口实现修改(接口不变时)不影响调用
    eg:
        ExportInterface 和 ExportImpl

调用: 需要包含导出函数头文件或导出抽象类头文件 LoadLibrary 加载dll GetProcAddress 获取导出函数地址 FreedLibrary 卸载dll

eg:
    普通函数 call.cpp 中 使用DllProxyPtr,只支持C风格接口
    调用导出class时,在ExportProxy(继承自 ExportProxyBaseTemplate)中实现接口调用,只用关心实际导出类中的接口调用,不用关心类的初始化和释放

dll_export's People

Contributors

fhy17 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.