Reply to Thread

Post a reply to the thread: Call DLL adventures

Your Message

Click here to log in

What's the name of our main installation product (in uppercase letters), directly followed by the current year?

 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Topic Review (Newest First)

  • 01-30-2021, 02:47 PM
    MarkRiffey

    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
  • 01-27-2021, 09:44 AM
    linder

    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
  • 01-26-2021, 07:55 PM
    MarkRiffey

    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

Posting Permissions

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