Solved

Getting Strings for Win/WinSys Directory

Posted on 1998-01-26
1
176 Views
Last Modified: 2010-04-04
Can anyone tell me how to return teh strings for the GetWindowsDirectory and GetWindowsSysDir.  I'm looking for code.  Here's teh code I already have (it causes an access violation)

procedure TForm2.Button3Click(Sender: TObject);
var
lptstr: pchar;
begin
 getwindowsdirectory(lptstr,MAX_PATH);
end;
0
Comment
Question by:d4jaj1
[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
1 Comment
 
LVL 5

Accepted Solution

by:
ronit051397 earned 10 total points
ID: 1357609
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

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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month8 days, 23 hours left to enroll

617 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