RE: [GD-Windows] Program directory
Brought to you by:
vexxed72
From: Gareth L. <GL...@cl...> - 2002-06-12 10:06:39
|
Yes, the define _MAX_PATH and it's friends are well worth using in = cases like this. Sadly GetModuleFileName doesn't return the length if the buffer you = give is too small, unlike other API calls. Regards, Gareth Lewin -----Original Message----- From: Ignacio Casta=F1o [mailto:cas...@ya...] Sent: 11 June 2002 21:00 To: gam...@li... Subject: Re: [GD-Windows] Program directory Javier Arevalo wrote: > > I would like to know how to retrieve the path where the program = being > > executed is. > > TCHAR szExeFilename[300]; > ::GetModuleFileName(NULL, szExeFilename, > sizeof(szExeFilename)/sizeof(szExeFilename[0])); That works fine, thanks! BTW, I once had problems with those hardcoded string names when one = client installed my application under a very long file path... Ignacio Casta=F1o cas...@ya... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________________________ Multimillion Dollar Computer Inventory Live Webcast Auctions Thru Aug. 2002 - http://www.cowanalexander.com/calendar _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 |