Thursday, July 21, 2011

Default Values via BindingSource's AddingNew Event

I new that BindingSource's AddingNew event can handle all default value assignment, but was so frustrated that I could not find any articles/tutorials which guided me on how to use it. Although MSDN had description, but it did not have samples on how to use it. However, with few long hour searches I came to a source which enlighted me on how to use this event.

A sample code looks like this:
 
private void branchBindingSource_AddingNew(object sender, AddingNewEventArgs e)
{

//// Get data table view 
DataView dataTableView = branchBindingSource.List as DataView;


//// Create row from view
DataRowView rowView = dataTableView.AddNew();


rowView["BranchID"] = -1;
rowView["BranchCode"] = "001";
rowView["BranchDescription"] = "002";

//// Set New row
e.NewObject = rowView;

branchBindingSource.MoveLast(); 

}



 
 


Thursday, October 28, 2010

Opening a Solution Causes VS 2005 to crash and restart

Earlier today, I had to include a code snippet to my project. Unrealizing the consequences it might result in, I went ahead compiling and got an error message saying “Object reference not set to an instance of an object” and finally my VS 2005 crashed. This error message keeps on greeting every time to I tried to reopen the project.

Being clueless of what has gone wrong, I googled tirelessly to find a solution to overcome this problem, but without a joy.

While this error message keeps on coming, I try to realize that my VS were actually running on debugging on all of my Windows forms. Since the Code snippet I included was to my base form’s shown event, so every time I reopen VS 2005 it opens this Windows Forms and sends this error message.
In the Error Signature I witnessed the following:

AppName: devenv.exe
AppVer: 8.0.50727.42
AppStamp:4333e699
ModeName: system.design.ni.dll
ModVer: 2.0.50727.3053
ModStamp:4889df30
fDebug:0
Offset: 006b8532

I came across an article on running devenv.exe in “Visual Studio 2005 Command Prompt” and was enlightened me that I could build, rebuild, clean…etc project and its files. So I went to Visual Studio’s Project folder and located the *.cs file which was giving the error and edited via Notepad. Then I deleted the code snippet that was the causing the problem and replaced by a simple “Hello World” message box. Finally I build the project by trying my luck via VS 2005 Command Prompt by running the following commands:


devenv [either *.csproj or *.sln file of your project] /clean


devenv [either *.csproj or *.sln file of your project] /build

devenv [either *.csproj or *.sln file of your project] /rebuild


and it worked! I was finally able to open the project via Visual Studio and it worked well… No errors!

Tuesday, April 06, 2010

Wrestlemania 26: I made it!

I could only imagine myself being in Phoenix and yelling at 72,000+ people saying that I’ve made it!
Though I could not make it realistically, I’m at least glad that I got the DVD of it which I repeatedly saw it many times so far and even gave a torrid time to my DVD player by hitting the rewind button more often.

Although bit disappointed that the Rated-R could not claim the World Heavyweight championship, but he did not disappoint any by delivering a special kind of a “Spear” to Chris Jerico. I heard some one say it’s the “Edge-de-cution”. However I’m more than assured that the glory is not far away for Edge. Wish you all the best!

The viper was never far away from the show; however he delivered the ideal, if not the best RKO to finish things off with Legacy. I reckon that it’s the best I have ever seen in my bare eyes.

John Cena Vs. Dave Batista was more intense…. And ultimately it’s the never give up attitude that changed the course of the match. I was just astonished to see the US Navy performing a special performance before Cena enters to the ring. My memory diverts to the Wrestlemania 25. . In fact the “Attitude-Adjustment” he delivered was still in my minds.

Coming to Shawn Micheals, I never thought the Odds favors him, yet it was almost the identical Wrestlemania 25 match. Never the less both gave an exceptional performance and Sportsmanship of Undertaker should be admired a lot.

The intensity was awesome and all I could say that Wrestlemania keeps getting better and better. Can’t hardly wait to see Wrestlemania 27… and If god could send me to Atlanta next April I’ll consider it as just a miracle that happened.

Tuesday, August 18, 2009

Master/Detail Updation: Reflecting Identity Value

