Delphi TForm OldCreateOrder Property

Posted by NUL PROG. : 2013. 4. 18. 19:28
폼의 생성과 파괴 시점이 중요할때가 있는데,

이 프로퍼티에 따라서 함수 호출의 순서가 달라지니 주의해야 한다.



기본값은 False 로

Create완료후에 AfterConstruction에서 OnCreate 가 호출 되고 Destroy 시작 전에 BeforeDestruction 에서 OnDestroy가 호출 된다.

True로 세팅 되면 Contructor 내부에서 마지막에 OnCreate 가 호출 되고 Destroy 내부에서 처음에 OnDestroy 가 호출된다.



생성/파괴 시점에 사용자 이벤트를 호출하다가 예외가 발생한다면 수습이 안되므로 False가 이치에 맞으니, 특별한 이유가 없는 한 가급적 기본값 그대로 써야 한다.

Create / Destroy 는 객체 멤버의 초기화와 메모리 해제에 중점을 두고, 그외의 동작들은 AfterConstruction / BeforeDestruction 에서 처리해야 한다. TCustomForm이라면 DoCreate / DoDestroy 를 쓸수도 있다.
  
내부적으로  Val(String, Var, Err) 함수를 쓰는 것들인데,

16진수를 인식하기도 합니다.

'$1234'   =>4660 당연하겠죠...
'0x1234' =>4660 C언어 스타일도 16진수로 인식합니다.
'x1234'   =>4660 이것 마저도 16진수로 인식하다니... 이건 좀 ....



그러고 보니 델파이 쓴지 10년이 넘었는데, 처음 익힐때 빼고는 도움말이나 레퍼런스를 읽어 본 기억이 없네요.

이번에 찾아보려니 실행도 안되네요. 어딘가 파일이 손상 된 듯....;

embacadero 홈페이지의 도움말에는 이런 언급이 전혀 없군요.

아마 봐봐야 별 도움 안되니 걍 소스 뒤져보는데에 익숙해진 듯합니다.




C++ 문서들은 그 방대함과 세세함이 참 부럽습니다.

물론 안봐도 대충 쓸수 있는 파스칼이 편하기는 한데... 이런게 의도하지 않은 결과를 일으키면 참난감함.



  

DELPHI, RESOURCE에 데이터 넣기

Posted by NUL PROG. : 2013. 4. 11. 18:13
일단 리소스 에디터를 추천  http://melander.dk/reseditor/




이걸 쓰면 RC 파일 작성하고 컴파일하는 수고를 할 필요가 없어짐

단지,

