2014-06-06 2 views
0

j'ai un IDL qui contient une définition d'interface simple:erreur TlbImp TI1036 n'a pas réussi à importer SAFEARRAY (float)

library DecoToniCfgLib 
{ 

    importlib("stdole32.tlb"); 

    //....code 
    //....code 

    [ 
    object, 
    uuid(A6F30650-53F5-4688-829A-C084BA1C7DC0), 
    dual, 
    nonextensible, 
    helpstring("DecoToniConfig Interface"), 
    pointer_default(unique) 
    ] 
    interface IDecoToniConfig : IDispatch 
    { 
    [id(1), helpstring("Opens the Tones config and returns the params")] 
    HRESULT OpenToneConfigWindow([out, retval] TCodecParams* pVal); 
    [id(2), helpstring("Opens the Tones config and returns the params in an array form")] 
    HRESULT OpenToneConfigWindowArray([out, retval] SAFEARRAY(float)* pVal); 
    [id(3), helpstring("Opens the masks config window")] 
    HRESULT OpenMaskConfigWindow([out, retval] SAFEARRAY(TMask)* pVal); 
    }; 

} 

ajouter à une méthode qui retourne un SAFEARRAY (float), mais quand je lance TlbImp pour créer la bibliothèque d'importation pour le code managé je reçois:

TlbImp : error TI1036 : Cannot find 'System.Single[] OpenToneConfigWindowArray()' 
in 'DecoToniCfgLib.IDecoToniConfig' when implementing 'DecoToniCfgLib.IDecoToniConfig' 
in 'interop.DecoToniConfigLib.DecoToniConfigClass' 
from 'interop.DecoToniConfigLib, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. 

Où pourrait être le problème?
Peut-être que je dois faire référence à quelque chose? Si oui ... comment puis-je faire?

Cordialement.

+0

Très obscur, ne peut pas obtenir une repro pour cela. Les charlatans comme Tlbimp lisent un fichier .tlb obsolète qui manque la méthode. –

Répondre

0

Quand je lance

tlbimp.exe DecoToniConfigLib.dll /out:interop.DecoToniConfigLib.dll 

Il crée deux fichiers: DecoToniCfgLib.dll (la bibliothèque définie dans IDL) et interop.DecoToniConfigLib.dll

Le @ hans-allume une commentaire passant lampe dans mon tête et je supprime ces deux fichiers avant d'exécuter le tlbimp à nouveau ... et cela fonctionne.

Questions connexes