ich habe mit C++ (VS 6.0) ein ComObjekt erstellt und möchte
dieses nun aus Python (2.2.1) heraus ansprechen.
Ich habe im IDL File eine struct definiert, welches ein SAFEARRAY(double)
beinhaltet.
Code: Alles auswählen
typedef
[
uuid(19115fab-7e40-4505-9cc2-1a072fd4b033),
version(1.0),
helpstring("Vola Parameters for FITLib")
]
struct VolaParams {
[helpstring("Distribution")] long lDistribution;
[helpstring("Type")] long lType;
[helpstring("a CalFlag")] long lACalFlag;
[helpstring("b CalFlag")] long lBCalFlag;
[helpstring("c CalFlag")] long lCCalFlag;
[helpstring("d CalFlag")] long lDCalFlag;
[helpstring("a")] double dA;
[helpstring("b")] double dB;
[helpstring("c")] double dC;
[helpstring("d")] double dD;
[helpstring("q")] double dQ;
[helpstring("ks")] SAFEARRAY(double) dKs;
} VolaParams;
dem Safearray kann ich leider nichts zuweisen, da gibt es immer einen Fehler
Code: Alles auswählen
import win32com.client
myCom = win32com.client.Dispatch("ComLib.FinLib")
myStruct = myCom.VolaPar
myStruct.dKs = (1,2,3,4,5)
Traceback (most recent call last):
File "C:\Visual Studio 6.0\com.py", line 6, in ?
myStruct.dKs = (1,2,3,4)
pywintypes.com_error: (-2147024809, 'Falscher Parameter.', None, None)
Weiß jemand wie ich dieses SafeArray in Python füllen kann?
Vielen Dank im Voraus
Christian