Hola Omar.
Yo utilizo una clase personalizada del ProjectHook.
En el método BeforeBuil() le saco todos los ReadOnly y guardo el status
previo en una colección.
En el AfterBuild() los restauro.
(Desarrollado en su momento por Damian Eiff)
Procedure BeforBuild
#Define FILE_ATTRIBUTE_NORMAL 128
#Define BUILDACTION_REBUILD 1 && Rebuilds the project
#Define BUILDACTION_BUILDAPP 2 && Creates an .app
#Define BUILDACTION_BUILDEXE 3 && Creates an .exe
#Define BUILDACTION_BUILDDLL 4 && Creates a .dll
#Define BUILDACTION_BUILDMTDLL 5 && Creates a multi-threaded .dll
Declare Integer GetFileAttributes In Win32API String FileName
Declare Integer SetFileAttributes In Win32API String FileName, Integer
Attributes
Local lnAttribute As Number,;
lnRet As Number,;
lnErrFile As Number
Local oFile As Object,;
oErr As Exception,;
loProject As VisualFoxpro.IFoxProject,;
loError As prxErrorHandler Of
"FW\ErrorHandler\prxErrorHandler.prg",;
loFiles As Collection,;
loFile As VisualFoxpro.IFoxPrjFile
Local lnAttributeCT As String,;
lcFile As String,;
lcFileCT As String,;
lcXML As String,;
lcPath As String,;
lcFileName As String
Local llFound As Boolean
Try
With This As pjhook Of tools\ProjectHook\vcx\projecthookvss.vcx
* Set Step On
llFound = .F.
lcPath = This.cProjectPath
For Each loFile As VisualFoxpro.IFoxPrjFile In .oProject.Files
If Inlist( loFile.Type , 'K', 'V', 'R', 'B' ) And File(
loFile.Name ) ;
And loFile.ReadOnly
lcFile = Upper( loFile.Name )
Do Case
Case Right( lcFile, 3 ) = 'SCX'
lcFileCT = Substr( lcFile, 1, Len( lcFile
)- 3 ) + 'SCT'
Case Right( lcFile, 3 ) = 'VCX'
lcFileCT = Substr( lcFile, 1, Len( lcFile
)- 3 ) + 'VCT'
Case Right( lcFile, 3 ) = 'FRX'
lcFileCT = Substr( lcFile, 1, Len( lcFile
)- 3 ) + 'FRT'
Case Right( lcFile, 3 ) = 'LBX'
lcFileCT = Substr( lcFile, 1, Len( lcFile
)- 3 ) + 'LBT'
Otherwise
lcFileCT = ''
Endcase
oFile = Createobject( 'Empty' )
lnAttribute = GetFileAttributes( lcFile )
lnAttributeCT = Iif( File( lcFileCT ),
GetFileAttributes( lcFileCT ), 0 )
AddProperty( oFile, 'FileName', loFile.Name )
AddProperty( oFile, 'Attribute', lnAttribute )
AddProperty( oFile, 'FileNameCT', lcFileCT )
AddProperty( oFile, 'AttributeCT', lnAttributeCT )
lnRet = SetFileAttributes( lcFile,
FILE_ATTRIBUTE_NORMAL )
If File( lcFileCT )
lnRet = SetFileAttributes( lcFileCT,
FILE_ATTRIBUTE_NORMAL )
Endif
.oCollFileStatus.Add( oFile, loFile.Name )
Endif
* Excluir los .h
If Lower( Justext( loFile.Name )) = "h"
loFile.Exclude = .T.
Endif
Endfor
loProject = This.oProject
loProject.Icon = This.Icon
Endwith
Catch To oErr
loError = This.oError
loError.Process( oErr )
Finally
oFile = Null
loFile = Null
loError = Null
loProject = Null
Endtry
Clear Dlls GetFileAttributes
Clear Dlls SetFileAttributes
Endproc
Procedure AfterBuil
Lparameters nError As Number
Declare Integer GetFileAttributes In Win32API String FileName
Declare Integer SetFileAttributes In Win32API String FileName, Integer
Attributes
Local oFile As Object
Local iQ As Integer
Local loFile As VisualFoxpro.IFoxPrjFile
Local oFile As Object
Local iQChg As Number
Local loError As prxErrorHandler Of
"FW\ErrorHandler\prxErrorHandler.prg"
Try
With This As pjhook Of Tools\ProjectHook\VCX\ProjectHookvss.VCX
oFile = Null
iQ = 1
iQChg = 0
Do While .oCollFileStatus.Count > 0 And iQ <=
.oProject.Files.Count
If Isnull( oFile )
oFile = .oCollFileStatus.Item( 1 )
Endif
loFile = .oProject.Files( iQ )
If Inlist( loFile.Type , 'K', 'V', 'R', 'B' ) And
oFile.FileName = loFile.Name
.oCollFileStatus.Remove( 1 )
lnRet = SetFileAttributes( loFile.Name,
oFile.Attribute )
lnRet = SetFileAttributes( oFile.FileNameCT,
oFile.AttributeCT )
oFile = Null
iQChg = iQChg + 1
Endif
iQ = iQ + 1
Enddo
oFile = Null
loFile = Null
.oCollFileStatus.Remove( -1 )
Endwith
Catch To oErr
* loError = Newobject( "prxErrorHandler", "prxErrorHandler.prg" )
loError = This.oError
loError.Process( oErr )
Finally
loError = Null
Wait Clear
Endtry
Clear Dlls GetFileAttributes
Clear Dlls SetFileAttributes
Endproc
Mis 2 centavos
ricardo aidelman
De: [email protected] [mailto:[email protected]] En nombre de Omar Bellio
Enviado el: jueves, 12 de octubre de 2017 10:26
Para: GUFA List Member <[email protected]>
Asunto: [GUFA] MUY IN TOPIC
A alguno (aparte de mí) le pasó que de cuando en vez el zorro se emputece y
te empieza a pedir que le saques el read only (yo trabajo con VSS) a una
banda de forms y clases porque si no, no te compila???
Me hace acordar al cuento del camello en el desierto... porque "si no le
sacás en ReadOnly no sigo..."
Alguno tiene alguna solución alternativa a sacar 1 x 1 los ro de los
archivos que te canta?
Me pasa cada tanto y por ahí me paso media hora desmarcando archivos hasta
que logro una compilación.
Salute!!
_____
<https://www.avast.com/antivirus>
This email has been checked for viruses by Avast antivirus software.
www.avast.com <https://www.avast.com/antivirus>
---
El software de antivirus Avast ha analizado este correo electrónico en busca de
virus.
https://www.avast.com/antivirus