Master-Detail is quite easy to explain, but its complexity lies when you’re implementing it particularly when the identity columns rely on database given values. Researching on this topic for several months, days and hours, finally things lightened up for me.

Instead having to rely on an auto increment value, I have to rely on a value set provided via trigger. Have to admit myself that the resource below was very helpful indeed to the quest of solving this problem:

http://www.eggheadcafe.com/forumarchives/NETFrameworkADONET/Nov2005/post24232248.asp
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataset/thread/4d10fe87-2de8-42a8-8ef9-b9d46c0fd28d

The environment I was working with was Windows XP Pro SP+3, Visual Studio 2005, C#.net, Oracle XE DB, Oracle 10g client, System.Data.OracleCleint and TableAdapters;

To illustrate how I went on, I extracted the following tables from my project:

Journal(journalid*, xsactdate, xsactdesc);
JournalAccount(Journalid*, accountid*, xsactvalue);
PKEY(journal_PKEY);

I had the following triggers written for the Journal & JournalAccount table respectively.

Trigger for Journal Table as:

DECLARE
   nJournal_PKey PKey.Journal_PKey%TYPE;
   nChkJournalID Journal.JournalID%TYPE;
BEGIN
   -- this is to prevent posted Journals from being
   -- updated

   IF ( INSERTING ) THEN
      nChkJournalID := :new.JournalID;
   ELSE
      nChkJournalID := :old.JournalID;
   END IF;

   IF ( INSERTING AND ( :new.JournalID IS NULL ) ) THEN

      SELECT Journal_PKey INTO nJournal_PKey FROM PKey FOR UPDATE NOWAIT;

      UPDATE PKey SET Journal_PKey = Journal_PKey + 1;

      :new.JournalID   := nJournal_PKey + 1;
   END IF;
END;

Trigger for JournalAccount Table:

DECLARE
   nJournal_PKey PKey.Journal_PKey%TYPE;
   nChkJournalID Journal.JournalID%TYPE;
BEGIN
   -- this is to prevent posted Journals from being
   -- updated

   IF ( INSERTING ) THEN
      nChkJournalID := :new.JournalID;
   ELSE
      nChkJournalID := :old.JournalID;
   END IF;

   IF ( INSERTING AND ( :new.JournalID IS NULL ) ) THEN

      SELECT Journal_PKey INTO nJournal_PKey FROM PKey FOR UPDATE NOWAIT;

      :new.JournalID   := nJournal_PKey;
   END IF;
END;

Having followed what David Sceppa and Jason Kresowaty alias BinaryCoder wrote in their postings, things were going ok for me, except for the fact that Identities aren’t reflected upon saving to the table. Since the TableAdapters created without the InsertCommand, I have to include it by myself.

There were certain things which I need to modify, particularly Insert Query. Look into my Insert Query and you may see the Oracle Keyword “RETURNING”. The keyword is basically enables us to use it as an output parameter. I have inserted the temporary identity and getting back the value assigned via the trigger as an output parameter.

The following describes the “RETURNING” clause of Oracle: http://www.myoracleguide.com/s/Returning.htm

Finally have to amend the
System.Data.DataRowVersion
to
System.Data.DataRowVersion.Proposed
and the identity field (JournalID in my case)
System.Data.ParameterDirection
to
System.Data.ParameterDirection.InputOutput


The following is the InsertCommand in the TableAdapter for the Journal Table:

this._adapter.InsertCommand = new System.Data.OracleClient.OracleCommand(); this._adapter.InsertCommand.Connection = this.Connection;
this._adapter.InsertCommand.CommandText = "INSERT INTO JOURNALACCOUNT(JOURNALID, ACCOUNTID, XSACTVALUE, DISCOUNTEDPAYMENT) VALUES (:JOURNALID, :ACCOUNTID, :XSACTVALUE,'N') RETURNING JOURNALID INTO :JOURNALID";
this._adapter.InsertCommand.CommandType = System.Data.CommandType.Text;
this._adapter.InsertCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("JOURNALID", System.Data.OracleClient.OracleType.Number, 22, System.Data.ParameterDirection.InputOutput, "JOURNALID", System.Data.DataRowVersion.Proposed, false, null));
this._adapter.InsertCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("ACCOUNTID", System.Data.OracleClient.OracleType.Char, 15, System.Data.ParameterDirection.Input, "ACCOUNTID", System.Data.DataRowVersion.Current, false, null));
this._adapter.InsertCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("XSACTVALUE", System.Data.OracleClient.OracleType.Number, 22, System.Data.ParameterDirection.Input, "XSACTVALUE", System.Data.DataRowVersion.Current, false, null));

