Hi, I been searching for 3 days how to unlock a standard password protection from a pdf file after it been open. I trying to build a plug-in in visual c++ .net and the callback MyAVDocDidOpen so I can get the AVDoc. But after 3 days... I'm still unable to work with all security method and callback... Can someone help me about it!

The best way you could help me is to show me a exemple of the good way to do it...
//Here a exemple of last thing I have been trying... I'm not used to c++ language cause I have start to use it last week. so I still can do stupid thing with Type and fonction...

ACCB1 void ACCB2 MyAVDocDidOpen (AVDoc doc, ASInt32 error, void* clientData)
{
PDPerms perms = pdPermAll;
PDPermReqObj reqObj = PDPermReqOprAll;
PDPermReqOpr reqOpr = PDPermReqOprAll;
PDPermReqStatus test = PDDocPermRequest (pdDoc, reqObj, reqOpr, PDDocGetSecurityData (pdDoc));
if(test != 0)
{

void** sdsa;
ASBool rep = AVCryptGetPassword (pdDoc, perms, sdsa);

if(rep == 1)
{
//Give me error
ASBool as = PDCryptGetAuthDataProc (pdDoc, perms, sdsa);

PDPerms a = PDDocAuthorize (pdDoc, perms, sdsa);

//Give me error
PDCryptFreeAuthDataProc (pdDoc, sdsa);
}
}
}