Error: Attempted to read or write protected memory

May 29 2007 10:23 AM
 Hi,

I am accessing Win API "Comdlg32.dll" functions for "File Open" Dialog box and i am getting the error at GetOpenFileName(opfile) as
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
(Private Declare Function GetOpenFileName Lib "COMDLG32" _

Alias "GetOpenFileNameA" (ByVal File As OPENFILENAME) As Long)

Could you please tell me how can sort out this problem? 

Thanks & Regards,
Sreenivas Kaushik