+ Reply to Thread
Results 1 to 5 of 5

Thread: How to receive a value from a dll?

  1. #1

    Default How to receive a value from a dll?

    Hi all,
    Following with my first script I need to encrypt a variable. I created a dll with a function, MCS_Encrypt and I call it in this way:

    Call DLL "c:\Wsource\NEW_MCS_TEST\dlls\encrypt_test.dll " -- Function "MCS_Encrypt" (STRING,STRING) (%MCS_CLAVE%,%MCS_PASSWORD%)

    The function returns a string and I would like to store this value in a variable (and then assign to %MCS_PASSWORD%).

    I know that the prototype for my function could be (STRING, *STRING) but, for other reason, I can't use it.

    Thanks in advance.

    Mauricio

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

    Default Re: How to receive a value from a dll?

    Mauricio,

    If the DLL returns a value in the second parameter then it should be prototyped as (STRING, *STRING).

    There is a similar function call in the "Call Dll.sb6" script example.

    HTH,
    Friedrich

  3. #3

    Default Re: How to receive a value from a dll?

    Hi Friedrich,
    no, the prototype of my Clarion function is MCS_Encrypt(STRING,STRING),STRING. It receives 2 parameters and returns a string that I have to save to %MCS_PASSWORD%. In Clarion I would do this:

    MCS_PASSWORD = MCS_Encrypt(MCS_CLAVE, MCS_PASSWORD).

    Thanks again.

    Mauricio

  4. #4
    Join Date
    Mar 2004
    Posts
    4,308

    Default Re: How to receive a value from a dll?

    Mauricio,

    How would you handle the above with the Clarion CALL() procedure or the Windows RunDll32 technique?

    The return data type is always a numeric value.

    I would suggest to change this (in your DLL) to:

    MCS_Encrypt(STRING,STRING,*STRING),LONG

    I think we could add a feature so the return value could be a pointer to the buffer. But I think it's not really required.

    Friedrich

  5. #5

    Default Re: How to receive a value from a dll?

    Hi Friedrich,
    ok, no problem, it will be easy for me to change the function.
    Thanks for your help.

    Mauricio

+ 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
  •