Category Archives: Delphi

Code Snippets Delphi

Gerenating a GUID using Delphi 7

GUID – Globally Unique IDentifier

In Delphi, GUID values are represented with the TGuid record defined in the System unit. A Guid value is a 128-bit integer (16 bytes) that can be used in database applications when a unique identifier is required.
When developing database applications, the TGuidField is used to represents a guid field in a dataset.


procedure TForm1.btnGetGUIDClick(Sender: TObject);
var
  Guid: TGUID;
begin
  CreateGUID(Guid);
  form1.label1.Caption := GUIDToString(Guid);
end;

read more »

Code Snippets Delphi web services

Consuming ASP.NET 2.0 Web Services in Delphi for Win32

A couple of years ago I wrote an article Consuming C# Web Services with Delphi 7 Professional, and while the information in the article is still correct, it’s no longer complete, because ASP.NET 2.0 changed the rules a little bit.
Even if you follow the examples exactly on creating the web service in C# and in creating the consuming application in Delphi for Win32, no matter what you try to echo, the result will always come back as 0 for numbers or as an empty string for strings.

This is due to the fact that the C# web service is deployed on an ASP.NET 2.0 machine (which changed some of the ways WSDL was published compared to .NET 1.1).

The problem is caused by the fact that any .NET Web Service is using the document|literal binding. With ASP.NET 1.x Web Services, this was specified using element, but with ASP.NET 2.0 Microsoft has changed that and now specifies the style in the operation input and output nodes instead of the binding element. The Delphi Win32 WSDL Importer is not able to recognise this, and as a result the generated import unit is using the (for Delphi default) binding type of RPC instead of the .NET document|literal binding type.
CodeGear is aware of the situation, and is already working on fixing the problem in the Win32 WSDL Importer. In the meantime, there is a workaround available that you can use, namely manually specifying the ioDocument as InvokeOptions for the SOAP interface type, as follows:

  InvRegistry.RegisterInvokeOptions(TypeInfo(xxx), ioDocument);

Where xxx is the name of your SOAP interface type.

This line of code needs to be added to the initialization section of the generated Win32 import unit, and will make sure the parameters and result types are no longer empty when Win32 clients are talking to ASP.NET 2.0 Web Services.

 

source link:
Bob Swart 2/5/2007 10:04:56 AM (GMT+1)

Delphi

Delphi Default IDE Shortcut Keys

Delphi Default IDE Shortcut Keys read more »

Delphi

Word of the Day: BOGO

logo_embarcadero

The new word around here is BOGO – or Buy On, Get One. Free that is. Right now, if you buy any Embarcadero product, you can get a different Embarcadero product of equal or lesser value for free. That’s right – Free. As in no additional money. As in register your purchased product, get the code, go to our website, enter the code, choose a product, and get it for free. But you need to do it before August 24. That’s when the deal expires. There are some restrictions – not many – so now is the time to buy.

There are a lot of prices out there that you can pay, but of all the prices there are, I think we can all agree that Free is the best one. I know that it is my favorite price, and I pay that price as often as I can.

Links:

http://blogs.embarcadero.com/nickhodges/2009/07/01/39252

http://www.embarcadero.com/bogo-info/

Delphi

Delphi String Format

System.string.Format(‘{0:dd.MM.yyyy}’, txt0200.Text)

Delphi

Estão ai os Turbos!

TurbosAs versões Turbo Explorer do Delphi, Delphi .NET, C# e C++ já estão disponíveis para download gratuito.

Estas versões são 100% gratuitas, não são demos. Têm algumas limitações, a principal é a impossibilidade de instalar componentes adicionais na IDE.