Seite 1 von 1

Probleme mit einer DLL

Verfasst: 05.01.2006 20:25
von kaitec
Hallo, ich habe eine DLL für mein RS232 Programm geschrieben und bei der DLL zeig er immer an "The following procedure has been 'Declared bot not defined: Open Com", aber wenn ich den Code in einem PB-Programm schreibe (natürlich das DeclareDLL in Declare geändert) funzt der Code!

Code: Alles auswählen

DeclareDLL   ResetDTR(hCom.l)
DeclareDLL   SetDTR(hCom.l)
DeclareDLL   ResetRTS(hCom.l)
DeclareDLL   SetRTS(hCom.l)
DeclareDLL   ResetTXD(hCom)
DeclareDLL   SetTXD(hCom.l)
DeclareDLL.l GetCTS(hCom.l)
DeclareDLL.l GetDSR(hCom.l)
DeclareDLL.l GetRING(hCom.l)
DeclareDLL.l GetRLSD(hCom.l)
DeclareDLL   SendChar(hCom.l, Wert.l)
DeclareDLL.l ReadChar(hCom.l)
DeclareDLL.l OpenCom(Nr.l, Baud.l, Bits.b, Stop.b, Parity.b)
DeclareDLL   CloseCom(hCom.l)

ProcedureDLL LoadCom1()
;DTR  = -/+5V (out)
;CTS  = +5V (in)  [Ergebnis: 0=off(0V), 1=on(+5V)
;RTS  = -/+5V (out)



Structure ComDCB
     DCBlength.l
     BaudRate.l
     fBinary.l
     fParity.l
     fOutxCtsFlow.l
     fOutxDsrFlow.l
     fDtrControl.l
     fDsrSensitivity.l
     fTXContinueOnXoff.l
     fOutX.l
     fInX.l
     fErrorChar.l
     fNull.l
     fRtsControl.l
     fAbortOnError.l
     fDummy2.l
     wReserved.w
     XonLim.w
     XoffLim.w
     ByteSize.b
     Parity.b
     StopBits.b
     XonChar.b
     XoffChar.b
     ErrorChar.b
     EofChar.b
     EvtChar.b
     wReserved1.w
EndStructure

Name.s = "Com1"
hCom.l = OpenCom(1,19200,8,#ONESTOPBIT, #NOPARITY)
If hCom > #INVALID_HANDLE_VALUE
     ;Delay(1000)
     ;ResetDTR(hCom)
     ;SetRTS(hCom)
     ;Delay(1000)
     ;ResetRTS(hCom)
     ;Delay(1000)
     ;SetDTR(hCom)
     ;Delay(1000)
     EndIf 
  EndProcedure
Wer kann mir helfen

MfG

Verfasst: 05.01.2006 21:26
von hardfalcon
Ganz einfach: Wenn du Declare oder DeclareDLL verwendest, dann muss die deklarierte Procedure selbstverständlich auch mit Procedure bzw. ProcedureDLL definiert (sprich erstellt) werden! :wink: