none
Kann mir das Jemand irgendwie Erklären jetzt verstehe ich garnix mehr RRS feed

  • Allgemeine Diskussion

  • Hallo,
    auch heute kann ich Euch mit meinen Fragen nicht verschonen (-:
    Mein Problem aus diesem Tread http://social.msdn.microsoft.com/Forums/de-DE/visualbasicde/thread/55f2f6a3-f04f-497d-8815-fc1d5d3dabb7  kennt ihr ja bereits.  Nachdem ich das gesamte Internet auf der Suche nach einer Lösung auf dem kopf gestellt habe und erfolglos blieb, habe ich ein Verzweiflungstat begangen. Und zwar habe ich mir Visual Studio2010 Beta runtergeladen, und habe den selben Code  wie im  oben  genannten Tread dort ausprobiert, Und nun ratet mal, was dann passiert ist ??? Mein Code funktioniert Tatelos. Zu einem freue ich mich das es jetzt geht, auf der anderen Seite ergibt das für mich aber keinen Sinn und wirft neue Fragen auf.
    Wiso warum geht der Code auf einmal Was macht Visual Studio 2010  beim  Debuggen anders als wie Vb2008 express.
    kann mir Jemand das einigermaßen verständlich erklären???

    Gruß Ronny

    Ps bin aber immer noch an einer Lösung interessiert die sich auch Vb2008 erstellen läst.
    Mittwoch, 30. Dezember 2009 11:28

Alle Antworten

  • Hallo Torsten

    Ich schaue wollt gerade nachschauen, ich dächte das kann man im Konfigurations-Manager einstellen, aber irgendwie finde ich den gerade nicht wie komme ich  da nochmal hin ????



    Ronny
    Mittwoch, 30. Dezember 2009 21:07
  • Hallo Ronny,

    Menü "Projekt" => "<Projektname>-Eigenschaften", Bereich "Kompilieren", oben rechts die ComboBox "Plattform"

    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    Mittwoch, 30. Dezember 2009 21:26
  • Danke Bernd hättest ja auch mal MSN anmachen können lach (-:

    Also Seltsamerweiße steht bei mir an dieser stelle nix von AnyCpu Assembly .... sondern ich kann nur auswählen zwischen pdb-only Full und None auswählen.    

    Warum das bei mir anders aussieht weiß ich nicht. ist aber definitiv VB2008 Express.

    Lg Ronny
    Mittwoch, 30. Dezember 2009 21:39
  • hier schau auch das mal
    http://forum.vb-paradise.de/programmieren/hauptforum/31057-32bit-komponenten-unter-64-bit-version/

    ich habe auch solange gebraucht. das system spiel manchmal verrückt. ich habe dann einfach mal neu gestartet und dann gings.

    ansonsten les die Threads durch, Ich glaube der von Thorsten war der beste.

    hau rein
    Mittwoch, 30. Dezember 2009 21:45
  • Sowas wie Platform gibt es da bei mir garnicht , aber ich kann noch auswählen bei Zielframework zwieschen Net-Framework 2.0  ; 3.0 und 3.5

    @ Bernd komm zu Teamviewer ich kanns dir Zeigen, Plattform gibt es definitiv nicht.


    Lg Ronny
    Mittwoch, 30. Dezember 2009 21:45
  • Tja, ich habe auch "nur" die VB 2008 Express und ich habe dort unter Plattform nur "Aktiv (Any Cpu)".
    Liegt halt daran, das es "nur" die Express Edition ist.

    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    Mittwoch, 30. Dezember 2009 21:48
  • Hallo Ronny,

    vergiss meine Frage, hatte überlesen, dass Du VB Express verwendest. Hier ist das Assembly by default immer zu AnyCPU kompiliert. Dein Code im anderen Thread liefert bei mir unter XP jedoch auch kein vernünftiges Ergebnis, daher wundert es mich, dass es mit VB2010 gehen soll.

    Thorsten Dörfler
    Microsoft MVP Visual Basic
    Mittwoch, 30. Dezember 2009 21:49
    Moderator
  • Ich habe auch nur Express Edition,

    nachdem Thosten erklärt hat geht es aber !


    http://social.msdn.microsoft.com/Forums/de-DE/visualbasicde/thread/9a963dc8-c5d2-4d24-b31e-92f2d95cdc2a
    Mittwoch, 30. Dezember 2009 21:50
  • Torsten, hast Du auch die richtige Speicheradresse,  bin mir jetzt nicht ganz Sicher ob die im Code eine statische oder dynamische war, geht am ende mit beiden, nur bei der dynamischen darfst das Spiel nicht neu starten ,nachdem du die adresse ausglesen hast.


    Lg Ronny

    Mittwoch, 30. Dezember 2009 21:54
  • Na, ja,

    >> es mit VB2010 gehen soll.

    Die VB 2010 ist zum einem eine Beta in der Professional Version (oder gar Ultmate); da kann man die Plattform durchaus auswählen (entgegen Express).
    Dann kommt noch hinzu, das da gegen .NET 4.0 kompiliert wird; bei VB 2008 gehen höchsten .NET 3.5
    Ist ja nicht auszuschließen, das in der neuen .NET Version etwas geändert wurde.
    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    Mittwoch, 30. Dezember 2009 21:57
  • So etwas in der Art hatte habe ich mir auch gedacht, wie gesagt der Code geht unter XP wenn ich ihn unter Vista64 bit mit 2008express erstelle geht es nicht, und wenn ich das ganze  mit 2010Beta erstelle unter Vista64bit geht es wieder, wobei das keinen Sinn macht, denn wenn es wirklich am Framework 4.0 liegen sollte, dann würde die Anwendung ja  bei anderen, die kein Framwork4 haben, wieder nicht laufen oder sehe ich das falsch.



    Lg Ronny
    Mittwoch, 30. Dezember 2009 22:03
  • Wenn Du eine Applikation fürs Framework .NET 4.0 erstellst und auf dem Client .NET 4.0 nicht installiert ist, dann funktioniert es so oder so nicht.
    Das gilt für alle Framework Versionen; die Runtime muss vorhanden sein.
    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de
    Mittwoch, 30. Dezember 2009 22:07
  • So Torsten gerade nochmal getestet unter Vista mit VB net2010Beta und funktioniert.


    Findet Spiel und zeigt die Punkte an.  Adresse musst bei Dir nochmal selbst raussuchen somal die unter Xp sowieso anders ist.
    Habe es gerade auch bemerkt in dem Code im anderen Tread irgendwo ein kleiner Fehler, warscheinlich beim reinkopieren passiert, denn ich habe den auch nochmal getestet und ging nicht, der hier unten ist aber 100% richtig und funktioniert auch.
    Public Class Form1
        Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
        Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer
        Private Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
        Dim ExeName As String = "Solitaire"  '!!Ohne ".exe"!!
        Dim Prozess1 As Process
        Public RBuff As Long
    
        Dim pList() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses 'liste aller activen Processe
    
        Public Function ReadLong(ByVal ProcessName As Process, ByVal Address As Integer)
            Dim GameLookUp As Process() = Process.GetProcessesByName(ProcessName.ProcessName)
            If GameLookUp.Length = 0 Then
                End
            End If
            Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, GameLookUp(0).Id)
            ReadProcessMemory(processHandle, Address, RBuff, 4, Nothing)
            CloseHandle(processHandle)
            Return RBuff
        End Function
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            pList = System.Diagnostics.Process.GetProcesses
            For Each proc As System.Diagnostics.Process In pList
                'Dim Name As String = proc.ProcessName
                'ListBox1.Items.Add(Name)
                If proc.ProcessName = ExeName Then
                    Prozess1 = proc
                    Label1.ForeColor = Color.Green
                    Label1.Text = "Spiel gefunden"
                    TextBox1.Text = ReadLong(Prozess1, "&H009CA3A4") 'Lebenszahl
                    Exit Sub
                End If
                Label1.ForeColor = Color.Red
                Label1.Text = "Spiel nicht gefunden"
                TextBox1.Text = Nothing
            Next
        End Sub
    End Class
    Lg Ronny
    Mittwoch, 30. Dezember 2009 22:29
  • Torsten ich weiß warum der Code bei Dir nicht geht, wenn man ihn aus dem anderen Tread rauskopiert, verschwindet  in der Button1 Click Sub....
    Das "Exit Sub" gleich über End If hier. im Tread über mir ist es ordenlich zu sehen.  Dort ist irgendwie ein Anzeigefehler  "ExitSub" steht zwar drin, aber sowie du den Code Markierst wird das "ExitSub" komisch dargestellt und beim Einfügen ist es dann weg.  Ist auch alles Schwarz dort und nicht Bunt wie hier, keine Ahnung was ich da wieder angestellt habe.  (-: 

    Lg Ronny

    Mittwoch, 30. Dezember 2009 22:55
  • Das habe ich auch nich gefudnen

    http://msdn.microsoft.com/en-gb/vstudio/aa718685.aspx

    1.44 References to 32-bit COM components may not work in VB and C# Applications running on 64-bit platforms


    Most existing COM components are only available for 32-bit platforms and will not run in a 64-bit process on a 64-bit platform (although they will run correctly in a 32-bit process on a 64-bit platform). VB and C# applications that reference these 32bit COM components will not run by default on a 64-bit platform because by default the application will launch as a 64-bit process.

    The problem appears when a project with one or more COM references is:
    1. Migrated to Visual Studio 2005 and executed on 64-bit platforms

    -or-
    2. Created using Visual Studio 2005 on 64-bit platforms.

    In Visual Studio 2005, the VB and C# compilers use the platform target property to determine if the.exe or .dll should run in 32-bit or 64-bit CPU architecture mode. The default setting for this property in Visual Studio 2005 is set to 'AnyCPU', which indicates that the application can run in either 32-bit or 64-bit mode, depending on the host platform. In this situation you may see a message such as "Cannot instantiate class..." when you debug or run these applications.

    To resolve this issue

    Set the platform target property to 'X86' for your VB or C# projects that have references to COM components.

    For C# Projects:
    1. Right click the project in the solution explorer and open 'properties'
    2. Choose the Build tab
    3. Set the Platform Target property to 'X86'

    For VB Projects:
    1. Right click the project in the solution explorer and open 'properties'
    2. Choose the Compile tab
    3. Press the Advanced Compile Options... button
    4. Set the Target CPU property to 'X86'

    Express Editions:
    The VB and C# Express products do not expose the Target property inside the development environment. You will need to carefully modify the project file using a text or XML editor.
    1. Close the project and/or solution
    2. Select Open File from the File menu
    3. Navigate to the project directory, and highlight the project file
    4. Press the Open button, the project file should open in the XML editor
    5. Locate the first <PropertyGroup> section and add the following line:
    <PlatformTarget>x86</PlatformTarget>
    1. Save the project file
    2. Reopen the project and/or solution using Open Project/Solution from the File menu
    3. Continue with development, debugging, and testing

    Alternatively, if the application is targeted to 64-bit platforms, you can ensure that the COM controls added to the application have 64-bit equivalents on the development and deployment computers.

    Donnerstag, 31. Dezember 2009 06:59
  • Hallo zusammen,

    Vielleicht hilft auch diese Information noch:

    Im folgenden Artikel wird gezeigt wie man die Erweiterte Buildkonfigurationen für einen Visual Studio Projekt anzeigt und verwenden kann.

    Diese Einstellungen betreffen auch die Visual Studio Express Editionen (inklusiv Visual Web Developer Express Edition).

    http://www.aspnetzone.de/blogs/stefanfalz/archive/2009/05/20/debug-release-wo-ist-die-projektmappenkonfiguration.aspx

    ****************************************************************************************

    Andere Artikel in dem Bereich:

    Gewusst wie: Optimieren einer Anwendung für einen bestimmten CPU-Typ à http://msdn.microsoft.com/de-de/library/5b4eyb0k.aspx

    /platform (Ausgabeplattform festlegen) (Visual Basic- Compileroptionen) à http://msdn.microsoft.com/de-de/library/8ck8e1y2.aspx

    Grüße,

    Robert

    Mittwoch, 17. März 2010 10:00
    Moderator