VB10: Comment savoir si Windows est en 32bits ou 64bits ?

Duke49 Messages postés 552 Date d'inscription jeudi 12 octobre 2006 Statut Non membre Dernière intervention 24 janvier 2023 - 22 nov. 2010 à 12:01
Duke49 Messages postés 552 Date d'inscription jeudi 12 octobre 2006 Statut Non membre Dernière intervention 24 janvier 2023 - 22 nov. 2010 à 14:49
Salut ^^

La question dis tout :)
Je trouve pas la bib sous .NET... help please

3 réponses

Duke49 Messages postés 552 Date d'inscription jeudi 12 octobre 2006 Statut Non membre Dernière intervention 24 janvier 2023 4
22 nov. 2010 à 14:19
Public Class Form1

    Public Structure SYSTEM_INFO
        Dim dwOemID As Long
        Dim dwPageSize As Long
        Dim lpMinimumApplicationAddress As Long
        Dim lpMaximumApplicationAddress As Long
        Dim dwActiveProcessorMask As Long
        Dim dwNumberOrfProcessors As Long
        Dim dwProcessorType As Long
        Dim dwAllocationGranularity As Long
        Dim dwReserved As Long
    End Structure
    Public Declare Sub GetSystemInfo Lib "kernel32" Alias "GetSystemInfo" (ByVal lpSystemInfo As SYSTEM_INFO)


Si je fait:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim a As SYSTEM_INFO

        GetSystemInfo(a)


ERREUR: AccessViolationException
0
Duke49 Messages postés 552 Date d'inscription jeudi 12 octobre 2006 Statut Non membre Dernière intervention 24 janvier 2023 4
22 nov. 2010 à 14:33
Ce code là est fiable ???

    Public Function Is64bit() As Boolean
        Dim rt As Integer
        rt = Marshal.SizeOf(GetType(Int64))
        Is64bit False : If rt 8 Then Is64bit = True
    End Function
0
Duke49 Messages postés 552 Date d'inscription jeudi 12 octobre 2006 Statut Non membre Dernière intervention 24 janvier 2023 4
22 nov. 2010 à 14:49
rin a voir avec mon pb de detection...

BUG VB10 avec clipboard sous windows xp sp3:

Clipboard.SetText("hello", TextDataFormat.Text)

il faut corriger par:

Clipboard.SetText("hello", CInt(TextDataFormat.Text))
0
Rejoignez-nous