RE: [DUG]: Referencing variable TextFile names
TStrings is fine if you want to read and write a whole file at once. If you just want to write one line to the end of the file then it's not required. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Steve Peacocke Sent: Thursday, 8 March 2001 17:27 To: Multiple recipients of list delphi Subject: Re: [DUG]: Referencing variable TextFile names Mark, In recent years I have forsaken the old and trusty TextFile variable to using TStrings. With TStrings, not only can I write to and read from text files in a single call, but the contents are then already placed into a ready made object for me to manipulate. eg: Var Stuff: TStrings; i: integer; begin Stuff := TStringList.Create; try Stuff.LoadFromFile(FileName); for i := 0 to stuff.Count - 1 do ShowMessage(Stuff[i]); // do things with the line finally stuff.free; end; end; Must easier and able to do lots of excellent things with it - for example, by using the Values and Names properties, I can read and manipulate ini files much easier than the inbuilt TIniFile object. Steve -- - New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
[DUG]: Paths and UNCs
Working with interbase, because we had lots of non database shared files, we use a shared drive instead of the machine name for interbase connect eg m:\vl2\data where m is say D drive of machine GATE. This allows to use one setting to access interbase and all other files. And this works fine with NT workstations. 95/98 workstations though fail the error they give make sit obvious that they have failed to conver the m:\vl2\data into a valid complete UNC path. Has anyone else had this problem ? Are there any fixes or solutions ? --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
[DUG]: User defined datatypes in COM object
Hi Can any one tell me how to pass a user defined datatype from a function in a COM object? Source code will be a lot helpful. Thanks in advance. Regds Ebi --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
Re: [DUG]: Paths and UNCs
Hello Rohit I also hit this issue early after switching from Paradox to Interbase. Client workstations require connection strings dependent on the connection method and neither connection method can use drive letters to connect to the IB database. Perhaps someone has an elegant solution for this hurdle which appears when installing applications on clients. What I did was to write an installation assistant program which is 1. run in the IB database directory on the IB server, where it creates a file containing connection details for clients for each connection method (and other details for my use) 2. run from a client at installation time, when it retrieves the connection information and places it in the clients registry for use by my application. This description is brief. I am happy to give you the installation assistant if you want it. Regards Russell - Original Message - From: Rohit Gupta [EMAIL PROTECTED] To: Multiple recipients of list delphi [EMAIL PROTECTED] Sent: Thursday, March 08, 2001 11:29 PM Subject: [DUG]: Paths and UNCs Working with interbase, because we had lots of non database shared files, we use a shared drive instead of the machine name for interbase connect eg m:\vl2\data where m is say D drive of machine GATE. This allows to use one setting to access interbase and all other files. And this works fine with NT workstations. 95/98 workstations though fail the error they give make sit obvious that they have failed to conver the m:\vl2\data into a valid complete UNC path. Has anyone else had this problem ? Are there any fixes or solutions ? -- - New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
Re: [DUG]: Referencing variable TextFile names
Wow! It just goes to show if you take a bit of time to set out the problem clearly, it's far easier for people to provide help. Thanks to everyone who gave workable solutions for my problem. Using pointers and passing parameters are two that appeal but I think the virtual chocolate fish must go to Steve this time for suggesting the use of TStrings. What could be simpler than SaveToFile? This is particularly good as I also want to be able to do stuff with the data after saving. Thanks very much to all who responded Mark
RE: [DUG]: User defined datatypes in COM object
J.Reginald Ebenezer asked (twice): Can any one tell me how to pass a user defined datatype from a function in a COM object? Source code will be a lot helpful. Thanks in advance. The thanks may be a little premature 8-) This area is one of daunting complexity and the best I can do is tell you to get a copy of "Inside OLE 2" or a similar reference work published by Microsft Press and read up about how this area. Or alternatively have a good read of the MSDN documentation and sample code. What you want to do is achieved via "marshalling" and the IMarshal interface, and added in with the additional complexity of proxy objects to allow communication across process boundaries, the RPC layer, and other stuff and this quickly becomes an area that many fear to tread near. All this is called "custom marshalling" and is one of those yawn inducing multi-chapter bit in the OLE2 documentation that I have never managed to study a seriously as it deserves. Also have a look at http://www.techvanguards.com/com/tutorials/tips.htm for a couple of introduction answers to common questions about marshalling. Good luck. Cheers, Max. --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
[DUG]: HTML Clients in Delphi 5
Quickie: HTML 4 clients with Delphi 5: Is it any good? Is it included in the Trial Version so that I can check it out? Thanks Mike --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
RE: [DUG]: Adding nodes to Treeview and dupicates
Stephen I have tried your suggestion and it gives me the same result. if (TreeViewCompts.Items.Count = 0) then begin {Add the root node} TreeViewCompts.Items.Clear; {remove any existing nodes} Node := TreeViewCompts.Items.Add( NIL ,Name); {Addthe root node} end; This is the tree structure I'm after: +Form1 +TLabel -Label1 -Label2 +TMemo -Memo1 -Memo2 +TPanel -Panel1 I'm currently getting: +Form1 +TLabel -Label1 -Label2 +TMemo -Memo1 +TMemo +TPanel -Panel1 Cheers Chris --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"
RE: [DUG]: User defined datatypes in COM object
If you want to pass a user defined record between COM objects, you can use the pair of functions shown below to convert the record to/from OleVariant. OleVariant can be passed between COM objects. function MyRecordToVar(Value: TMyRecord): OleVariant; var P: Pointer; V: Variant; begin V := VarArrayCreate([0, Sizeof(TMyRecord) - 1], varByte); P := VarArrayLock(V); try Move(Value, P^, Sizeof(TMyRecord)); finally VarArrayUnlock(V); end; Result := V; end; function VarToMyRecord(Value: OleVariant): TMyRecord; var P: Pointer; begin P := VarArrayLock(Value); try Move(P^, Result, Sizeof(TMyRecord)); finally VarArrayUnlock(Value); end; end; Regards, Tom Munro Glass Hi Can any one tell me how to pass a user defined datatype from a function in a COM object? Source code will be a lot helpful. Regds Ebi --- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi"