how to emulate this macro? Here is the C definition:
#define MAKEINTRESOURCE(i)  (LPTSTR) ((DWORD) ((WORD) (i))) 
			
			
			
				Is this what you are looking for?
SUB MAKEINTRESOURCE(n as WORD),POINTER
DEF pReturn as POINTER
_asm
	lea eax,[ebp-4]
	mov ebx,[ebp+8]
	mov [eax],ebx
_endasm
RETURN pReturn
endsub
			
			
			
				I did a second search and I found this function in another post. Sorry,  I could not find anything the first time, perhaps I misspelled the name.
I'll try it , thanks.
			
			
			
				The function work fine, thanks again.
			
			
			
				There is yet another way to cast a variable to pointer: &*<TYPE>variableWhere TYPE can be any known variable type like INT, POINT.
If you need to call a function with general-pointer parameter, the parameter you have is defined as char, int or word, and you need to pass it by value, use a heper function (like MAKEINTRESOURCE) or the above re- and de-reference:
declare extern OpenResourceDialog(pointer id_or_name)
' where id_or_name can be an integer 0-65535, or a string pointer.
' usage examples:
OpenResourceDialog(5)
OpenResourceDialog("dialog2")
int id = 8;
OpenResourceDialog(id) ' <- BUG! id is passed by reference
OpenResourceDialog(&*<int>id) ' <- OK! id is passed by value
OpenResourceDialog(&*<window>id) ' OK! id is passed by value
Example 2: converting pointers to integers:
WINRECT rc
pointer value = 3
rc.left = value ' ERROR invalid assignment
rc.left = &*<int>value ' OK
			
			
			
				I'm using this precisely to open dialogs from resources.
Very useful information, thanks.