我认为这是一个微不足道的问题,但我永远无法得到它的工作!初始化函数C库外的.lib指针的外部指针
我已经通过.lib中的函数指针进行函数调用,并将.lib附加到应用程序,该应用程序在库外设置函数指针。以下是代码片段
库:
void (*PopulateBuffer)(byte *NALBuffer,unsigned int *readbytes); // The Declaration
PopulateBuffer(NALBuffer,&readbytes); // The function Call
应用:
extern void (*PopulateBuffer)(char *NALBuffer,unsigned int *readbytes);
void UpdateNALBuff(char *Buffer,unsigned int *readbytes)
{
//Buffer content is updated
//readbytes is updated
}
main()
{
PopulateBuffer= &UpdateNALBuff;
LibMain(); // this is the main call in which the function pointer is called
}
我这样做吗???当过函数调用库中的方法,它抛出我下面的错误 原因:DecoderTestApp.exe在0x00536e88
未处理的异常:0000005:访问冲突读取位置0x7ffef045。
该库是静态的,而不是.dll – 2012-08-14 11:26:32
它是否无法使用指针或在函数内调用函数? – Rohan 2012-08-14 11:28:27
它在函数调用时失败,而不是函数内部我已经在函数内部放置了一个断点,并且它没有达到那个点,我在函数调用 – 2012-08-14 11:32:46