1. Add Resource - Add From File 로 데이터를 넣고 *.res 파일로 저장 
2. 프로젝트에 {$R 로 파일 추가
3. TResourceStream 로 읽어서 사용 

으로 끝납니다.





  

Delphi URW2824 Internal Error

Posted by NUL PROG. : 2013. 4. 9. 20:39
델파이란 놈이 다 좋은데,

가끔 이런 컴파일러 오류를 내뱉을 때가 있다.

구글 검색을 하면 이유도 참 다양하지만, 그 이유 마저도 확실치는 않다.

컴파일러 문제라는 것만 확실하다.



이번 케이스는 class helper 를 쓰다가 발생했다.

class helper 유닛을 uses 할때 interface 말고 implementation 아래에 써야 한다.

그간은 늘 implementation  아래에 써와서 몰랐었는데 (가능하면 항상 여기다 쓰는게 철칙임)

interface 아래에 쓰면 이 에러가 나더라...

(원래 그리 해야 하는 거면 메세지를 띄우든가...)



이런 메세지도 없는오류는 통상적으론 고치가가 어려운데

다행히도 델파이는 컴파일 시간이 엄청나게 빨라서 틈만 나면 빌드를 남발하는게 습관인지라,

기존 컴파일 잘되던 코드와 바뀐점을 쉽게 추론할 수 있었다.



참고로, 델파이의 빌드 속도는 살짝만 과장하면 인터프리터 언어를 실행하는 수준과 비슷하다.

10년이 넘은 구닥다리 PC로도 쾌적하게 컴파일 된다.

(쓰던 PC는 이번에 C++을 컴파일하면서 못버티고 결국 버렸다.)
  

델파이에서 TortoiseSVN SubWCRev 활용

Posted by NUL PROG. : 2012. 5. 4. 22:04
검색해서 찾아오신 분들은 다 같은 생각일 겁니다.

SVN의 리비전 정보로 리소스의 파일 버전으로 활용하면 편하지 않을까.... 그런 생각이죠


실행파일만 주는줄 알고 있었는데.... TortoiseSVN에서 COM 도 지원해주네요.... 여태 몰랐네....

http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-subwcrev-com-interface.html 



델파이에서 Active X 설치 해도 되고...

전 걍 아래처럼 헤더 파일만 카피해서 씁니다.. 어차피 필요한 건 몇줄 안되거든요

2012/05/04 - [PROG.] - IOTAProjectOptions 의 Value 항목들
http://delphiaddinfortortoisesvn.tigris.org 

이런걸 조합하면 커밋할때 마다 리비전 정보를 res 파일의 버전 정보에 삽입하는 것이 가능합니다. 



2013-07-30 Tortoise SVN 1.8.1 업데이트 후 변경된 unit을 추가합니다.
그냥 Import Type Library 하면 되는데 참고삼아 올립니다. (syntax highlighter 테스트 겸...)


unit LibSubWCRev;

interface

uses Windows, ActiveX, Classes, Graphics, OleServer, StdVCL, Variants;
  
type
  ISubWCRev = interface(IDispatch)
    ['{2F5EA5B0-4DE7-4F96-8E6B-FC0C37D9C0D6}']
    procedure GetWCInfo(const wcPath: WideString; folders: WordBool; externals: WordBool); safecall;
    procedure GetWCInfo2(const wcPath: WideString; folders: WordBool; externals: WordBool; externalsNoMixed: WordBool); safecall;
    function Get_Revision: OleVariant; safecall;
    function Get_MinRev: OleVariant; safecall;
    function Get_MaxRev: OleVariant; safecall;
    function Get_Date: OleVariant; safecall;
    function Get_Url: OleVariant; safecall;
    function Get_Author: OleVariant; safecall;
    function Get_HasModifications: WordBool; safecall;
    function Get_HasUnversioned: WordBool; safecall;
    function Get_HasMixedRevisions: WordBool; safecall;
    function Get_HaveExternalsAllFixedRevision: WordBool; safecall;
    function Get_IsWcTagged: WordBool; safecall;
    function Get_IsSvnItem: WordBool; safecall;
    function Get_NeedsLocking: WordBool; safecall;
    function Get_IsLocked: WordBool; safecall;
    function Get_LockCreationDate: OleVariant; safecall;
    function Get_LockOwner: OleVariant; safecall;
    function Get_LockComment: OleVariant; safecall;
    property Revision: OleVariant read Get_Revision;
    property MinRev: OleVariant read Get_MinRev;
    property MaxRev: OleVariant read Get_MaxRev;
    property Date: OleVariant read Get_Date;
    property Url: OleVariant read Get_Url;
    property Author: OleVariant read Get_Author;
    property HasModifications: WordBool read Get_HasModifications;
    property HasUnversioned: WordBool read Get_HasUnversioned;
    property HasMixedRevisions: WordBool read Get_HasMixedRevisions;
    property HaveExternalsAllFixedRevision: WordBool read Get_HaveExternalsAllFixedRevision;
    property IsWcTagged: WordBool read Get_IsWcTagged;
    property IsSvnItem: WordBool read Get_IsSvnItem;
    property NeedsLocking: WordBool read Get_NeedsLocking;
    property IsLocked: WordBool read Get_IsLocked;
    property LockCreationDate: OleVariant read Get_LockCreationDate;
    property LockOwner: OleVariant read Get_LockOwner;
    property LockComment: OleVariant read Get_LockComment;
  end;

  CoSubWCRev = class
    class function Create: ISubWCRev;
    class function CreateRemote(const MachineName: string): ISubWCRev;
  end;

  const
    CLASS_SubWCRev: TGUID = '{F26E2640-0CFF-43DC-8325-575A3261D885}';
    
implementation

uses
  ComObj;

class function CoSubWCRev.Create: ISubWCRev;
begin
  Result := CreateComObject(CLASS_SubWCRev) as ISubWCRev;
end;

class function CoSubWCRev.CreateRemote(const MachineName: string): ISubWCRev;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_SubWCRev) as ISubWCRev;
end;

end.
  

IOTAProjectOptions 의 Value 항목들

Posted by NUL PROG. : 2012. 5. 4. 19:13
SVN과 버전 정보의 연동을 위해서 써먹을수 있지 않을까 싶어 뽑아 봤습니다.

RC파일 만드는것보다는 낫겠다 싶어서요

델파이 2007 기준이고 TYPE=NAME 으로 표기했습니다.

tkLString=HostApplication
tkLString=RunParams
tkClass=EnvVars
tkClass=SysVars
tkClass=SymTabs
tkLString=Launcher
tkEnumeration=UseLauncher
tkLString=DebugCWD
tkLString=RemoteHost
tkLString=RemotePath
tkLString=RemoteParams
tkLString=RemoteLauncher
tkEnumeration=UseRemoteLauncher
tkLString=RemoteCWD
tkEnumeration=RemoteDebug
tkEnumeration=LoadAllSymbols
tkEnumeration=LoadUnspecifiedSymbols
tkLString=SymbolSearchPath
tkInteger=Align
tkInteger=BoolEval
tkInteger=Assertions
tkInteger=UnitDebugInfo
tkInteger=ImportedData
tkInteger=LongStrings
tkInteger=IOChecks
tkInteger=WriteableConst
tkInteger=LocalSymbols
tkInteger=TypeInfo
tkInteger=Optimization
tkInteger=OpenStrings
tkInteger=OverflowChecks
tkInteger=RangeChecks
tkInteger=StackChecks
tkInteger=TypedAddress
tkInteger=SafeDivide
tkInteger=VarStringChecks
tkInteger=StackFrames
tkInteger=ExtendedSyntax
tkInteger=ReferenceInfo
tkInteger=MinEnumSize
tkEnumeration=DebugInfo
tkEnumeration=RemoteSymbols
tkSet=OutputObj
tkEnumeration=GenHpp
tkEnumeration=HintFlag
tkEnumeration=WarnFlag
tkInteger=StackSize
tkInteger=MaxStackSize
tkInteger=ResourceReserve
tkInteger=ImageBase
tkEnumeration=Target
tkEnumeration=MapFile
tkEnumeration=GenDRC
tkEnumeration=GenDOC
tkLString=CompileName
tkLString=Defines
tkLString=SysDefines
tkLString=OutputDir
tkLString=UnitOutputDir
tkLString=UnitDir
tkLString=ObjDir
tkLString=SrcDir
tkLString=ResDir
tkLString=NamespacePrefix
tkLString=PkgDllDir
tkLString=OptionsString
tkLString=SOName
tkLString=SOPrefix
tkEnumeration=SOPrefixDefined
tkLString=SOSuffix
tkLString=SOVersion
tkLString=DynamicLoader
tkLString=PasCodepage
tkEnumeration=PasPlatform
tkEnumeration=SignAssembly
tkEnumeration=DelaySign
tkLString=KeyFile
tkLString=KeyContainer
tkInteger=WarnSymbolDeprecated
tkInteger=WarnSymbolLibrary
tkInteger=WarnSymbolPlatform
tkInteger=WarnSymbolExperimental
tkInteger=WarnUnitLibrary
tkInteger=WarnUnitPlatform
tkInteger=WarnUnitDeprecated
tkInteger=WarnUnitExperimental
tkInteger=WarnHresultCompat
tkInteger=WarnHidingMember
tkInteger=WarnHiddenVirtual
tkInteger=WarnGarbage
tkInteger=WarnBoundsError
tkInteger=WarnZeroNilCompat
tkInteger=WarnStringConstTrunced
tkInteger=WarnForLoopVarVarpar
tkInteger=WarnTypedConstVarpar
tkInteger=WarnAsgToTypedConst
tkInteger=WarnCaseLabelRange
tkInteger=WarnForVariable
tkInteger=WarnConstructingAbstract
tkInteger=WarnComparisonFalse
tkInteger=WarnComparisonTrue
tkInteger=WarnComparingSignedUnsigned
tkInteger=WarnCombiningSignedUnsigned
tkInteger=WarnUnsupportedConstruct
tkInteger=WarnFileOpen
tkInteger=WarnFileOpenUnitsrc
tkInteger=WarnBadGlobalSymbol
tkInteger=WarnDuplicateCtorDtor
tkInteger=WarnInvalidDirective
tkInteger=WarnPackageNoLink
tkInteger=WarnPackagedThreadvar
tkInteger=WarnImplicitImport
tkInteger=WarnHppemitIgnored
tkInteger=WarnNoRetval
tkInteger=WarnUseBeforeDef
tkInteger=WarnForLoopVarUndef
tkInteger=WarnUnitNameMismatch
tkInteger=WarnNoCfgFileFound
tkInteger=WarnMessageDirective
tkInteger=WarnImplicitVariants
tkInteger=WarnUnicodeToLocale
tkInteger=WarnLocaleToUnicode
tkInteger=WarnImagebaseMultiple
tkInteger=WarnSuspiciousTypecast
tkInteger=WarnPrivatePropaccessor
tkInteger=WarnUnsafeType
tkInteger=WarnUnsafeCode
tkInteger=WarnUnsafeCast
tkInteger=WarnOptionTruncated
tkInteger=WarnWideCharReduced
tkInteger=WarnDuplicatesIgnored
tkInteger=WarnInitSeq
tkInteger=WarnLocalPInvoke
tkInteger=WarnXMLWhitespaceNotAllowed
tkInteger=WarnXMLUnknownEntity
tkInteger=WarnXMLInvalidNameStart
tkInteger=WarnXMLInvalidName
tkInteger=WarnXMLExpectedCharacter
tkInteger=WarnXMLCREFNoResolve
tkInteger=WarnXMLNoParm
tkInteger=WarnXMLNoMatchingParm
tkLString=PkgDcpDir
tkEnumeration=UsePackages
tkLString=Packages
tkLString=UnitAliases
tkLString=ExeDescription
tkEnumeration=ImplicitBuild
tkEnumeration=RuntimeOnly
tkEnumeration=DesigntimeOnly
tkLString=DebugSourcePath
tkEnumeration=ImageDebugInfo
tkInteger=HeapSize
tkInteger=MaxHeapSize
tkInteger=LinkMaxErrors
tkEnumeration=LinkShowMangle
tkEnumeration=LinkGenImportLib
tkEnumeration=LinkGenLib
tkEnumeration=LinkNoStateFiles
tkInteger=LinkSubsysMajor
tkInteger=LinkSubsysMinor
tkEnumeration=LinkCaseSensitiveLink
tkEnumeration=LinkCalculateChecksum
tkEnumeration=LinkFastTLS
tkEnumeration=LinkReplaceResources
tkInteger=LinkUserMajor
tkInteger=LinkUserMinor
tkLString=LinkImageComment
tkLString=LinkDelayLoad
tkEnumeration=CppDebugInfo
tkEnumeration=LineNumbers
tkEnumeration=AutoRegVars
tkEnumeration=MergeDupStrs
tkEnumeration=EnableInLines
tkEnumeration=ShowWarnings
tkEnumeration=StdStackFrame
tkEnumeration=TreatEnumsAsInts
tkEnumeration=PCH
tkEnumeration=ShowInfoMsgs
tkEnumeration=ShowExtendedMsgs
tkEnumeration=GenDll
tkEnumeration=GenConsoleApp
tkEnumeration=GenPackage
tkEnumeration=GenStaticLibrary
tkEnumeration=ShowLinkerWarnings
tkEnumeration=LinkDebugVcl
tkEnumeration=InstructionSet
tkEnumeration=Alignment
tkEnumeration=CallingConvention
tkEnumeration=RegisterVars
tkEnumeration=Ansi
tkEnumeration=AutoDep
tkEnumeration=Underscore
tkEnumeration=PICCodeGen
tkEnumeration=FastFloat
tkEnumeration=PentiumFloat
tkEnumeration=NestedComments
tkEnumeration=MFCCompat
tkInteger=IdentLen
tkEnumeration=MemberPrecision
tkEnumeration=ForLoops
tkEnumeration=TwoChar
tkEnumeration=CodeModifiers
tkEnumeration=EnableRTTI
tkEnumeration=EnableExceptions
tkEnumeration=EHLocalInfo
tkEnumeration=EHDtor
tkEnumeration=EHPrologs
tkEnumeration=ZeroBaseClass
tkEnumeration=ZeroClassFunction
tkEnumeration=ForceCppCompile
tkEnumeration=MemberPointer
tkEnumeration=VTables
tkEnumeration=Templates
tkLString=PchPath
tkLString=PchStopAfter
tkEnumeration=UseDynamicRtl
tkEnumeration=MultiThreaded
tkEnumeration=ATLMultiUse
tkEnumeration=ATLDebugQI
tkEnumeration=ATLCoinitMultiThreaded
tkEnumeration=ATLAutoRegisterInproc
tkEnumeration=ATLDebugRefCount
tkEnumeration=ATLDebug
tkEnumeration=ATLThreading
tkEnumeration=CodeOpt
tkEnumeration=FloatSupport
tkLString=IncludePath
tkLString=LibPath
tkLString=DebugPath
tkLString=ReleasePath
tkLString=LibraryList
tkLString=TasmViaCppOpts
tkEnumeration=ClearPackageCache
tkEnumeration=ClearUnitCache
tkEnumeration=MarkModified
tkEnumeration=CaseSensitive
tkEnumeration=ExtendedDictionary
tkEnumeration=PurgeComment
tkInteger=PageSize
tkLString=ListFile
tkEnumeration=TasmCrossReference
tkEnumeration=TasmSymbolTables
tkEnumeration=TasmGenerateListing
tkEnumeration=TasmIncludeConditionals
tkEnumeration=TasmIncludeErrors
tkEnumeration=TasmExpanded
tkEnumeration=TasmCaseCheckingOn
tkEnumeration=TasmAllCase
tkEnumeration=TasmDebugOn
tkEnumeration=TasmFullDebug
tkEnumeration=TasmWarningsOn
tkEnumeration=TasmWarningsLevel1
tkInteger=TasmHashTable
tkInteger=TasmPasses
tkInteger=TasmSymbolLength
tkLString=TasmDirective
tkEnumeration=NoAskLibs
tkEnumeration=CGGlobalStackAccesses
tkEnumeration=CGThisPointer
tkEnumeration=CGInlinePointer
tkEnumeration=CGLinkCGLib
tkLString=DefaultNamespace
tkEnumeration=AutoRegisterTLB
tkEnumeration=AutoGenImportAssembly
tkEnumeration=AutoIncBuildNum
tkInteger=Build
tkInteger=CodePage
tkEnumeration=IncludeVersionInfo
tkClass=Keys
tkInteger=Locale
tkInteger=MajorVersion
tkInteger=MinorVersion
tkSet=ModuleAttribs
tkInteger=Release


 
  
 «이전 1  다음»