Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

The use of GetWindowsDirectory..

Posted on 1998-01-07
3
Medium Priority
?
194 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

636 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