Leerzeichen in Funktionsname

Anfängerfragen zum Programmieren mit PureBasic.
Benutzeravatar
uweb
Beiträge: 461
Registriert: 13.07.2005 08:39

Leerzeichen in Funktionsname

Beitrag von uweb »

Hallo,

ich will eine DLL für den Serv-U FTP-Server schreiben bekomme nur Abstürze bzw kann nicht kompilieren.
Mein Verdacht : Die Namenskonvention.

Wenn jemand noch andere Fehler findet wäre das auch hilfreich.

DANKE im voraus !!!

Uwe
int __cdecl HandleClientEvent(RClientEventStr* pEventStruc)

Please note that the function name is case sensitive and uses the "C" calling convention. This is defined as "generate underbars, case sensitive, push parameters right to left, calling function cleans stack". For the Borland line of C/C++ compilers (and those were used to create Serv-U) this is the default calling convention, or it can be specified explicitly by using the ‘__cdecl’ keyword. For other compilers you may have to use a different keyword. Check your compiler’s documentation for a matching type. Using the wrong calling convention will likely result in a program crash immediately during or after the first time Serv-U tries to call the HandleClientEvent() function.

Code: Alles auswählen

Structure RClientEventStr
    Event.l
    Flag.l 
;    User.s[40]
    User.s[151]
    Aux.s[512]
    HostIP.s[16]
    SessionID.l
    DomainID.l
    DomainPort.l
EndStructure    
     

Enumeration
  #SRVU_LoginMesFile	    ; 1       // get login message file
  #SRVU_HomeDir           ; 2	// get home dir
  #SRVU_Password          ; 3	// verify password
  #SRVU_IPAccess          ; 4	// verify IP access
  #SRVU_WriteFile         ; 5	// verify write access
  #SRVU_ReadFile          ; 6	// verify Read access
  #SRVU_ModifyFile        ; 7	// verify modify/delete file access
  #SRVU_ExecProg          ; 8	// verify execute access
  #SRVU_ListDir           ; 9	// verify dir listing access
  #SRVU_ChangeDir         ;10	// verify dir change access
  #SRVU_DeleteDir         ;11	// verify dir delete access
  #SRVU_CreateDir         ;12	// verify dir create access
  #SRVU_HideHidden		    ;13	// get setting For 'hide hidden files'
  #SRVU_RelPaths		      ;14	// get setting For 'relative paths'
  #SRVU_RatioType		      ;15	// get setting For type of ratios
  #SRVU_RatioDown		      ;16	// get setting For download ratio
  #SRVU_RatioUp   		    ;17	// get setting For upload ratio
  #SRVU_RatioCredit	      ;18	// get/ajust ratio credit setting
  #SRVU_RatioFree		      ;19	// determine If file is free For ratios
  #SRVU_QuotaEnable	      ;20	// determine If disk quota limitation is enabled
  #SRVU_QuotaChange	      ;21	// change in disk quota
  #SRVU_QuotaMax		      ;22	// maximum disk quota
  #SRVU_AlwaysLogin	      ;23	// allways allow login
  #SRVU_OneLoginPerIP	    ;24	// allow only one login per user/IP pair
  #SRVU_LogClientIP       ;25      // log client from this IP address
  #SRVU_SpeedLimit        ;26      // maximum transfer speed
  #SRVU_PassChange        ;27      // change password
  #SRVU_TimeOut           ;28      // get user time-out value
  #SRVU_MaxUsers          ;29      // max. no. of users For account
  #SRVU_PassChallenge     ;30      // get password challenge If needed
  #SRVU_Connect           ;31      // information only: client connected
  #SRVU_Close             ;32      // information only: client disconnected
  #SRVU_MaxLoginPerIP     ;33      // get how often same user is allowed To log in concurrently
  #SRVU_VerifyPasswd      ;34      // verify old password before changing it
EndEnumeration



ProcedureDLL xxxHandleClientEvent(*pEventStruc.RClientEventStr)
  If *pEventStruc\Event = #SRVU_ListDir And Right(*pEventStruc\Aux.s, 3) = "BMP"
    *pEventStruc\Flag = 0
    ProcedureReturn 1
  Else
    *pEventStruc\Flag = 1
    ProcedureReturn 0
  EndIf
EndProcedure

; ProcedureDLL __cdecl HandleClientEvent(*pEventStruc.RClientEventStr)
ProcedureDLL HandleClientEvent(*pEventStruc.RClientEventStr)
  *pEventStruc\Flag = 1
  ProcedureReturn 1
EndProcedure
Benutzeravatar
MVXA
Beiträge: 3823
Registriert: 11.09.2004 00:45
Wohnort: Bremen, Deutschland
Kontaktdaten:

Beitrag von MVXA »

ProcedureCDLL
Bild
Benutzeravatar
uweb
Beiträge: 461
Registriert: 13.07.2005 08:39

Beitrag von uweb »

Code: Alles auswählen

ProcedureCDLL __cdecl HandleClientEvent(*pEventStruc.RClientEventStr)
Zeile 64: 'HandleClientEvent' is not a valid operator.
Danke, trotzdem für die schnelle Antwort.

edit :

Arrrghhh
Bin ich blöde !

Code: Alles auswählen

ProcedureCDLL HandleClientEvent(*pEventStruc.RClientEventStr)
geht !

Danke noch einmal !
Antworten