DLL中能不能导出重载函数,怎么做?

解决方案 »

  1.   

    就跟导出两个不同的函数是一样的:
    __declspec(dllexport)  void f(int a)
    {
         //some stuff here
    }
    __declspec(dllexport)  void f(double a )
    {
         //some stuff here
    }
      

  2.   

    hehe yes
    If you export a class it should be more convenient.class __declspec(dllexport) DllExportExample
    {
     ...
     void f(int a);
     void f(double a);
     ...
    };Once the class is exported properly,you can use 
    its member functions at ease,good luck :)!
      

  3.   

    __declspec(dllexport)  void f(int a)
    {
         //some stuff here
    }
    __declspec(dllexport)  void f(double a )//如果这里是long呢?
    {
         //some stuff here
    }f(123);天知道到底掉用谁呀
      

  4.   

    我用extern "C" __declspec(dllexport)声明两个重载函数,编译时会出错
    我不想用扩展MFC DLL
      

  5.   

    No you can't.
    You can only export one version of the overloaded functions.