Sign in to follow this  
Followers 0
bub

DllStruct functions equivalent c++

3 posts in this topic

I need this function in C + + code:

Func RichEditGetSelect($hWnd)
    Local $tCharRange = DllStructCreate("long cpMin;long cpMax")
    _SendMessage($hWnd, 1076, 0, DllStructGetPtr($tCharRange))
    Local $aRet[2]
    $aRet[0] = DllStructGetData($tCharRange, 1)
    $aRet[1] = DllStructGetData($tCharRange, 2)
    Return $aRet
EndFunc

SendMessage is not a problem ...

but functions DllStructCreate, DllStructGetPtr and DllStructGetData are a huge problem.

so I created the C + + code trying to use a structure:

long* DLL_EXPORT RichEditGetSelect(HWND a)
{

long Ret[2];

    typedef struct Done
    {
        long cpMin;
        long cpMax;
    };

    Done ptr;
    
      SendMessage(a,1076,0,ptr);

      Ret[0] = ptr.cpMin;
      Ret[1] = ptr.cpMax;
      
    return Ret;
}

But you need a LPARAM and then returns error:

Posted Image

can anyone help me?

Share this post


Link to post
Share on other sites



THANKSSSSSSSSSSSSSSS!!!!

SendMessage(a,1076,0,(LPARAM)&ptr);

WORKKKKKKKKKKK!! =)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0