?
Solved

The use of GetWindowsDirectory..

Posted on 1998-01-07
3
Medium Priority
?
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

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

Accepted Solution

by:
ronit051397 earned 200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

771 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