IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Visual C++ Discussion :

Error C1190, /clr déjà activé


Sujet :

Visual C++

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Mai 2009
    Messages : 12
    Points : 17
    Points
    17
    Par défaut Error C1190, /clr déjà activé
    Bonjour,

    Je travaille sur VS2008sp1 sur un projet qui permet de gérer l'overlay de fichier en fonction de leur état.

    Pour ceci j'utilise l'interface "IShellIconOverlayIdentifier" ainsi que la DLL de tortoise svn pour la gestion des overlays, jusqu'ici tout fonctionne correctement.

    Quand j'ajoute mes fonctions permettant de consulter l'état de mes fichiers l'erreur C1190 est remonté:

    fatal error C1190: managed targeted code requires a '/clr' option c:\isync_dev\dev\isync_overlayandstatus\isync_overlayandstatus\stdafx.h 41 iSync_OverlayAndStatus
    Ce sujet est sur-traité sur le web et j'ai évidement activé le /clr support (properties>configuration properties>Common Language Runtime Support).

    Pour récupérer l'état de mes fichiers j'utilise ProcessStartInfo affin de créer des processus avec un outil extene, cette dernière manip fonctionne correctement sans l'implémentation de l'overlay dans un projet à part.

    J'espère avoir été claire sur le sujet et son contexte, j'aimerai trouver la solution pour passer outre l'erreur de compilation me redemandant l'option /clr, étant déjà activé je ne sais comment avancer.

    Merci d'avance pour toutes aides

  2. #2
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Mai 2009
    Messages : 12
    Points : 17
    Points
    17
    Par défaut
    Bonjour,

    Je viens ajoute ici un peu le code de mon application, on ne sait jamais, l'erreur est très probablement cachée dans mon code

    Tout d'abord j'ai un classe StatusManager qui me permet de créer un processus me permettant de consulter l'état de mon fichier.

    StatusManager.h
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
     
    #pragma once
    #include "stdafx.h"
     
    #using <System.dll>
    #using <mscorlib.dll>
     
    using namespace System;
    using namespace System::Diagnostics;
    using namespace System::ComponentModel;
    using namespace System::IO;
    using namespace System::Text::RegularExpressions;
     
    public ref class StatusManager
    {
    public:
    //	StatusManager(String^ pwszPath);
    	StatusManager(LPCWSTR pwszPath);
     
    	bool createProcess();
    	bool wsstatusIsSet();
    	void exportWsstatusAndType();
     
    	bool isNormal();
    	bool isLocked();
    	bool isModified();
    	bool isUnversionned();
     
    private:
    	String^ type;
    	String^ wsStatus;
    	String^ pwd;
    	String^ status;
    	String^ returnProcess;
     
    	StreamWriter^ inputWriter;
    	StreamReader^ outputReader;
    };

    StatusManager.cpp
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    #include "stdafx.h"
    #include "StatusManager.h"
     
    //constructors
     
    StatusManager::StatusManager(LPCWSTR pwszPath)
    {
    	CString str (_T(""));
    	str += pwszPath;
     
    	pwd = gcnew String( str );
    }
     
    bool StatusManager::createProcess()
    {
    	//Creating string arguments for pwszPath
    	String^ args = "ls " + pwd + " -format list -report DL";
     
    	//Creating of a process and create steam for it
    	ProcessStartInfo^ startInfo = gcnew ProcessStartInfo("C:\\Program Files\\Synchronicity\\DesignSyncV6R2009.HF18\\bin\\dssc.exe", args);
     
    	startInfo->UseShellExecute = false;
    	startInfo->ErrorDialog = false;
    	startInfo->RedirectStandardError = false;
    	startInfo->RedirectStandardInput = true;
    	startInfo->RedirectStandardOutput = true;
     
    	Process^ proc = gcnew Process();
    	proc->StartInfo = startInfo;
     
    	bool processStarted = proc->Start();
     
    	inputWriter = proc->StandardInput;
    	outputReader = proc->StandardOutput;
     
    	proc->WaitForExit();
     
    	returnProcess = outputReader->ReadToEnd();
     
    	return processStarted;
    }
     
    //Check if wsstatus options is set
    bool StatusManager::wsstatusIsSet()
    {
    	Regex^ regex = gcnew Regex( "wsstatus",static_cast<RegexOptions>(RegexOptions::Compiled | RegexOptions::IgnoreCase) );
    	MatchCollection^ matches = regex->Matches( returnProcess );
     
    	if(matches->Count > 0)
    		return true;
    	else
    		return false;
    }
     
    //Export WS Status & type
    void StatusManager::exportWsstatusAndType()
    {
    	int begin, end, length;
     
    	if (wsstatusIsSet())
    	{
    		begin = returnProcess->LastIndexOf('{');
    		end = returnProcess->IndexOf('}');
    		length = end - begin;
    		wsStatus = returnProcess->Substring(begin+1, length-1);
     
    		//Export Type (Copy, Lock, ...)
    		begin = returnProcess->IndexOf("fetchedstate")+13;
    		end = returnProcess->IndexOf("wsstatus");
    		length = end - begin;
     
    		type = returnProcess->Substring(begin, length-1);
     
    	}
    	else
    	{	//wsstatus is not set
    		//Export Type (Copy, Lock, ...)
    		begin = returnProcess->IndexOf("fetchedstate")+13;
    		end = returnProcess->LastIndexOf("}");
    		length = end - begin;
     
    		type = returnProcess->Substring(begin, length-1);
    	}
    }
    Cette classe a été testé préalablement dans un projet solo et fonctionne parfaitement, c'est cette dernière qui requiert l'activation du "Common Language Runtime Support".

    Ensuite j'ai ma classe COverlayModified qui utilise l'interface IShellIconOverlayIdentifier. Certains des arguments sont en commentaire affin de permettre la DLL de tortoise de retourner les bonnes informations.

    COverlayModified.cpp

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
     
    // OverlayModified.cpp : Implementation of COverlayModified
     
    #include "stdafx.h"
    #include "OverlayModified.h"
     
     
    // COverlayModified
     
    STDMETHODIMP COverlayModified::GetOverlayInfo(LPWSTR /*pwszIconFile*/, int /*cchMax*/, int * /*pIndex*/, DWORD * /*pdwFlags*/)
    {
      return S_OK;
    }
     
    // IShellIconOverlayIdentifier::GetPriority
     
    // returns the priority of this overlay 0 being the highest. 
     
    STDMETHODIMP COverlayModified::GetPriority(int *pPriority)
    {
      *pPriority=0;
      return S_OK;
    }
     
    // IShellIconOverlayIdentifier::IsMemberOf
     
    // Returns whether the object should have this overlay or not 
    STDMETHODIMP COverlayModified::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/)
    {
    	StatusManager^ manager = gcnew StatusManager(pwszPath);
    	manager->createProcess();
    	manager->exportWsstatusAndType();
     
    	if(manager->isModified())
    		return S_OK;
    	else
    		return S_FALSE;
    }
    Une fois de plus la fonctionnalité de cette classe sans l'utilisation de mon StatusManager est exécutable.

    Si vous avez des question n'hésitez pas, ceci pourrait peut être éclairer le problème.

    Cordialement,

    Myzha

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2009
    Messages
    12
    Détails du profil
    Informations personnelles :
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Mai 2009
    Messages : 12
    Points : 17
    Points
    17
    Par défaut
    Bon ben le problème est résolu, étrangement quand on active le /clr dans les propriétés de la solution, tous les fichiers n'en bénéficient pas, il faut ainsi revenir configurer ces derniers un par un avec le /clr...

    Désolé pour le dérangement et bonne continuation,

    Cordialement,

    Myzha

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Hyperion Essbase] : error: 109: MAXL API instance is not active
    Par user0505 dans le forum EPM (Hyperion)
    Réponses: 20
    Dernier message: 21/01/2009, 16h18
  2. activer l'execution du code clr
    Par sundjata dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 25/10/2006, 19h23
  3. Réponses: 4
    Dernier message: 31/08/2006, 13h44
  4. Réponses: 21
    Dernier message: 02/10/2005, 19h05
  5. Error activating XKB configuration
    Par Hidekii dans le forum Gnome
    Réponses: 2
    Dernier message: 11/05/2004, 07h30

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo