Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Erreur utilisation composant COM

1 réponse
Avatar
vinz
Bonjour,

J'essaie d'utiliser le composant COM d'ActivePDF pour g=E9n=E9rer et
remplir des documents PDF =E0 partir d'un mod=E8le.
Au moment d'ouvrir le fichier destination, j'obtiens l'erreur suivante
:
[COMException (0x800a017f): Propri=E9t=E9 en lecture seule]
System.RuntimeType.ForwardCallToInvokeMember(String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData) +463
PETOCXLib.PETOCXClass.OpenOutputFile(String FileName) +0
toto.classes.Outils.TransformPdf(String OriginPdfPath, String
DestPdfPath, String[] tabField)
toto.inc.documents_pdf.GenererPdf_Fr()
toto.inc.documents_pdf.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Page.ProcessRequestMain() +750

Je ne vois pas du tout d'o=F9 peut venir cette erreur. J'ai v=E9rifi=E9
l'ensemble des droits d'acc=E8s aux r=E9pertoires, aux fichiers... et
tout me semble correct.
Est-ce que qqun peut m'=E9claicir ?

Merci !
vinz.

1 réponse

Avatar
Paul Bacelar
<MSDN
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vbconInteroperabilityMarshaling.asp>
Passing ReadOnly Properties of Controls ByRef
Visual Basic .NET sometimes raises COM errors such as "Error 0x800A017F
CTL_E_SETNOTSUPPORTED" when you to pass ReadOnly properties of some older
ActiveX controls as ByRef parameters to other procedures. Similar procedure
calls from Visual Basic 6.0 do not raise an error, and the parameters are
treated as if you passed them by value. The error message you see in Visual
Basic .NET is the COM object reporting that you are attempting to change a
property that does not have a property Set procedure.
If you have access to the procedure being called, you can prevent this error
by using the ByVal keyword to declare parameters that accept ReadOnly
properties. For example:
Sub ProcessParams(ByVal c As Object)
'Use the arguments here.
End Sub
If you do not have access to the source code for the procedure being called,
you can force the property to be passed by value by adding an extra set of
brackets around the calling procedure. For example:
Sub PassByVal ()
' The extra set of parens around the arguments
' forces them to be passed by value.
ProcessParams((Me.AxListView1.ListItems))
End Sub
</MSDN>
Il n'y aurait pas un "ref" de trop.
--
Paul Bacelar

"vinz" wrote in message
news:
Bonjour,

J'essaie d'utiliser le composant COM d'ActivePDF pour générer et
remplir des documents PDF à partir d'un modèle.
Au moment d'ouvrir le fichier destination, j'obtiens l'erreur suivante
:
[COMException (0x800a017f): Propriété en lecture seule]
System.RuntimeType.ForwardCallToInvokeMember(String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData) +463
PETOCXLib.PETOCXClass.OpenOutputFile(String FileName) +0
toto.classes.Outils.TransformPdf(String OriginPdfPath, String
DestPdfPath, String[] tabField)
toto.inc.documents_pdf.GenererPdf_Fr()
toto.inc.documents_pdf.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Control.LoadRecursive() +98
System.Web.UI.Page.ProcessRequestMain() +750

Je ne vois pas du tout d'où peut venir cette erreur. J'ai vérifié
l'ensemble des droits d'accès aux répertoires, aux fichiers... et
tout me semble correct.
Est-ce que qqun peut m'éclaicir ?

Merci !
vinz.