The following is the insertcommand in the tableadapter for the JournalAccount table:

this._adapter.InsertCommand = new System.Data.OracleClient.OracleCommand();
this._adapter.InsertCommand.Connection = this.Connection;
this._adapter.InsertCommand.CommandText = "INSERT INTO JKSBSCHEMA.JOURNAL(JOURNALID, XSACTDATE, XSACTDESC) VALUES (:JOURNALID, :XSACTDATE, :XSACTDESC) RETURNING JOURNALID INTO :JOURNALID";
this._adapter.InsertCommand.CommandType = System.Data.CommandType.Text;
this._adapter.InsertCommand.UpdatedRowSource = System.Data.UpdateRowSource.Both;
this._adapter.InsertCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("JOURNALID", System.Data.OracleClient.OracleType.Number, 22, System.Data.ParameterDirection.InputOutput, "JOURNALID", System.Data.DataRowVersion.Proposed, false, null));
this._adapter.InsertCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("XSACTDATE", System.Data.OracleClient.OracleType.DateTime, 7, System.Data.ParameterDirection.Input, "XSACTDATE", System.Data.DataRowVersion.Current, false, null));
this._adapter.InsertCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("XSACTDESC", System.Data.OracleClient.OracleType.VarChar, 40, System.Data.ParameterDirection.Input, "XSACTDESC", System.Data.DataRowVersion.Current, false, null));

Refer My Post @ MSDN Forums: http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataset/thread/fbfdc09b-41bf-4290-9dea-6a9a85d5becf

Sunday, July 05, 2009

The Banker Quote

While browsing the internet, I came up with an interesting quote by Mark Twain which apparently was highlighted under an individuals signature. Check this out:

A banker is a fellow who lends you his umbrella when the sun is shining, but wants it back the minute it begins to rain.
Mark Twain (1835 - 1910)

Friday, April 10, 2009

ORA-06502: PL/SQL: numeric or value error

This error was a real nightmare for me where I'm being in middle of a migration process of our legacy system. Though there was real hits when you google this problem, but nothing was helpfull for me.

The context of the problem occurs when I did run it on a WinXP pro sp3+ workstation which had installed the latest ODP.NET. However its quite extraordinary to see it was not reproduced in a machine installed Oracle Express Edition 11g (without oracle client).

