Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 31 MAY 1999 03:07:01AM Nick Stevenson wrote:

I have an .INI file that is created/updated on printer and font setup selections. I need this file to be placed in the user's Windows directory. 99% of all users have Windows in C:\Windows - but I am now working on an NT Terminal Server system where Windows is loaded into W:\Windows. Clearly, my SP must determine where to find this .INI file. I don't want to hard code anything, I don't want to have to store the location in a user profile table - I want to be able to determine where this .INI file should be at the time I want it. The GetPrivateProfileString function seems to work OK (I use this to get the list of printers).

Any ideas?


At 31 MAY 1999 07:04AM cpates@sprezzatura.com - [url=http://www.sprezzatura.com]Sprezzatura Group[/url] wrote:

Nick,

Use the windows API function GetWindowsDirectory()

It takes 2 arguments , lpWindowsPath and cbWindowsPath, which are a buffer to contain the directory string and the number of bytes in this buffer respectively.

eg

Buffer=Str( \00\, 256 )

RetVal=GetWindowsDirectory( Buffer, Len( Buffer ) )

Begin Case

Case RetVal=0;  * Failed
Case RetVal ] Len( Buffer ); * Buffer is too small
Case 1
   WinDir=Buffer1,RetVal

End Case

It should be protyped in DLL_KERNEL as:

USHORT PASCAL GetWindowsDirectory( LPCHAR, USHORT )

cpates@sprezzatura.com

Sprezzatura Group

World Leaders in all things RevSoft


At 31 MAY 1999 08:50AM Don Bakke wrote:

Nick,

It's always good to get some answers from Carl, but have you tried to update this INI file without specifying a path at all? I read and udpate WIN.INI and OINSIGHT.INI without a path and it always seems to work just fine.

dbakke@srpcs.com

SRP Computer Solutions


At 01 JUN 1999 01:55AM Nick Stevenson wrote:

Thanks Carl - works like a dream.

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/99d0352d4eb2a6398525678200271852.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1