Board index » delphi » Couldn't write to Delphi's EditBox from C++ DLL

Couldn't write to Delphi's EditBox from C++ DLL

Got a small problem here.
Wrote a simple DLL with VC4.2 which accepts the handle of the Delphi
EditBox control and tries to write some text on it (EditBox).

Here are small portions of my code.

Delphi2
var mhwnd: integer;
...
        mwhnd := Edit1.handle;
        i := TestDLL( mhwnd );

VC4.2
DllExport int TestDLL( HWND hwnd )
{
        SetWindowText( hwnd, "testing");
        ...

Quote
}

I couldn't seem to get any display on the EditBox. Need some help here.

Joo Yang

 

Re:Couldn't write to Delphi's EditBox from C++ DLL


Found the problem. Actually it lies with the different parameter passing
conventions. I just need to need to add the keyword "cdecl" after function
declaration.

Joo Yang

Other Threads