Later, I understood that this problems occurs if you have a VarChar2 parameter(s) when executing a Oracle Stored Procedure. So people advised to have the size and Parameter direction in the parameter. I incresed the size everytime of the parameter and had the parameter direction as "input", yet this error kept bugging me. (My stored procedures did not have any return/output parameters, so I'm not in a possition to comment its behavior).

Finally after googling for days and finding one post in the Oracle forum from one guy who said to use the direction as "InputOutput" did the work for me. Furthermore to the parameter direction, I also gave all of the VarChar2 parameter size as 2000.

Produced Environment: .NET framework 2.0, Win XP Pro sp3 and the latest ODP.NET

Monday, September 01, 2008

Motivation


When the road you're trudging seems uphil,
When the funds are low, and debts are higher,
And you want to smile but you have to sigh,
When care is pressing you down a bit,
Rest if you must, but dont quit!

--
Hifni Shahzard Nazeer M. AMBCS
Blog: http://hifni.blogspot.com | Web: http://hifni.shahzard.googlepages.com
"The higher we soar, the smaller we appear to those who cannot fly" - Friedrich Nietzsche

Wednesday, August 20, 2008

Solutions: Visual Studio.NET 2003 Debugging Errors

  • Run the aspnet_regiis.exe via the Visual Studio.NET 2003 Command Prompt ( - Start Menu > Microsoft Visual Studio.NET 2003 > Visual Studio.NET Tools > Visual Studio 2003 Command Prompt - ) to register asp.net into IIS. The aspnet_regiis.exe is availabe in C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322. This scenario should be applied when you re-install either IIS or Visual Studio.NET 2003

Further Reference:
http://msdn.microsoft.com/en-us/library/h35f56yz(VS.71).aspx
http://msdn.microsoft.com/en-us/library/dwesw3ee(VS.71).aspx

Thursday, May 24, 2007

Getting Percentage from SQL Queries

This is the way I got a Percentage Column in my Query. For this I used Microsoft Access's Northwind Database which is available along with Office Package.

Lets Assume that We need to show all Customer's Total Order Value from Northwind.mdb. For that I used the following Query:

SELECT
Customers.CompanyName,
Sum([UnitPrice]*[Quantity]) AS CustTotal,
FROM
(Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID) INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID
GROUP BY Customers.CompanyName, Orders.CustomerID
ORDER BY Sum([UnitPrice]*[Quantity]) DESC;


I figured that to get the percentage i need to use the following simple formula:

Percentage = [Client Total]/[Overall Total] * 100;


So to get the percentage I added the following SQL which is a translation of the above formula:

(
((Sum([UnitPrice]*[Quantity])/(SELECT SUM([UnitPrice]*[Quantity]) FROM [Order Details]))*100)
) AS Percentage


So the Overall SQL looks something as after add:

SELECT
Customers.CompanyName,
Sum([UnitPrice]*[Quantity]) AS CustTotal,
(
((Sum([UnitPrice]*[Quantity])/(SELECT SUM( [UnitPrice]*[Quantity]) FROM [Order Details]))*100)
) AS Percentage
FROM
(Customers INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID) INNER JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID
GROUP BY Customers.CompanyName, Orders.CustomerID
ORDER BY Sum([UnitPrice]*[Quantity]) DESC;


PLEASE! if you found this interesting, do drop me a comment!

Thursday, December 14, 2006

Final Days @ JB Securities

Me and My friends at JB






My Boarland Delphi 5 Enterprise Edition While loading


MSDE 2000 Issues

Installing MSDE 2000 is bit complicated thing, unlike in MS SQL Server 2000. There is no user interface and no installation wizard, but you have to use TSQL to all of tasks in the Command Prompt. (Its like going back to the DOS era)

You get MSDE in your Office CD free. I had Microsoft Office XP with me and this is the way I installed it.

Insert your Office CD in, and type the following in your Command Prompt:

C:\>D:\MSDE2000\Setup.Exe SAPWD="" SECURITYMODE=SQL DISABLENETWORKPROTOCOL S=0/L*v C:\MSDELOG.TXT

And to Attach a Database to MSDE, I used the following way:

Again nothing will help you instead of Command Prompt.

Here, first you have to login to MSDE, and this is the way its done (provide your SA password):

C:\>osql/U sa/P

Once logged in, type the following in the command prompt:

EXEC sp_attach_db @dbname='pubs' @filename1='C:\Program Files\Microsoft Sql Server\MSSQL\Data\pubs.mdf' @filename2=''C:\Program Files\Microsoft Sql Server\MSSQL\Data\pubs_log.ldf' GO

Its arent easy with out a proper GUI, yet I was able to surf the internet and get help.

Wednesday, November 01, 2006

Do you really know how to forward e-mails? 50% of us do; 50% DO NOT

A friend who is a computer expert received the following directly from a system administrator of a corporate system. It is an excellent message   that ABSOLUTELY applies to ALL of us who send e-mails. Please read the short letter below, even if you're sure you already follow proper procedures.
 
LETTER TO Everybody : Do you really know how to forward e-mails? 50% of us do; 50% DO NOT.
 
Do you wonder why you get viruses or junk mail?  Do you hate it? Every time you forward an e-mail there is information left over from the people who got the message before you, namely their e-mail addresses & names.  As the   messages get forwarded along, the list of addresses builds, and builds, and builds, and all it takes is for some poor sap to get a virus, and his or her computer can send that virus to every E-mail address that has come across his computer.  Or, someone can take all of those addresses and sell them or send junk mail to them in the hopes that you will go to the site and he will make five cents for each hit.  That's right, all of  that inconvenience over a nickel! How do you stop it?  Well, there are several easy steps:
 
 
(1)  When you forward an e-mail, DELETE all of the other addresses that appear in the body of the message (at the top). That's right, DELETE them. Highlight them and delete them, backspace them, cut them, whatever it is you know how to do.  It only takes a second.  You MUST click the "Forward" button first and then you will have full editing capabilities against the body and headers of the message.  If you don't click on "Forward" first, you won't be able to edit the message at all.
 
 
(2)  Whenever you send an e-mail to more than one person, do NOT use the To: or Cc: fields for adding e-mail addresses.  Always use the BCC:(blind carbon copy) field for listing the e-mail addresses.   This way the people you send to will only see their own e-mail address.  If you don't see your BCC: option click on where it says To: and your address list will appear. Highlight the address and choose BCC: and that's it, it's that easy. When you send to BCC: your message will automatically say "Undisclosed Recipients" in the "TO:" field of the people who receive it.  If that phrase does not appear, type your own email address in the "TO" field, but put  everyone else's in the BCC field.
 
 
(3)  Remove any "FW :" in the subject line.  You can re-name the subject if you wish or even fix spelling.
 
  (4)  ALWAYS hit your Forward button from the actual e-mail you are reading.
 
  Ever get those e-mails that you have to open 10 pages to read the one page with the information on it?  By Forwarding from the actual page you wish someone to view, you stop them from having to open many e-mails just to see what you sent.   (AMEN!)   If you can't forward from that page, "Copy" the info and then open a new email blank page and "Paste".
 
  (5)  Have you ever gotten an email that is a petition?  It states a position and asks you to add your name and address and to forward it to 10 or 15 people or your entire address book.  The email can be forwarded on and on and can collect thousands of names and email addresses.
 
 A FACT:
The completed petition is actually worth a couple of bucks to a professional spammer because of the wealth of valid names and email addresses contained therein.  If you want to support the petition, send it as your own personal letter to the intended recipient.  Your position may carry more weight as a personal letter than a laundry list of names and email address on a petition.  (Actually, if you think about it, who is supposed to send the petition in to whatever ca use it supports?  And don't believe the ones that say that the email is being traced, it just ain't so!)
 
  (6)  One of the main ones I hate is the ones that say that something like, -Send this email to 10 people and you'll see something great run across your screen.-Or sometimes they just tease you by saying something really cute will happen. IT AINT GONNA HAPPEN!!!!!  (Trust me, I'm still seeing some of the same ones that I waited on 10 years ago!)  I don't let the bad luck ones scare me either, they get trashed.  (could be why I haven't won the lottery) Before you forward an Amber Alert, or a Virus Alert, or some of the other ones floating around nowadays, check them out before you forward them.  Most of them are junk mail that have been circling the net for YEARS! Just about everything you receive in an email that is in question can be checked out a Snopes.  Just go to
http://www.snopes.com/. It is really easy to find out if it is real or not.  If it is not, please don't pass it on. So please, in the future, let's stop the junk mail and   the viruses.
 
Finally, here's an idea!!!  Let's send this to everyone we know (but strip my address off first, please).  This is something that SHOULD be   forwarded.  Amen!  Now I have one pet peeve.  It is people who forward messages as attachments.  This happens because your set up in Outlook Express is incorrect.  Look in tools, options, tab send.  There is a box labeled to "include message in reply.  Make sure it is checked.  This will stop the message becoming an attachment.  Then do all the things recommended above. It only takes a little time.  This message is being forwarded to you, you do not see who forwarded it to me, nor do you see any attachments. You also do not see who it is going to.  This message is actually going to everyone in my email address book.  Emails with attachments are suspect as soon as they hit my computer.  If I do not know the name, the message is deleted good or bad.
 

Tuesday, October 17, 2006

Low Scoring Affairs, Boring Matches & Evil Pitches

Will this Champions Trophy turn out to one of the boring competition ever have been played? the Answer remains predictable so far. Except for couple of qualifying games which witnessed Sri Lanka passing the 250 run mark twice, since then everything has been a low scoring affair. West Indies who were unable to put up a good show, was bowled out for 86 and almost 20 overs were remaining, and England who were been haunted again by the ghosts of India was bowled out for 120 odd. If this pattern continues, this contest will end up as a boring event.
 
