Hi!

I want to pop up the Find common Dialog, but this code doesn't seem to work; I've been swimming through the API reference and Iczelion's (they use a custom Find dialog box), without success; FindText returns false. Any clues will be thanked.

;Externs, EQUs and variable declarations omitted, Nasm syntax with 'sc' macro.



FindDialog:
mov dword [fr.Flags], 0
mov dword [fr.lStructSize], 40;
mov dword eax, [RichEditControlHandle]
mov dword [fr.hwndOwner], eax;
mov dword [fr.hInstance], 0;
mov dword eax, [findstring]
mov dword [fr.lpstrFindWhat], eax;
mov dword eax, [replacestring]
mov dword [fr.lpstrReplaceWith], eax;
mov word [fr.wFindWhatLen], 128;
mov word [fr.wReplaceWithLen], 128;
mov dword [fr.lCustData], 0;
mov dword [fr.lpfnHook], 0;
mov dword [fr.lpTemplateName], 0;
sc FindTextA, fr
ret

[section .bss]

fr:
.lStructSize: resd 1;
.hwndOwner: resd 1;
.hInstance: resd 1;
.Flags: resd 1;
.lpstrFindWhat: resd 1;
.lpstrReplaceWith: resd 1;
.wFindWhatLen: resw 1;
.wReplaceWithLen: resw 1;
.lCustData: resd 1;
.lpfnHook: resd 1;
.lpTemplateName: resd 1;


Regards and thanks in advance,

Wavemaker
Posted on 2001-11-16 13:50:46 by Wavemaker
Assuming the structure definition is correct, are findstring and replacestring string buffers or pointers to string buffers?

The NASM code is correct for pointers, but not for buffers.

Also, the common dialog attempts to display lpstrFindWhat and lpstrReplaceWith when it opens. Be sure they are initialized with at least an empty string.
Posted on 2001-11-16 17:53:52 by tank
Thank you, tank! You were right, the problem was using the values instead of the pointers. My fault, for not reading what I code. Thanks again.

Bye,

Wavemaker
Posted on 2001-11-17 05:59:52 by Wavemaker