VB2010 et DirectX 9 ? Compatible ?

Résolu
Fabasia Messages postés 45 Date d'inscription mercredi 26 mars 2008 Statut Membre Dernière intervention 17 août 2012 - 16 août 2012 à 14:54
Fabasia Messages postés 45 Date d'inscription mercredi 26 mars 2008 Statut Membre Dernière intervention 17 août 2012 - 17 août 2012 à 22:30
Après un crash de mon PC, j'ai installé vb 2010 express. J'avais developpé auparavant une appli en vb2008 avec directx 9 qui ne fonctionne plus sous vb 2010.

Après qq recherches sur le net, j'ai lu que vb 2010 n'accepte plus les codes managés, donc directx 9 et qu'il fallait utiliser XNA ... Qu'en est-il exactement ?

Merci

6 réponses

Fabasia Messages postés 45 Date d'inscription mercredi 26 mars 2008 Statut Membre Dernière intervention 17 août 2012
17 août 2012 à 22:30
Après recherche sur ce forum ....

Dans votre fichier de configuration App.Config, spécifiez :

<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>Cordialement

et pour mon cas il a fallu l'ajouter à la fin du fichier app.config du répertoire de l'application

... affaire à suivre !


Je vais peut-être rester sous VB2008 !
3
Utilisateur anonyme
16 août 2012 à 17:07
Bonjour

CXommencer par Menu Générer-Gestionnaire de configuration - Utiliser x86 au lieu de anycpu.
0
Utilisateur anonyme
16 août 2012 à 17:10
Sinon respecter le règlement ou trouver de vrais devins télépathes capables de trouver tout le non-dit caché dans "ne marche pas".
0
Fabasia Messages postés 45 Date d'inscription mercredi 26 mars 2008 Statut Membre Dernière intervention 17 août 2012
17 août 2012 à 16:58
Ok ... Je vais regarder dans la config.

Pour le 2nd msg, j'ai pas tout compris ....

Merci
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Utilisateur anonyme
17 août 2012 à 18:54
Entre autres, c'est quoi précisément qui ne marche pas ? Jusqu'à preuve du contraire, personne ne voit ton écran, ni à quel endroit se plante ton programme.

Et puis, les usages de ce lieu prévoient que le minimum est de dire bonjour.
Et le règlement dit qu'il faut fournir son code.
0
Fabasia Messages postés 45 Date d'inscription mercredi 26 mars 2008 Statut Membre Dernière intervention 17 août 2012
17 août 2012 à 21:32
.... bonjour

Voila une partie du code et l'erreur générée sous VB2010 alors que c'est ok sous VB2008 :

Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.


Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'Création Panel_Question
        Dim Panel_Question As New Panel
        Panel_Question.Name = "Panel_Question"
        Panel_Question.BackColor = Color.Transparent
        Panel_Question.Visible = True
        Me.Controls.Add(Panel_Question)
        AddHandler Panel_Question.MouseDown, AddressOf Panel_Question_MouseDown

        Select Case Mode

            Case "Valider_Creer_Question"

                Call Creer_Boutons_Creation()
                Call Gerer_Enable_Boutons_Creation()

                'Taille et position du panel
                Panel_Question.Size = New Size(Me.ClientSize.Width, Me.ClientSize.Height - 2 * Marge - Me.Controls("Button_Valider").Height)
                Panel_Question.Location = New Point(0, 0)

                Call Creer_Et_Afficher_Question()

                Mode = "Valider_Creer_Question_Temp"

            Case "Editer_Question"

........


Le programme VB2008 plante sous VB2010 à l'instruction Call Creer_Et_Afficher_Question() et génère cette erreur :

Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

Public Sub Creer_Et_Afficher_Question() fait partie du module1.


Option Strict On
Option Explicit On

Imports Microsoft.DirectX.AudioVideoPlayback

Module Module1

.....