Thumbs down to the Indian curators who couldn't produce a good quality ODI batting pitch. Pitch was one of the major factors of these low scoring affairs.
 
In my view, ODIs should be batting oriented. Matches should see big scores with batsmen having some big hits over the ropes and then the opposition following up may match up with the score or by scoring some where closer by making game evenly poised. A characteristic of a good cricket game is where the viewer couldn't predict who will be ultimate winner of a particular match or a series. Teams should be well developed, formed and be adaptable and good quality pitches should be provided. The present arena doesn't fulfill those criteria. For example: from the match between Australia and England till the Finals of the contest, it is easily predictable who will win the match and contest. Outcome of a match should be suspense for the viewer, where everything is valued and counted at least for our tickets which we are paying for.
 
The characteristics was there in the game against New Zealand and South Africa, yet it still turn out be a low scoring affair. Kiwis won the match against all odds. Hope this kind of cricket matches continue in the tournament at least with some big scores.

Friday, September 29, 2006

Knowing whether you have QuickTime ActiveX installed or not

There are some Websites which has Quick-Time Oriented content, where you'll be the unfortunate one who could not view it. The problem is that your machine has not installed the Quicktime ActiveX which is required. So in order to know whether your computer has already installed or not or if your having problems viewing certain websites, pls. refer the following link which will indicate whether your machine has installed the necessary QuickTime Activex or not:
 
http://www.apple.com/quicktime/download/qtcheck/
 
 

Wednesday, July 05, 2006

Thoughts...

Why is it so hard to tell the truth ...yet so easy to tell a lie,
why do we sleep in the church..but when the sermon is over we suddenly wake up?
why is it so hard to talk about God...but so easy to talk about sex?
why are we so bored to look at a Christmas magazine..but so easy to read a vibe magazine ?
why is it so easy to delete a godly offline messages ...yet we forward the nasty ones?
why are the churches getting smaller..but yet the bars and clubs are growing ??
think about it..
Just remember God is watching you in his list.
..

Wednesday, June 28, 2006

Use Transaction in MIDAS

This is a article I found from Mr. Chen Jiangyong on Use of Transaction with MIDAS:
 
Transaction is very popular used in database programming. It's very easier used in Two-Tier application. How do it in Three-Tier? I have try to use cache-update in remote data modules and use transaction, I test it successfully in Delphi 4. But to do it cost many code and low performance. When Delphi 5 coming, I try to use the same method, but failed. Maybe this is the bug of Delphi 5. I think that many person have the same situation with me. How can use transaction in MIDAS? I try another method, just do it at BeforeUpdateRecord event. For example, when I edit table A, I want to insert a log to another table B. To do this, first:

1) create a remote data module , drop a query to select records from table A, drop a TUpdateSQL for the query, specify the SQL statement of Table A. Drop a TDatasetprovider hook to the query. Drop another query, then in its SQL property write the insert SQL statement to table B.

2) In the BeforeUpdateRecord event, I write this code:

  SetParams(UpdateSQL1, DeltaDS, UpdateKind);   

  UpdateSQL1. ExecSQL(UpdateKind);
  if UpdateKind = ukUpdate then begin
    { Insert a log to Table B}
    // set the params ­
    Query2.ExecSQL;
  end;
  Applied := True;

3) In the client, you should also make some change. When you try to save the changes, use ApplyUpdates(0) instead of ApplyUpdates(-1). For example:

  ClientDataSet1.ApplyUpdates(0)

  This is OK. Delphi does it well. If a error occur when you try to insert a log to Table B, the transaction will rollback, then you can find that Table A's record is not changed at all.
  I have tested it at Delphi 4, It also works very well.

Good Luck.

Monday, June 26, 2006

Creating GUIDs In Delphi

GUID values are unique and can be used to various tasks while programming. Therefore, it's appropriate that you know how to create one. Here Bill Todd of Team B shows to create it via Delphi:
 
 
FROM: Bill Todd \(TeamB\) 
DATE : Thurs, Nov 25 1999 12:00 am
 
