Hallo
ich habe ein Delphi-Programm geschrieben mit dem ich die Schnittstelle eines
Statik-Stabwerksprogramm (RStab5) steuere.
Von dem Stabwerksprogramm gibt es eine -TLB.Pas.
Mein Programm übergibt nun Daten als Records an die -TLB.Pas.
Dabei gibt es bei der Function rsGetLoadCaseArr ein Problem mit der Übergabe, es wird
immer nur ein Recordsatz übergeben.
Auszug aus der -TLB.Pas
<PRE>
PUserType13 = ^RS_LOAD_CASE; {*}
RS_LOAD_CASE = packed record
iNo: SYSINT;
strDescription: WideString;
fLCFactor: Single;
type_: RS_LOAD_CASE_TYPE;
bSelfWeight: WordBool;
direction: IPOINT;
strRemark: WideString;
end;
IrsLoads = interface(IUnknown)
['{682314D2-80AD-4374-A7F9-C15B35AEF2D3}']
function rsSetLoadCaseArr(iSize: SYSINT; var pArray: RS_LOAD_CASE): HResult;
stdcall;
end;
</PRE>
Programm-Version 1
<PRE>
Procedure P_Dlubal.Lastfaelle(R1,R2,R3,R4 : Single; I2 : Integer;
S1,S2 : WideString; B1 : WordBool);
Var St_Load_Case : Array[1..200] of Rs_Load_Case;
Begin
Inc(Lf_Num);
St_Load_Case[Lf_Num].iNo := Lf_Num; {Lastfall-Nummer}
St_Load_Case[Lf_Num].fLCFactor := R1; {Lastfall-Faktor}
St_Load_Case[Lf_Num].bSelfWeight := B1; {0 = ohne ,1 = mit Eg.}
St_Load_Case[Lf_Num].Direction.x := R2; {Lastfallfaktor in x}
St_Load_Case[Lf_Num].Direction.y:= R3; {Lastfallfaktor in y}
St_Load_Case[Lf_Num].Direction.z := R4; {Lastfallfaktor in z}
St_Load_Case[Lf_Num].Type_ := I2; {Lastfall-Art}
St_Load_Case[Lf_Num].strDescription:= S1; {Lastfall-Bezeichnung}
St_Load_Case[Lf_Num].strRemark := S2; {Kommentar}
V_Position.rsGetLoads(V_Irs_L);
V_Position.rsPrepareModification;
V_Irs_L.rsSetLoadCASEArr(Lf_Num, St_Load_Case[Lf_Num]);
V_Position.rsFinishModification;
End;
</PRE>
Nach dem Kauf des Buches Com/DCom Com+ von Herrn Kosch habe ich die Procedure umgeschrieben und erhalte nun die folgende Fehlermeldung:
„Die Typen der tatsächlichen und formalen Var-Parameter müssen übereinstimmen“
Was mache ich falsch????
Programm-Version 2
<PRE>
Procedure P_Dlubal.Lastfaelle(R1,R2,R3,R4 : Single; I2 : Integer;
S1,S2 : WideString; B1 : WordBool);
Var P_St_Load_Case : PUserType14;
St_Load_Case : Rs_Load_Case;
Begin
Inc(Lf_Num);
St_Load_Case.iNo := Lf_Num; {Lastfall-Nummer}
St_Load_Case.fLCFactor := R1; {Lastfall-Faktor}
St_Load_Case.bSelfWeight := B1; {0 = ohne ,1 = mit Eg.}
St_Load_Case.Direction.x := R2; {Lastfallfaktor in x}
St_Load_Case.Direction.y:= R3; {Lastfallfaktor in y}
St_Load_Case.Direction.z := R4; {Lastfallfaktor in z}
St_Load_Case.Type_ := I2; {Lastfall-Art}
St_Load_Case.strDescription:= S1; {Lastfall-Bezeichnung}
St_Load_Case.strRemark := S2; {Kommentar}
P_St_Load_Case := @St_Load_Case;
V_Position.rsGetLoads(V_Irs_L);
V_Position.rsPrepareModification;
V_Irs_L.rsSetLoadCASEArr(Lf_Num, P_St_Load_Case);
V_Position.rsFinishModification;
End;
</PRE>
Im voraus besten Dank für Eure Hilfe
G.Schönhofer
ich habe ein Delphi-Programm geschrieben mit dem ich die Schnittstelle eines
Statik-Stabwerksprogramm (RStab5) steuere.
Von dem Stabwerksprogramm gibt es eine -TLB.Pas.
Mein Programm übergibt nun Daten als Records an die -TLB.Pas.
Dabei gibt es bei der Function rsGetLoadCaseArr ein Problem mit der Übergabe, es wird
immer nur ein Recordsatz übergeben.
Auszug aus der -TLB.Pas
<PRE>
PUserType13 = ^RS_LOAD_CASE; {*}
RS_LOAD_CASE = packed record
iNo: SYSINT;
strDescription: WideString;
fLCFactor: Single;
type_: RS_LOAD_CASE_TYPE;
bSelfWeight: WordBool;
direction: IPOINT;
strRemark: WideString;
end;
IrsLoads = interface(IUnknown)
['{682314D2-80AD-4374-A7F9-C15B35AEF2D3}']
function rsSetLoadCaseArr(iSize: SYSINT; var pArray: RS_LOAD_CASE): HResult;
stdcall;
end;
</PRE>
Programm-Version 1
<PRE>
Procedure P_Dlubal.Lastfaelle(R1,R2,R3,R4 : Single; I2 : Integer;
S1,S2 : WideString; B1 : WordBool);
Var St_Load_Case : Array[1..200] of Rs_Load_Case;
Begin
Inc(Lf_Num);
St_Load_Case[Lf_Num].iNo := Lf_Num; {Lastfall-Nummer}
St_Load_Case[Lf_Num].fLCFactor := R1; {Lastfall-Faktor}
St_Load_Case[Lf_Num].bSelfWeight := B1; {0 = ohne ,1 = mit Eg.}
St_Load_Case[Lf_Num].Direction.x := R2; {Lastfallfaktor in x}
St_Load_Case[Lf_Num].Direction.y:= R3; {Lastfallfaktor in y}
St_Load_Case[Lf_Num].Direction.z := R4; {Lastfallfaktor in z}
St_Load_Case[Lf_Num].Type_ := I2; {Lastfall-Art}
St_Load_Case[Lf_Num].strDescription:= S1; {Lastfall-Bezeichnung}
St_Load_Case[Lf_Num].strRemark := S2; {Kommentar}
V_Position.rsGetLoads(V_Irs_L);
V_Position.rsPrepareModification;
V_Irs_L.rsSetLoadCASEArr(Lf_Num, St_Load_Case[Lf_Num]);
V_Position.rsFinishModification;
End;
</PRE>
Nach dem Kauf des Buches Com/DCom Com+ von Herrn Kosch habe ich die Procedure umgeschrieben und erhalte nun die folgende Fehlermeldung:
„Die Typen der tatsächlichen und formalen Var-Parameter müssen übereinstimmen“
Was mache ich falsch????
Programm-Version 2
<PRE>
Procedure P_Dlubal.Lastfaelle(R1,R2,R3,R4 : Single; I2 : Integer;
S1,S2 : WideString; B1 : WordBool);
Var P_St_Load_Case : PUserType14;
St_Load_Case : Rs_Load_Case;
Begin
Inc(Lf_Num);
St_Load_Case.iNo := Lf_Num; {Lastfall-Nummer}
St_Load_Case.fLCFactor := R1; {Lastfall-Faktor}
St_Load_Case.bSelfWeight := B1; {0 = ohne ,1 = mit Eg.}
St_Load_Case.Direction.x := R2; {Lastfallfaktor in x}
St_Load_Case.Direction.y:= R3; {Lastfallfaktor in y}
St_Load_Case.Direction.z := R4; {Lastfallfaktor in z}
St_Load_Case.Type_ := I2; {Lastfall-Art}
St_Load_Case.strDescription:= S1; {Lastfall-Bezeichnung}
St_Load_Case.strRemark := S2; {Kommentar}
P_St_Load_Case := @St_Load_Case;
V_Position.rsGetLoads(V_Irs_L);
V_Position.rsPrepareModification;
V_Irs_L.rsSetLoadCASEArr(Lf_Num, P_St_Load_Case);
V_Position.rsFinishModification;
End;
</PRE>
Im voraus besten Dank für Eure Hilfe
G.Schönhofer