Ok. I forgot that we was in lite-C that code was from C. Sorry for that.
Here is the lite-C version.

Code:

#include <windows.h>
#include <stdio.h>

void SetPathToExe(void)
{
char exePath[260+1] ; // MAX_PATH = 260
GetModuleFileName( GetModuleHandle(0), exePath, sizeof( exePath )-1 ) ;
_chdir( exePath ) ;
}




Roland Strålberg Gamestudio/A7 Commercial rstralberg@msn.com