Solved

The use of GetWindowsDirectory..

Posted on 1998-01-07
3
175 Views
Last Modified: 2012-08-13
I tried to use it like this...

Procedure Button1.Click...
Var Test:PChar;
    BufferS:Integer;
Begin
   BufferS:=255;
   GetWindowsDirectory(test,BufferS);
   ShowMessage(Test);
End;

However, I get some message like "Access Violation"...
Is there somebody outthere who knows how to use it?
Please give me a syntax example....

Thanx!
Erik N.


0
Comment
Question by:Erik N
  • 2
3 Comments
 

Author Comment

by:Erik N
ID: 1355572
Edited text of question
0
 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
ID: 1355573
procedure TForm1.Button1Click(Sender: TObject);
var A: PChar;
begin
  GetMem(A,MAX_PATH+1);
  GetWindowsDirectory(A,MAX_PATH+1);
  showmessage(StrPas(A));
  FreeMem(A,MAX_PATH+1);
end;
0
 

Author Comment

by:Erik N
ID: 1355574
Thank you for this, ronit!
Erik N.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now