これは些細な質問だと思いますが、これを機能させることはできません!
.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 で未処理の例外: 0xC0000005: アクセス違反の読み取り場所 0x7ffef045。