NO

Author Topic: Link error SHFileOperation (DoH! solved)  (Read 3414 times)

Danielm103

  • Guest
Link error SHFileOperation (DoH! solved)
« on: February 12, 2009, 05:39:37 AM »
Anyone know how to resolve this error?

Thanks

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



Code: [Select]
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);
}
« Last Edit: February 12, 2009, 05:53:28 PM by Danielm103 »

Danielm103

  • Guest
Re: Link error SHFileOperation
« Reply #1 on: February 12, 2009, 06:23:30 AM »

DOH!  shell32.lb   ;D