Für 64Bit Programieren?

  • VB.NET

Es gibt 6 Antworten in diesem Thema. Der letzte Beitrag () ist von m0nst3rkill3r.

    Hi, danke für deine Hilfe.
    Hier ist mein Code.

    VB.NET-Quellcode

    1. Imports System.Xml
    2. Imports System.IO
    3. Imports System.Net
    4. Imports System.Text
    5. Imports GammaJul.LgLcd
    6. ''' <summary>
    7. ''' The main module which runs when the program is executed
    8. ''' </summary>
    9. ''' <remarks>Sub Main is the first procedure to run.</remarks>
    10. Module Main2
    11. 'Declare the LCD class
    12. Public lcd As New lcd(AddressOf ButtonPress, AddressOf ConfigPress)
    13. ''' <summary>
    14. ''' The Main subroutine of the application which runs on execution.
    15. ''' </summary>
    16. Sub Main()
    17. 'Init the LCD
    18. lcd.InitLCD("JDownloader G15 Applet")
    19. 'With the LCD initialised, lets draw something
    20. Dim x = 1
    21. While x = 1
    22. DrawLcd()
    23. lcd.UpdateLCD()
    24. End While
    25. 'Allows the application to consistently
    26. Application.Run()
    27. End Sub
    28. ''' <summary>
    29. ''' Does some sample drawing on the LCD.
    30. ''' </summary>
    31. '''
    32. ''' <remarks></remarks>
    33. '''
    34. Public Sub DrawLcd()
    35. Downloader.dwlByLink("http://localhost:10025/get/downloads/currentlist", "C:\Users\Jdown.xml")
    36. Dim img As New System.Drawing.Bitmap(160, 43)
    37. Dim screen As Drawing.Graphics = Graphics.FromImage(img)
    38. Dim strformat As New Drawing.StringFormat
    39. strformat.Alignment = StringAlignment.Center
    40. strformat.LineAlignment = StringAlignment.Center
    41. Dim m_xmlr As XmlTextReader
    42. m_xmlr = New XmlTextReader("C:\Users\Jdown.xml")
    43. m_xmlr.WhitespaceHandling = WhitespaceHandling.None
    44. m_xmlr.Read()
    45. While Not m_xmlr.EOF
    46. If m_xmlr.IsStartElement() AndAlso m_xmlr.Name = "file" Then
    47. screen.DrawString(m_xmlr.GetAttribute("file_name"), New Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Pixel), Brushes.White, New RectangleF(0, 0, 170, 10))
    48. screen.DrawRectangle(Pens.White, New Rectangle(2, 13, 100, 5))
    49. screen.FillRectangle(Brushes.White, New Rectangle(2, 13, (0 + m_xmlr.GetAttribute("file_percent")), 5))
    50. screen.DrawString("" & m_xmlr.GetAttribute("file_percent") & "%", New Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Pixel), Brushes.White, New RectangleF(104, 10, 170, 10))
    51. screen.DrawString(m_xmlr.GetAttribute("file_status"), New Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Pixel), Brushes.White, New RectangleF(0, 20, 170, 10))
    52. screen.DrawString(m_xmlr.GetAttribute("file_package"), New Font("Arial", 10, FontStyle.Regular, GraphicsUnit.Pixel), Brushes.White, New RectangleF(0, 30, 170, 10))
    53. End If
    54. m_xmlr.Read()
    55. End While
    56. lcd.DrawLCD(img)
    57. lcd.UpdateLCD()
    58. m_xmlr.Close()
    59. End Sub
    60. ''' <summary>
    61. ''' Function to handle an LCD button being pressed.
    62. ''' </summary>
    63. ''' <param name="device">The device on which the button was pressed.</param>
    64. ''' <param name="dwButtons">The value of the button pressed.</param>
    65. ''' <param name="pContext"></param>
    66. ''' <returns></returns>
    67. ''' <remarks></remarks>
    68. Public Function ButtonPress(ByVal device As Integer, ByVal dwButtons As Integer, ByVal pContext As System.IntPtr) As Integer
    69. 'Button presses are passed to this routine
    70. Select Case dwButtons
    71. Case 1
    72. ' Button 1
    73. Case 2
    74. Case 4
    75. Case 8
    76. End Select
    77. End Function
    78. ''' <summary>
    79. ''' Function to handle the Configuration button being pressed in the LCD Manager.
    80. ''' </summary>
    81. ''' <param name="connection">The connection number of the application selected.</param>
    82. ''' <param name="pcontext"></param>
    83. ''' <returns></returns>
    84. ''' <remarks></remarks>
    85. Public Function ConfigPress(ByVal connection As Integer, ByVal pcontext As System.IntPtr) As Integer
    86. ' This function is called when the "Config" button is pressed in the Logitech LCD Manager
    87. ' If you want a form to appear to provide a GUI, then the following line works:
    88. ' Note: Just using .Show will not work [try it and see ;-)]
    89. 'However, the above line blocks the running of the application (No LCD updates)
    90. 'So instead, you can open this dialog in a new thread.
    91. 'To do this use the following code:
    92. 'Dim a As New Threading.Thread(AddressOf Showdialog)
    93. 'a.Start()
    94. ''Then create the following new subroutine
    95. ''Public Sub Showdialog()
    96. 'ConfigureScreen.ShowDialog()
    97. lcd.UpdateLCD()
    98. End Function
    99. End Module

    grüße
    Falls du dein Programm für x64 kompilieren willst, musst im Menü folgende Schritte machen:

    Erstellen > Konfigurations-Manager > Dein Projekt > Plattform > Neu > Neue Plattform > x64

    Dann alles abspeichern.

    Falls der Menüpunkt "Konfigurations-Manager" nicht erscheint, musst du davor folgende Einstellung vornehmen:

    Extras > Optionen > "Alle Einstellungen anzeigen" (Häkchen setzen)

    Allerdings garantiert das nicht, dass dein Programm dann läuft. Es ist immer wahrscheinlicher (außer bei MDX),
    dass der Fehler im Code liegt.

    mfg Lindi666
    Hi!
    Dann bekomm ich aber ne Menge warnungen :/
    und Any"PROCESSOR" sollte doch auch bei x64 funzen :/

    ohoh.. Ja, also 2 Posts übersehen^^
    Wenn ich es auf X64 stelle gibts Warnungen

    Edith:
    Habs mal jetzt als angebliche 64Bit version gekompiled. Ich schiebs mal meinen Cousain unter und gucke obs geht.

    Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von „m0nst3rkill3r“ ()