Bonjour,
I'm trying to port, for fun, one of my little programs from OS4 to MOS (on a PowerBook under MOS3.2). The goal of this program is to detect selected files in Workbench and to pass them to YAM or SimpleMail as attachment.
But I have problem with WorkbenchControl function.
The following code works under AOS4 but I can't find why it fails under MOS.
The call to WorkbenchControl always return FALSE (therefore "Error" in my sample)
Certainly that I miss a little thing...
I compile the following code with
gcc AttachMail.c -o AttachMail -noixemul
When I start it (even with files selected in Ambient) I obtain "Error"
Thank for your help
Code:
#include <stdio.h>
#include <proto/exec.h>
#include <proto/wb.h>
#include <workbench/workbench.h>
#include <string.h>
int main(int argc,char **argv)
{
struct List * selectIcons;
if (WorkbenchControl(NULL,WBCTRLA_GetSelectedIconList,&selectIcons,TAG_DONE))
{
printf("OK n");
WorkbenchControl(NULL,WBCTRLA_FreeSelectedIconList,selectIcons,TAG_DONE);
}
else
{
printf("Error n") ;
}
return 0;
}
[ Edité par zzd10h 10.07.2013 - 21:54 ]