You can generate a GUID in code by calling CoCreateGuid as shown below. You
must add the ActiveX unit to your uses clause.


<Code>

procedure
TForm1.Button2Click(Sender: TObject);
var
  G: TGuid;
begin
  CoCreateGuid(G);
end;


<\Code>

--
Bill

Bill Todd (TeamB)
(TeamB cannot respond to questions received via email)

Source:

Click here

Friday, June 23, 2006

Da Predator

ENTER THE PREDATOR:

This is one of the coolest pics I found in the internet:



What inspired me about the "Predator" is his armoury, gadgets and his body kit. Wish I had those! The movie "Predator-1" and "Predator-2" does highlight him as the bad guy who brutually kills all bad guys. However in the movie: "AVP" his role remains more similar to the earlier movies, but later companions a human to demolish the rising alien dominancy.

Wednesday, June 21, 2006

Delphi Ruined him

This is a gr8 quite funny and stressed post from Warren Postma I found while browsing:
 
Periodically I get a notion to explore the wide world of other
development tools out there.   Every time I try, I get frustrated, and I
give up.  Partly I think it's because my brain has locked into Delphi
mode so tightly that I can't think of anything else.  Partly it's
because Delphi has spoiled me rotten, and I'm absolutely floored by the
stuff that I have to deal with when I try to use any other tool.  Now
the reason I'm looking around for a new development tool to learn, is so
I can have a tool for writing cross-platform code, hopefully that will
work on Windows, Mac, and Linux.

Has anyone else been in this spot, and had a look around? What did you
do?  Did you plan to have an affair with another language, and then come
home happily to Delphi, knowing it would still have you back again?

- I tried Java again recently. I was really impressed by NetBeans and
the new "matisse" GUI builder.  I am not at all impressed by Eclipse,
although I like the SWT framework the gui-builders for Eclipse that are
any good are quite expensive, and I don't feel like paying $$$ just to
play around and learn the new tool.

- I tried a few Smalltalks, because as we all know, Smalltalk should
have been a really important and powerful programming languages, but for
some reason, it never achieved success. There's Dolphin, for which a
free version exists, and there's Squeak, which is entirely free. Both
are really interesting to play with, but I must admit my brain is so
wired for the procedural style of coding that I can't bear to write a
for-loop in Smalltalk, or send messages between integers. It just seems
weird and wrong to me.  And closures and stuff.  And I think that at
this point, learning Smalltalk is about as pointless as learning COBOL.

- I'd try a LISP, but I have no idea whether a LISP gui builder RAD tool
even exists. Perhaps LISP programmers can't be bothered to look up from
their latest EMACS macros-that-generate-macros-that-generate-LISP-code,
in order to consider the needs of the GUI-building population.

- I downloaded MS Visual C# express, but I don't like DotNet, and I'd
rather not learn another Windows-only tool. Delphi does fine for
Windows. I'd really like to learn something that gets me free from
Windows completely.  Maybe DotNet is the way to go, and I should learn
to love C#, and hope that MONO achieves maturity.

- I really like Python, but every single python gui framework seems too
full of accidental complexity, or too ugly, or both. Tcl/Tk is ugly. 
wxWindows is really hard to learn.  QT is licensed in a way that makes
using it on Windows cost a lot of money.  BOA constructor is a neat toy,
but I haven't been able to do anything useful with it yet.

- For confirmed delphi bigots, such as myself, perhaps Lazarus is the
right way to cross-platform myself, but as much progress as Lazarus has
made, it's still not ready for prime time; it lacks packages, and the
LCL/FCL components/code-libraries are rather klunky and limited in
features when compared with the VCL.

So what did YOU do last time you felt like trying another developer
tool? Can you find it in your heart to say anything good about any other
development tool? Or are you a crabby old Delphi guy like me, dyed in
the wool, and unlikely ever to repent?

Warren

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End of Post~~~~~~~~~~~~~~~~~~~~~~~~~~`
For further reading the entire post, go to:
http://delphi.newswhat.com/geoxml/forumgetthread?groupname=borland.public.delphi.non-technical&messageid=4484a839$1@newsgroups.borland.com&displaymode=all