Delphi
|
|
Message Closed
modified 22-Jun-13 1:46am.
|
|
|
|
|
If you type your question into Google you will find everything you need.
Use the best guess
|
|
|
|
|
Delphi is the programming language almost nobody talks about but lots of people use and love. It also wins prizes in the Codeproject website, which really surprised me:
http://delphi-insider.blogspot.pt/2011/05/delphi-wins-code-project-members-choice.html
|
|
|
|
|
hello guys... I have a type TClassFoo in which I have a const like this
unit ClassFoo;
interface
uses ClassBase;
type TClassFoo = class
public const NUMBER = 100;
end;
I have two types TClassBase and TClassChild . TClassFoo and TClassBase have references of each other.
I want to access the constant from TClassFoo in TClassChild like this..
unit ClassBase;
interface
type TClassBase = class
end;
implmentation
uses ClassFoo
var objFoo : TClassFoo;
unit ClassChild;
interface
type TClassChild = class(TClassBase)
end;
So how can I do that ? Thanks for any input.
This world is going to explode due to international politics, SOON.
modified 16-Jul-13 4:02am.
|
|
|
|
|
You could add a static read-only property that returns the constant.
This statement is false.
|
|
|
|
|
What compiler do you use?
TClassFoo.NUMBER should work.
|
|
|
|
|
smags13 wrote: TClassFoo.NUMBER
This is exactly what I tried but it did not work. I am using Embercadero Delphi XE2 version. I am new to delphi.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
class const is available since Delphi 7 (or Delphi 2009?) (http://edn.embarcadero.com/article/34324[^]), so your compiler is good.
What type of error/complain did you get? Did it happen at compilation time or run time? I think what did not work may not relate to class const.
You could try a simplified codes where only one class is defined with a class const, and then access it from a different unit, and see if it works, which I think it should.
modified 20-Jun-13 13:59pm.
|
|
|
|
|
hello guys.. I am new to Delphi. Some of you might have worked in C++. Is there anyway we could use these methods for associating 32-bit values, in Delphi. I also watched functions of TCustomCombo but could not find these methods. Thanks for any pointers.
This world is going to explode due to international politics, SOON.
modified 16-Jul-13 4:02am.
|
|
|
|
|
Basically, you need to set/get Object into/from Items property of TComboBox instance.
An example could be found at TComboBox.Items Property[^]
To set:
ComboBox1.Items.AddObject('vsIcon', TObject(vsIcon));
ComboBox1.Items.AddObject('vsList', TObject(vsList));
ComboBox1.Items.AddObject('vsReport', TObject(vsReport));
ComboBox1.Items.AddObject('vsSmallIcon', TObject(vsSmallIcon));
ComboBox1.ItemIndex := 0;
To get:
ListView1.ViewStyle := TViewStyle(Items.Objects[ItemIndex]);
TComboBox uses an instance of TCustomComboBoxStrings to maintain captions and their associated data, which has a function called PutObject.function PutObject(Index: Integer; AObject: TObject); override; This is the function that sends CB_SETITEMDATA message internally and where you could be able to set 32-bit value along with a given item index.
On the other hand, GetObject function GetObject(Index: Integer): TObject; will retrieve the 32-bit value for you.
Notice, in the world of Delphi, all these 32-bit values here are actually a TObject value.
|
|
|
|
|
I want to use the functions in my c# .net project without writing the logic again in Delphi5 project.
So I exposed this .NET assembly (DLL) as COM object using the regasm.exe tool and then I imported the tlb type library from Delphi5,but the component only have the class BUT without any method. the useless class.
What am I missing?
Any help will be highly appreciated.
|
|
|
|
|
RashmitaS wrote: the useless class. Well, you wrote it so only you can answer the question.
Use the best guess
|
|
|
|
|
If you write it in C# you know which is public and what not...
|
|
|
|
|
Why are you telling me this?
Use the best guess
|
|
|
|
|
how can i connect/disconnect my wifi with delphi programming?
how can i connect/disconnect other wirless networks with delphi programming?
help me, please
modified 8-Apr-13 6:44am.
|
|
|
|
|
If you are implementing it on Windows:
take a look at WlanConnect[^] and WlanDisconnect[^]. Go through this page http://msdn.microsoft.com/en-us/library/windows/desktop/aa816369(v=vs.85).aspx[^] for brief usage of Native Wifi API. I don't think Delphi provides units for these APIs, so you have to download it somewhere else.
you can also call netsh command line to perform the connection. It's less flexible but easier to use this command line method than Native Wifi API, but you can decide which one is better based on your project.
|
|
|
|
|
|
Ha, I knew there is some Delphi header for these APIs somewhere and we are not alone.
Thanks Theooo
|
|
|
|
|
Good Link, I need it
/* LIFE RUNS ON CODE */
|
|
|
|
|
|
Yeah
/* LIFE RUNS ON CODE */
|
|
|
|
|
|
/* LIFE RUNS ON CODE */
|
|
|
|
|
What happened to past Delphi forum messages? Apparently deleted.
So, let's start again, don't leave this forum empty forever.
|
|
|
|
|
There's a small bar with options above the forum, where you can change spacing, the amount of noise, the layout.. and the period from which you want to see the messages. I believe it defaults to 3 months. Change it to "all", and you'll see that this forum isn't empty.
|
|
|
|
|
|
General
News
Suggestion
Question
Bug
Answer
Joke
Praise
Rant
Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.