如题

解决方案 »

  1.   

    1楼的太麻烦,我记得有比1楼的简单的,不用MFC AppWizard DLL创建的
      

  2.   

    建立dll,导出函数,注意函数调用约定,就可以给pb,vb调用了
      

  3.   

    对,DLL或者控件都可以,pb没试过用控件,照理说应该没问题。
      

  4.   

    呵, oyljerry(☆勇敢的心☆-要开始写论文了) 写的正确。一定要注意调用约定!
    不用MFC的我倒是刚做过,不过我建议你参考SYBASE网站一的一篇文章,我刚开始用VC写的在PB下调用老是死机,看完后就好了。不过忘了具体网址了.名称是“如何用VC创建可在PB中调用的DLL”:
    我贴一下主要内容, 这是个例子:Writing a source code 
    .C or .CPP file #include <windows.h> 
    #include "first.h" long __declspec(dllexport) __stdcall foo3(long mylong1, long mylong2,long mylong3) 

    long calc; 
    calc = (mylong1 + mylong2 + mylong3); 
    return(calc); 
    }; Header File 
    //Includes functions declarations, variables and structures declaration and //initialization. long __declspec(dllexport) __stdcall foo3(long mylong1, long 
    mylong2,long mylong3); .Def file //"Undecorates " functions names decorated by __stdcall LIBRARY first.dll 
    EXPORTS foo3 = _foo3@12 
      

  5.   

    In PowerBuilder Note: the name of the function used in the declaration section should be the same as exported function name. If the .DEF file was not included within the .DLL, the function will be exported decorated and has to be prototyped decorated as well. 
    If you are using some third party DLLs and rae not sure how the function you are calling is exported, you can use Exported Function section of Quick View. //Prototype function call in Local or Global External Functions Declaration section: 
    FUNCTION Long foo3( long arg1, long arg2, long arg3)Library"d:\API CALLS\first.dll" 
      

  6.   

    EXPORTS foo3 = _foo3@12 
    = _foo3@12 是干什么的?
      

  7.   

    1、
    extern "C"
    functype WINAPI funcname(vartype var1, vartype var 2, ...);然后在.DEF文件的EXPORT下导出该函数2、
    extern "C"
    functyep __declspec(dllexport) __stdcall funcname(vartype var1, vartype var2, ...)
      

  8.   

    EXPORTS foo3 = _foo3@12 ==>EXPORTS foo3 @12 他原来的是这么写的,但应该是“EXPORTS foo3 @12 ”