Sascha,
The an_init.tcp and an_init.cfg files are required only for netFoxAPI client
programs.
Your application - I think - is running locally and the files an_init.tcp
and an_init.cfg do not apply.
So,
* Try your call with foxtst (d:\opt\fox\ais\bin\foxtst.exe). If it
succeeds, the problem is in your code. If it fails, the problem is system
related.
* Try your code without being an NT service. If it fails, it's in your
code, but not related to being a service. If it succeeds, the problem will
be accessing FoxAPI from a service.
Do these and let us know.
Regards,
Alex Johnson
10707 Haddington
Houston, TX 77063
713.722.2859(v)
713.722.2700(sb)
713.932.0222(f)
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
-----Original Message-----
From: Sascha Wildner [SMTP:[EMAIL PROTECTED]]
Sent: Thursday, October 12, 2000 10:50 AM
To: Foxboro Mailing List
Subject: FoxAPI access on AW70 from a Windows NT Service?
Dear Folks,
I'm writing a Windows NT Service on an AW70 which is supposed to use
the FoxAPI to read Shared Variables. So I've added a line for the "system"
user to my /opt/fox/ais/bin/an_init.tcp file like the FoxAPI User's Guide
recommends in Chapter 4 (Creating an Application, Running Applications from
a Non-Root User):
System="System | Open Sets | W Files | W Objects | Read Only |
But alas, the following piece of code executed from my Service still
returns with a reterr of 212 (noaccess).
----------8<----------
int gw = 0;
char name[AN_ONAM_SIZ];
char value[AN_SVALUE_NSIZ];
int status;
int reterr;
int ret;
sprintf(name, "AWNT69ST0");
ret = sread(&gw, name, value, &status, &reterr);
---------->8----------
After execution ret is 0 which indicates success according to FoxDoc
but reterr is 212 and the returned value contains junk.
I'd be extremely grateful if anyone knows the solution.
Best regards,
Sascha Wildner
erpicon Software Development GmbH
-----------------------------------------------------------------------
This list is neither sponsored nor endorsed by the Foxboro Company. All
postings from this list are the work of list subscribers and no warranty
is made or implied as to the accuracy of any information disseminated
through this medium. By subscribing to this list you agree to hold the
list sponsor(s) blameless for any and all mishaps which might occur due to
your application of information received from this mailing list.
To be removed from this list, send mail to
[EMAIL PROTECTED]
with "unsubscribe foxboro" in the Subject. Or, send any mail to
[EMAIL PROTECTED]