I got two little problems: one is I want to call a function in a dll and I realized that I need one more parameter (a string - DriveStore). I got the address of the function in ebx and want to push the string onto stack so I can modify it in the DLL: In program:
mov ecx,offset push ecx push hMenuApp push hMenuFolder push hPopup push hDlg push hInstance call ebx
On every program start edx contains the same value so its probably not the address of the string. The other problem is with combo boxes (and strings also): I need to retrieve the address of a string in a combo box:
InitApp proc uses ebx hInst:HINSTANCE,hDlg:HWND,hPopup:DWORD, hMenuFolder:DWORD,hMenuApp:DWORD,DriveBuffer:DWORD xor edx,edx xor edx,edx mov dl,count dec dl mov byte ptr,cl
But after that ebx is I think zero or one - I'm not sure. How do I get the string ? (edited to split a very long line -Ernie) This message was edited by Ernie, on 5/28/2001 11:22:16 AM
invoke SendDlgItemMessage,hDlg,IDC_SCROLLBAR1,CB_GETITEMDATA,Drive,0 mov ebx,eax
When you pass something large like a string, it's best to pass it by reference, meaning you pass the address where it is, not the string itself. You need to modify this string, but that should be OK, as it seems to be a path, and a path may only be MAX_PATH characters long. In any case, you need to insure the string buffer you pass is long enough to hold the modified string if you wish to always avoid a GPF. One method common to the API is to pass in a reference to a pointer to the string. This indirection allows the dll to change the string itself (by changing the pointer to something else). It also allows you to call the routine with a NULL pointer, in which case the DLL would just compute the string length it requires, and place that back into the pointer. I know, dereferencing such a pointer can be madening. But once your inner eye can read such code, all your code will become improved. As far as combo boxes go, I don't have much expierence with them, and don't want to just copy MSDN for you.
OK, think I got it now. At least I got the string address in the dll (don't get the correct values written to it for some reason yet). This message was edited by goofee, on 5/30/2001 12:25:41 PM