Win32 API function failed problem

I'm using a TPagesDialog (in Delphi 4) which is called with a PopupMenu.
When I display this TPagesDialog a few times, I get the following error :

"A Win32 API function failed"

This is shown about twice when I right-click my mouse to display the
Popupmenu (here I've got an option where I can display this TPagesDialog).

Hereafter my Popupmenu disappears and I have to exit the program and run it
again. (as the executable or in Delphi) Then it works until I get the error

Could someone please help me if this is a common error or if you have the
solution for this problem.

Thank you in advance.