2011-07-11 2 views
0

Dans vs C++ j'ai utilisé le code suivant pour utiliser certaines fonctions dans un fichier dll que je n'ai pas l'en-têteL'utilisation dll COM dans un projet Qt

#import "dll path" 
HRESULT hr = CoInitialize(NULL); 

    if (hr==S_OK) 
    {cout<<"INITIALIZED\n";} 

    Trans_ATLLib::ITransCriptPtr Trans; 
    hr = Trans.CreateInstance(__uuidof(Trans_ATLLib::TransCript)); 
    if (hr==S_OK) 
    {cout<<"INSTANCE CREATED\n";} 

    hr =Trans->EnableLastCharTashkeel(true); 
    if (hr==S_OK) 
    {cout<<"EnableLastCharTashkeel DONE\n";} 

    hr =Trans->EnableEmphaticLAM_RAA(true); 
    if (hr==S_OK) 
    {cout<<"EnableEmphaticLAM_RAA DONE\n";} 

    VARIANT_BOOL test; 
    test = Trans->SetText(arabic_string); 
    if (test==0) 
    {cout<<"error in setting the arabic sting\n";} 

    string result; 
    result = Trans->GetResult(); 

    istringstream iss(result); 
    vector<string> phonemes; 
    copy(istream_iterator<string>(iss),istream_iterator<string>(),back_inserter<vector<string> >(phonemes)); 
    return phonemes; 
} 

Mais je trouve que Qt n'utilise pas la même méthode.

Quelqu'un peut-il m'aider à appeler ces fonctions dans Qt?

Merci d'avance.

Répondre

0

Si vous utilisez C++ - faites de même! Qt est un ensemble de bibliothèques, pas un langage de programmation différent - appelez winApi partout où vous avez besoin, mais n'oubliez pas que ce n'est pas portable.

+0

merci raiv j'ai travaillé autour du problème en utilisant le code vs comme un fichier exe avec quelques changements pour éviter de passer des paramètres – adam