都是什么内存不可读什么的,请怎么回事?char* 可以,int*就有错误,怎么回事啊

解决方案 »

  1.   

    应该跟dll没什么关系,还是把代码帖一下吧。
    要不建个测试工程,单步跟踪一下。
      

  2.   

    extern "C"  DllExport int WINAPI __stdcall OnPush(int *datedifference)
    {
       ttemp=*datedifference;
    }extern "C"  DllExport int WINAPI __stdcall OnPop(int *datedifference)
    {
       *datedifference=ttemp;
    }
    目的就是用OnPush传入一个值,然后用OnPop再传出来。可是提示内存不可读写.
      

  3.   

    char一个字节
    int四个字节
    估计你的ttemp是个char吧,所以就覆盖了ttemp候三个字节的内存之类改成int ttemp可能就好了
      

  4.   

    和DLL没有关系
    你把代码贴出来看看
      

  5.   

    调用更简单,VB中调用的:
    Private button1_click sub
      OnPush 123  
    End sub
    Private button2_click sub
      Dim i1 as long 
      OnPop i1  
      Print i1
    End sub
    结果应该是123,可是却不能运行
      

  6.   

    你的VB调用时,声明DLL用的什么?ByVal ?ByRef?
      

  7.   

    extern "C" long __stdcall MyFunclng1(long lpszMsg)
    {
    lpszMsg*=2; return lpszMsg;
    }
      

  8.   

    VB里的参数声明应该是  valueNaem as long by ref