× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Bill:

I'm just a tired ole broke down MI programmer and I don't get it.

First, can you change the declare for @OBJ to a system pointer then make
sure that it is initialized to null before executing rslvsp function?  At
one time, I did some real damage by not initializing my pointers first.  The
return value is a system pointer.  The declaration showing in your message
is for a space pointer.  They are definitely not the same thing.  In the old
days, the error messages for MI were pretty bad.

Second, can you make sure that QUERYLIB is actually there and that object
SDBOOKCOS is actually in the library and that it is type x'1911' before
running this?  It turns out that the instructions for rslvsp in the C manual
says that if the library name isn't *LIBL, it will resolve to the library
first then resolve to the object - you actually get two rslvsp for one.  If
the library isn't there that will cause an error - perhaps the one that you
are seeing.  If the library is there but the object isn't there you would
get an error.  I don't think that it should report a "not found" error then
reply with the wrong object type and subtype but I am really making this up.

Here is the parameter definition section in the C manual:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3.82.3 Parameters

obj_type (input)
    A member of the enumerated list of object types.  The enumeration is
supplied in the <milib.h> header file.

obj_name (input)
    A null terminated string specifying the name of the object.

lib_name (input)
    A null terminated string  specifying the name of the library where the
object is stored.  You can specify either a specific name for the library,
or
    the character string "*LIBL" (or an empty string), which indicates that
the current library list is to be searched to find the library where the
object
    is stored.

auth (input)
    Constructed from supplied bit mask macros in the <milib.h> header file.
Programs executing in user-domain may not assign authority in the
    resulting system pointer.  The value in auth is ignored; authority is
set to the not set state.  Otherwise, the object authority states are set as
    specified by auth.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Notice that for the lib name and obj name, they say "null terminated
strings".  And, notice that the object type and subtype FOLLOW the object
name and library name in the template.  Inside the real function, there is a
character copy to put the right values into the real MI template.  Since it
is a C function, it might use a string copy to move those bytes.  If they
used a string copy instruction (instead of memcpy) for the type then it
might just keep looking until it found a hex zero.  When it found one, it
could have copied the two bytes just to the left of the hex zero.  If those
were x'0F' and x'FF' that might be more than coincidence.

I suspect that the problem is going to be found somewhere around how RPG
maps variables and types when it calls a C function.


Richard Jackson
mailto:richardjackson@richardjackson.net
www.richardjacksonltd.com
Voice: 1 (303) 808-8058
Fax:   1 (303) 663-4325

-----Original Message-----
From: owner-mi400@midrange.com [mailto:owner-mi400@midrange.com]On
Behalf Of Bill
Sent: Tuesday, July 18, 2000 1:39 PM
To: MI400@midrange.com
Subject: Re: Convert an MI program to RPG


Leif and Richard, thanks.  The original program from Simon specified
appending the null char after the trimmed names.  It seems to work better
leaving off the null, but I have a new problem:

Message . . . . :   Cannot resolve to object SDBOOKCOS. Type and Subtype
  X'0FFF' Authority X'0000'.

@OBJ                  POINTER              SPP:*NULL
LIBNAME               CHAR(10)             'QUERYLIB  '
'D8E4C5D9E8D3C9C24040'X
OBJNAME               CHAR(10)             'SDBOOKCOS '
'E2C4C2D6D6D2C3D6E240'X
OBJTYPE               CHAR(2)              '  '             '1911'X
RSLVOBJ_T             DS
  INTLIBNAME          CHAR(31)             'QUERYLIB                       '
                      VALUE IN HEX
'D8E4C5D9E8D3C9C24040404040404040404040404040404040404040404040'X
  INTOBJNAME          CHAR(31)             'SDBOOKCOS                      '
                      VALUE IN HEX
'E2C4C2D6D6D2C3D6E240404040404040404040404040404040404040404040'X
  INTOBJTYPE          CHAR(2)              '  '             '1911'X
  REQAUTH             CHAR(2)              '  '             '0000'X
RTNCODE               CHAR(1)              '1'              'F1'X
SPCPTR                POINTER              SPP:*NULL

As you can see, objtype=X'1911', but the msg says it's looking for type
'0fff'.

As a reminder here is the call to rslvsp:
C                   Eval      @obj       = RSLVSP( intObjType :
C                                                  intObjName :
C                                                  intLibName :
C                                                  reqAuth     )

Any ideas?

Bill


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
+---
| This is the MI Programmers Mailing List!
| To submit a new message, send your mail to MI400@midrange.com.
| To subscribe to this list send email to MI400-SUB@midrange.com.
| To unsubscribe from this list send email to MI400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: dr2@cssas400.com
+---

+---
| This is the MI Programmers Mailing List!
| To submit a new message, send your mail to MI400@midrange.com.
| To subscribe to this list send email to MI400-SUB@midrange.com.
| To unsubscribe from this list send email to MI400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: dr2@cssas400.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.