Link error SHFileOperation (DoH! solved)

Started by Danielm103, February 12, 2009, 05:39:37 AM

Previous topic - Next topic

Danielm103

Anyone know how to resolve this error?

Thanks

POLINK: error: Unresolved external symbol '__imp__SHFileOperationA'.
POLINK: fatal error: 1 unresolved external(s).




int crp_FileRename(void)
{

TCHAR to[MAX_PATH+1];
TCHAR from[MAX_PATH+1];

struct resbuf *pArgs = sds_getargs();

if (pArgs == NULL || pArgs->restype != RTSTR)
{
sds_retnil();
return (RSRSLT);
}
else
{
strcpy(from ,pArgs->resval.rstring);
}

if ((pArgs = pArgs->rbnext) == NULL || pArgs->restype != RTSTR)
{
sds_retnil();
return (RSRSLT);
}
else
{
strcpy(to ,pArgs->resval.rstring);
}

SHFILEOPSTRUCT sfo;
ZeroMemory(&sfo, sizeof(sfo));
sfo.wFunc = FO_RENAME;
sfo.pFrom = from;
sfo.pTo = to;

sfo.fFlags = FOF_NOCONFIRMMKDIR | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT;

if (0 == SHFileOperation(&sfo))
{
sds_rett();
}
else
{
sds_retnil();
}

return (RSRSLT);
}

Danielm103