Same thing. "ofd.lpstrFile" is pointing to "buf" anyway...

Both ways works for me. I just tested it.

Maybe there is a bug in your "LoadPic" function?

Here is the COMPLETE script I was testing with...
Code:
#include <litec.h>
#include <default.c>
#include <windows.h>

PANEL*	output_pan = {	bmap="#64x64x24";		pos_x=50;  pos_y=50;	flags=SHOW;		}

function main()
{	wait(5);	level_load(NULL);		vec_fill(sky_color, 50);		wait(-3);

	OPENFILENAME ofd;		FillMemory(&ofd, sizeof(ofd), 0);
	char buf[256];			FillMemory(buf,  256, 0);
	ofd.Flags=OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST|OFN_NOCHANGEDIR;
	ofd.lStructSize		= sizeof(ofd);
	ofd.hwndOwner		= hWnd;
	ofd.lpstrFilter		= "Supported Files Types (*.bmp;*.gif;*.jpg;*.ico;*.emf;*.wmf)\0*.bmp;*.gif;*.jpg;*.ico;*.emf;*.wmf\0Bitmaps (*.bmp)\0*.bmp\0GIF Files (*.gif)\0*.gif\0JPEG Files (*.jpg)\0*.jpg\0Icons (*.ico)\0*.ico\0Enhanced Metafiles (*.emf)\0*.emf\0Windows Metafiles (*.wmf)\0*.wmf\0\0";
	ofd.lpstrInitialDir = _chr("");		//work_dir
	ofd.lpstrFile		= buf;
	ofd.nMaxFile		= 255;	
	ofd.lpstrTitle		= "Load an Image File";
	if (GetOpenFileName(&ofd))		{	output_pan.bmap = bmap_create(buf);	}
	else							{	output_pan.bmap = NULL;				}

}




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial