+ Reply to Thread
Results 1 to 3 of 3

Thread: Call DLL adventures

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Call DLL adventures

    Friedrich,

    I am using a DLL we've called from SB for a long time - and it finally needed some changes.

    For reasons I have not been able to determine, the DLL works when called by a small hand code app, but GPFs when SB calls it. Given that the SB doc indicates that mangling is a no-no, I thought maybe that was the problem, but there's no mangling.

    Prototype: GetPCC(*CSTRING PCC_CODE),SHORT,NAME('GetPCC') - I have also tried (STRING PCC_CODE) with the same results (GPF).

    Whether I call the DLL with a SB runtime variable that is empty, or one that has contents, SB GPFs. The odd thing is that this installer has been around for quite some time, and likewise has the parameter.

    If I remove the parameter from the DLL's prototype, SB works fine.

    Screenshot of SB setup image and prototype in code: https://p168.p3.n0.cdn.getcloudapp.c...79c29efe754d89

    It's unclear what I am doing incorrectly, but I'm sure there's something.

    Mark

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Call DLL adventures

    Hi Mark,

    Would it be possible to send me the DLL (and the source code of the small hand coded app) so I can check it?

    Friedrich

  3. #3

    Default Re: Call DLL adventures

    Quote Originally Posted by linder View Post
    Hi Mark,

    Would it be possible to send me the DLL (and the source code of the small hand coded app) so I can check it?

    Friedrich
    Friedrich,

    I found another way around it. I think the problem has something to do with my assumptions about how inbound parameters are handled and how I coded for them. The workaround provides better future flexibility so it was actually a good thing that I hit this problem.

    I ripped out all the stuff that doesnt matter to make this post easier to deal with, so the essence of the program was as follows:

    PROGRAM

    MAP
    !ORIGINAL ALLEGEDLY WORKING<G> PROTOTYPE GetPCC(PCC_CODE),SHORT,NAME('GetPCC')
    GetPCC(STRING PCC_CODE),SHORT,NAME('GetPCC') ! GPFs when SB calls it.
    END

    PCC_STATUS SHORT

    CODE
    !----------------------
    GetPCC PROCEDURE(STRING PCC_CODE)!,SHORT ! Used by full installation program to get and check the PCC code
    !----------------------
    PAC_STRING CSTRING(1000)

    CODE

    IF CLIP(PCC_CODE) > ' '
    PAC_STRING = PCC_CODE
    ELSE
    RETURN(-1)
    END

    ! evaluate pcc_code here

    RETURN(PCC_STATUS)



    BTW, the exp that used to work but stopped working was:
    NAME GetPCC GUI
    EXPORTS
    GetPCC @1

    Mark

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •