Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

smags13

@smags13
About
Posts
45
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • What will be compressed when using Compress function in FastReport
    S smags13

    Not a FastReport user... Have you tried to contact their support or open a ticket with them regarding your questions? Can you type in the prototype of this Compression function? A quick search give me this[^], although it looks like not being related to your function.

    Delphi delphi question

  • create transparent form in vcl
    S smags13

    Looks like you've several posts on same question, correct?

    Delphi help

  • chang form
    S smags13

    Is this[^] what you want to do?

    Delphi help

  • .Net Com Class Callback to Delphi
    S smags13

    have you tried connection points[^]

    Delphi csharp delphi com help

  • Get CPU Usage Using PDH API
    S smags13

    Not sure your compiler is able to delay load dynamic library[^] which is another option. I haven't got chance to use this syntax though... I would use the following to dynamically load the function.

    type
    //definition is based on http://gr32ex.googlecode.com/svn/trunk/GR32Ex/Examples/DesktopSnow/GPSysHook/api/JwaPdh.pas
    PDH_HQUERY = THANDLE;
    PDH_STATUS = DWORD;
    FuncPdhOpenQuery = function(szDataSource: LPCTSTR; dwUserData: DWORD_PTR;
    var phQuery: PDH_HQUERY): PDH_STATUS; stdcall;

    //and your function implementation would be:
    procedure LoadPDHQuery;
    var
    PdhOpenQuery: FuncPdhOpenQuery;
    DllHandle: HModule;
    QueryHandle: PDH_HQUERY;
    Res: PDH_STATUS;
    begin
    try
    DllHandle:= LoadLibrary('pdh.dll');
    if DllHandle > 0 then
    begin
    @PdhOpenQuery:= GetProcAddress(DllHandle, 'PdhOpenQueryW');//notice it's either W or A as stated in MSDN (http://msdn.microsoft.com/en-us/library/windows/desktop/aa372652(v=vs.85).aspx)
    if (Assigned(PdhOpenQuery)) then
    begin
    Res:= PdhOpenQuery(nil, 0, QueryHandle);

        ShowMessage(IntToStr(Res));
      
      end;
    end;
    

    finally
    if (DllHandle > 0)
    FreeLibrary(DllHandle);
    end;
    end;

    Delphi json delphi windows-admin help question

  • Convert delphi 2007 project to latest delphi XE4?
    S smags13

    If XE4 gives you errors when opening your .dproj file, the answer would be no. And if XE4 is able to open that file, make sure you do a clean build. Do you have 3rd-party packages installed with Delphi 2007? It's sometimes tricky and annoying to keep packages up-to-date when upgrading your codebase. I assume you've already dealt with UnicodeString in your 2007 project, which is big bonus to the conversion.

    Delphi delphi question

  • [SOLVED] Not Updating TObjectDictionary Value Correctly
    S smags13

    Shouldn't the function signature of TryGetValue look like the following?

    function TryGetValue(const Key: TKey; out Value: TValue): Boolean;

    and the objStudent was corrupted actually after the call to TryGetValue

    if (m_objStudentList.TryGetValue(nId, ObjStudent))
    begin
    objStudent.StudentName:= sName;

    //don't need to call AddOrSetValue as Delphi returns object reference for you.
    end;

    Delphi help question announcement

  • [SOLVED] Assigning Properties and Events At Runtime
    S smags13

    Is RTTI the only way to do? Check if TMethod.Code contains empty info. and you're redirecting properties on TServer class, not a TServer object.

    if MethodProp.Code <> Nil then
    begin
    //Sometimes OutputDebugString is neat for debugging components/pkg
    OutputDebugString('Property Found.');
    SetMethodProp(TObject(TServer) , 'OnEvent', MethodProp);
    end
    else
    begin
    OutputDebugString('Property Not Found.');
    end;

    Delphi com

  • [SOLVED] Access a const from a class
    S smags13

    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.

    Delphi question help

  • [SOLVED] Access a const from a class
    S smags13

    What compiler do you use?

    TClassFoo.NUMBER

    should work.

    Delphi question help

  • [SOLVED] Set/Get ItemData() Equivalent in Delphi
    S smags13

    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:

    // Add View styles and constants to the Combo Box
    ComboBox1.Items.AddObject('vsIcon', TObject(vsIcon));
    ComboBox1.Items.AddObject('vsList', TObject(vsList));
    ComboBox1.Items.AddObject('vsReport', TObject(vsReport));
    ComboBox1.Items.AddObject('vsSmallIcon', TObject(vsSmallIcon));
    // Display first item in the Combo Box
    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.

    Delphi c++ delphi

  • how to wifi, wirless programming?
    S smags13

    Ha, I knew there is some Delphi header for these APIs somewhere and we are not alone. :-D Thanks Theooo

    Delphi question delphi help tutorial

  • how to wifi, wirless programming?
    S smags13

    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.

    Delphi question delphi help tutorial

  • Just wondering
    S smags13

    And also wondering if CodeProject is lately sponsored by Windows 8. :laugh:

    Delphi delphi question

  • Please I Need Help For My Delphi Project
    S smags13

    I suppose you want to drag a file from Explorer into a TForm window. Basically, you can respond WM_DROPFILES message to catch drag-and-drop events. Allow your Delphi Forms to Accept Dropped Files from Window Explorer[^] shows how to drag files into a window and print the file paths out in a TMemo component.

    Delphi delphi help

  • New To Delphi - Want a Right Direction
    S smags13

    Btw, has anyone here got this "Handbook"? I just want to hear some opinions about this one. Or anyone find it useful?

    Delphi csharp delphi tutorial learning

  • Generating Label Barcode from inside of our project
    S smags13

    What version of Delphi are you using? By the way, if you want to buy a component, use trial version and prepare a bunch of technique questions (like Help! the code is not working! or It doesn't work on my printer!) for them before purchase, it will let you know how good their programmers are. By "they don't work on all kind of printers", you mean they can't print the barcode out or the printout can't be scanned? And what type of barcode are you using?

    Delphi question

  • Generating Label Barcode from inside of our project
    S smags13

    Your might want to try this one[^], this one[^], or this one[^]. Some of them are free which means no warrant for your products, but they are good if you want to have some source codes first and grab some ideas before making decisions. [plus] Have you considered making your own barcode generator?

    Delphi question

  • New To Delphi - Want a Right Direction
    S smags13

    My suggestion would be the same, since Embercadero Delphi is the only reliable IDE for GUI programming in Delphi, from my point of view. You could ask for an academic license if you are qualified. CodeGear Academic Program[^] Let me know how it goes.

    Delphi csharp delphi tutorial learning

  • New To Delphi - Want a Right Direction
    S smags13

    Hi, Welcome to Delphi community. If you want to be familiar the language first, there are some other pascal compilers available. but I would suggest you use this Embercadero RAD Studio, so that you can play around with Delphi language, IDE, VCL, etc. And you can also access to its big source code depository. You will learn a lot from it. As for books. I don't have any for recommendation. (unless you want to do some COM programming in Delphi :)) Official web site has some tutorials to begin with. RAD Documentation is also a good place to visit for both references and tutorials. These two web sites are good for references too, Delphi Basics and Delphi About. Some contents are old, but 99% are good. Dr.Bob is also neat resource. Last, don't forget here if you have any problem.

    Delphi csharp delphi tutorial learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups