Solved

Getting Strings for Win/WinSys Directory

Posted on 1998-01-26
1
170 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
1 Comment
 
LVL 5

Accepted Solution

by:
ronit051397 earned 10 total points
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

13 Experts available now in Live!

Get 1:1 Help Now