Re: OPI function wave_execute fails on VMS [message #31110] |
Thu, 13 June 2002 15:00 |
Dave Greenwood
Messages: 33 Registered: October 2000
|
Member |
|
|
In a previous article, GuidoVent@web.de (Guido Vent) wrote:
> Hallo all,
>
> I use then PV-Wave OPI extension to execute Wave-commands from a
> C-DLL, which is called via LINKNLOAD from Wave. On WinNt this works
> fine, but on VMS I get an access violation:
>
> %SYSTEM-F-ACCVIO, access violation, reason mask=01, virtual
> address=FFFFFFFC, PC=0065FAD8, PSL=03C00004
> % LINKNLOAD: Error in called routine.
> % Execution halted at $MAIN$ (LINKNLOAD).
>
> Here is the C source:
>
> #include "opi_c_devel.h"
>
> long Wave_Test(int argc, char *argv[])
> {
> char **text = ((char ***)argv)[0];
> printf("%s\n",*text);
> wave_execute(*text);
> return 0;
> }
>
>
> Other OPI-functions like wave_get_WVH or wvh_dataptr work fine.
I'm not much of a C programmer, but I think you need to declare your
main routine to be "int main" rather than "long Wave_Test". I suspect
something like the following will work:
#include <stdio.h>
#include "opi_c_devel.h"
int main(int argc, char *argv[])
{
char *text = argv[0];
printf("%s\n",text);
wave_execute(text);
return 0;
}
Note (1) the inclusion of stdio.h to avoid complaints about printf being
implicitly declared a function
(2) the simpler use of text
Hth,
Dave
--------------
Dave Greenwood Email: Greenwoodde@ORNL.GOV
Oak Ridge National Lab %STD-W-DISCLAIMER, I only speak for myself
|
|
|