Prototype
Verfasst: 20.02.2013 21:16
				
				Hallo,
ich habe ein Problem mit Prototype.
Hier der Code:
Die DLL ist von FTDI.
http://www.ftdichip.com/Drivers/D2XX.htm
Wenn ich das Programm starte ,wird es ohne das Fenster anzeigen sofort beendet.
Wird aber der MessageRequester aus kommentiert, funktionert alles.
Mit PB 4.51 funktioniert es auch mit MessageRequester.
Was mache ich falsch?
Ich hoffe Ihr könnt mir helfen
Gruß
Georg
Windows XP Prof. SP3
PB 5.10
			ich habe ein Problem mit Prototype.
Hier der Code:
Code: Alles auswählen
EnableExplicit
EnableExplicit
Global Result
Enumeration
  #WndMain
EndEnumeration  
Enumeration
  #gBtn_1
  #gBtn_2
  #gStr_1
EndEnumeration 
Enumeration 
  #DLL
EndEnumeration 
; 
Prototype.i ProtoFT_Open(iDevice , ftHandle)
Prototype.i ProtoFT_OpenEx (pvArg1$,dwFlags,ftHandle)
Prototype.i ProtoFT_GetDeviceInfo(ftHandle,pftDevice,pdeviceID,pSerialNumber$,pDescription$,dummy)
Prototype.i ProtoFT_Close(ftHandle)
Prototype.i ProtoFT_SetBaudRate(ftHandle, ftBautrate)
Prototype.i ProtoFT_SetDataCharacteristics(ftHandle, uWordLength,uStopBits,uParity)
Prototype.i ProtoFT_SetTimeouts(ftHandle,dwReadTimeout, dwWriteTimeout)
Prototype.i ProtoFT_Write(ftHandle, lpBufferW,Lenge ,Written)
Prototype.i ProtoFT_Read(ftHandle,  lpBufferR, Lenge ,Returned)
Prototype.i ProtoFT_SetEventNotification(ftHandle,EventMask,hEvent)
Prototype.i ProtoFT_FT_GetStatus(ftHandle, lpdwAmountInRxQueue,lpdwAmountInTxQueue, lpdwEventStatus)
Result = OpenLibrary(#DLL, "ftd2xx.dll")
If Result = 0
 MessageRequester("EA-EL 3160-60","ftd2xx.dll konnte nicht geladen werden" + Chr(10) + "Das Programm wird beendet",#PB_MessageRequester_Ok)
 End
EndIf
; 
Global FT_Open.ProtoFT_Open = GetFunction(#DLL,"FT_Open")
Global FT_Close.ProtoFT_Close = GetFunction(#DLL,"FT_Close")
Global FT_GetDeviceInfo.ProtoFT_GetDeviceInfo = GetFunction(#DLL,"FT_GetDeviceInfo")
; Global FT_SetBaudRate.ProtoFT_SetBaudRate = GetFunction(#DLL,"FT_SetBaudRate")
; Global FT_OpenEx.ProtoFT_OpenEx = GetFunction(#DLL,"FT_OpenEx") 
; Global FT_SetDataCharacteristics.ProtoFT_SetDataCharacteristics = GetFunction(#DLL,"FT_SetDataCharacteristics")
; Global FT_SetTimeouts.ProtoFT_SetTimeouts = GetFunction(#DLL,"FT_SetTimeouts")
; Global FT_Write.ProtoFT_Write = GetFunction(#DLL,"FT_Write")
; Global FT_Read.ProtoFT_Read = GetFunction(#DLL,"FT_Read")
; Global FT_SetEventNotification.ProtoFT_SetEventNotification = GetFunction(#DLL,"FT_SetEventNotification")
; Global FT_GetStatus.ProtoFT_FT_GetStatus = GetFunction(#DLL,"FT_GetStatus")
CloseLibrary(#DLL)
 
OpenWindow(#WndMain, 300, 200, 500, 500, "EA-EL 3160-60", #PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget);|#PB_Window_Invisible)
ButtonGadget(#gBtn_1, 10,10,72,24,"")
ButtonGadget(#gBtn_2,100,10,72,24,"")
StringGadget(#gStr_1,200,10,200,24,"")
;HideWindow(#WndMain, #False)
Repeat
  
  Select WaitWindowEvent() 
      
    Case #PB_Event_CloseWindow
      Select EventWindow() 
        Case #WndMain  
          End
      EndSelect  
      
    Case #PB_Event_Gadget
      Select EventGadget()
        Case #gBtn_1
          
        Case #gBtn_2
          
      EndSelect
      
  EndSelect 
  
ForEver
End
http://www.ftdichip.com/Drivers/D2XX.htm
Wenn ich das Programm starte ,wird es ohne das Fenster anzeigen sofort beendet.
Wird aber der MessageRequester aus kommentiert, funktionert alles.
Mit PB 4.51 funktioniert es auch mit MessageRequester.
Was mache ich falsch?
Ich hoffe Ihr könnt mir helfen
Gruß
Georg
Windows XP Prof. SP3
PB 5.10