Public Sub Creer_Et_Afficher_Question()

        'Panel_Affichage de la question
        Select Case mode
            Case "Noeud_Question_Selectionne", "Noeud_Question_Importee_Selectionne", _
                 "Imprimer_Sans_Solution", "Imprimer_Avec_Solution"
                Panel_Affichage = CType(Form1.Controls("Panel_Image_Question"), Panel)
            Case Else
                Panel_Affichage = CType(Form6.Controls("Panel_Question"), Panel)
        End Select

        '-----------------------------

        'Calcul de l'echelle d'affichage par rapport à la création
        Dim Array_Valeur(1) As String
        Array_Valeur = Question.Taille_Ecran.Split(Caractere_Separateur_Champs)
        Coefficient_Affichage = Math.Min(Screen.PrimaryScreen.Bounds.Width / CInt(Array_Valeur(0)), _
                                  Screen.PrimaryScreen.Bounds.Height / CInt(Array_Valeur(1)))

                '-----------------------------

        'Effacement, suppression de tous les controles du panel d'affichage de la question à afficher
        Panel_Affichage.Controls.Clear()

        '-----------------------------

        'Création du textbox de saisie
        If Mode "Valider_Creer_Question" OrElse Mode "Editer_Question" OrElse Mode = "Creer_Editer_Entete_Impression" Then
            Call Creer_Textebox_De_Saisie()
        End If

        '-----------------------------

        'Intitulé de la question - Label_Intitule_Question
        Call Creer_Label_Intitule_Question()

        'Chargement du son
        If Question.Audio <> Nothing Then Form6.Lecteur_Audio = New Audio(Question.Audio)

        'Chargement image ou video dans leur CTL receptacle respectif
        If Question.Image_Ou_Video <> Nothing Then
            If My.Computer.FileSystem.GetFileInfo(Question.Image_Ou_Video).Extension.ToUpper <> ".AVI" Then
                Call Creer_Image()
            Else 'Video
                Call Creer_Panel_Video()
            End If
        End If

        'Page d'entête d'impression
        If Question.Type = "Entete_Impression" Then Call Creer_Editer_Entete_Impression(Question.Nb_Items_Colonnes_Itemsgauche)

        'Question QCM
        If Question.Type = "QCM" Then Call Creer_Question_QCM(Question.Nb_Items_Colonnes_Itemsgauche)

        'Question Zones_Image
        If Question.Type = "Zones_Image" AndAlso Question.Image_Ou_Video <> Nothing Then
            Call Centrer_Image_Seule()
            Call Creer_Question_Zones_Image()
        End If

        '-----------------------------

        'Affichage du pb de la question si édition
        If (Mode "Editer_Question" OrElse Mode "Editer_Question_Importee") _
                AndAlso Question.Probleme <> Nothing Then
            Dim titre_MessageBox As String
            Dim msg_MessageBox As String = Nothing
            Dim boutons_MessageBox As MessageBoxButtons
            Dim icone_boutons_MessageBox As MessageBoxIcon
            titre_MessageBox = "Problème sur la question"
            'msg_MessageBox = "Erreur" & Environment.NewLine
            If Question.Probleme.Contains("Audio") Then msg_MessageBox = msg_MessageBox & "Audio" & Environment.NewLine
            If Question.Probleme.Contains("Image") Then msg_MessageBox = msg_MessageBox & "Image" & Environment.NewLine
            If Question.Probleme.Contains("Document") Then msg_MessageBox = msg_MessageBox & "Document" & Environment.NewLine
            If Question.Probleme.Contains("Police_Intitule") Then msg_MessageBox = msg_MessageBox & "Police intitulé" & Environment.NewLine
            If Question.Probleme.Contains("Police_Items") Then msg_MessageBox = msg_MessageBox & "Police items" & Environment.NewLine
            boutons_MessageBox = MessageBoxButtons.OK
            icone_boutons_MessageBox = MessageBoxIcon.Error
            MessageBox.Show(msg_MessageBox, titre_MessageBox, boutons_MessageBox, icone_boutons_MessageBox)
        End If

         
    End Sub

.......



Je suis preneur de tous renseignements ... Merci
0
Rejoignez-nous