Bonjour,
Dans la mesure où je ne fais pas fausse route pour le résultat recherché, modifier une table, je n'arrive pas trouver le nom de classe nécessaire dans le code suivant.
J'ai le message d'erreur lors de l'exécution du programme : "Exception: Chaîne de classe incorrecte"
Nota : midas.dll est bien enregistrée : message : "DllRegisterServer dans C:\Windows\System32\midas.dll réussi."
Merci d'avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 function Test_dll(): Boolean; var Tblazw : variant; ErrorCode : Integer; CheminSCV2i, TmpStr : String; begin CheminSCV2i:='C:\SFV3'; //ExtractTemporaryFile('midas.dll'); //RegisterServer(False, ExpandConstant('{tmp}\midas.dll'), False); TmpStr:= 'C:\Windows\System32\midas.dll'; if not Exec('regsvr32.exe', TmpStr, '', SW_SHOW, ewWaitUntilTerminated, ErrorCode) then begin MsgBox('Pb avec regsvr32.exe midal.dll : <' + TmpStr + '> ! Erreur : ' + SysErrorMessage(ErrorCode) , mbInformation, mb_Ok); result:=false; exit; end; try //--- idem avec 'midas.TCustomClientDataSet' Tblazw := CreateOleObject('midas.TClientDataSet'); //<<< "Exception: Chaîne de classe incorrecte" except RaiseException('Erreur avec midas.dll'#13#13'(Error ''' + GetExceptionMessage + ''' occurred)'); end; Tblazw.LoadFromFile(CheminSCV2i + '\ParScv2.azw'); try Tblazw.first; while not Tblazw.eof do begin if (Tblazw.FieldValues['LIB'] = 'REPECHANGE') then Tblazw.FieldValues['VALEUR'] := CheminSCV2i; Tblazw.Next; end; finally Tblazw.Free; end; UnregisterServer(False, ExpandConstant('{tmp}\midas.dll'), False); //DeleteFile('{tmp}\midas.dll'); end;
Partager