Re: [Dev-C++] invalid converion from
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2003-10-31 14:30:16
|
See void* as a pointer of unknown type. If you do
char *charptr;
void *voidptr = xx;
charptr = (char*)voidptr;
then you tell the compiler that you know for sure that the typeless
voidptr is actually ok to treat as a pointer to char.
/Per W
On Fri, 31 Oct 2003, EXT-Meyer, Robert J wrote:
> When compiling tutorial examples, I keep getting 'invalid conversion from' errors. What do they mean?
>
> For example 'invalid conversion from 'void*' to 'CHAR*'
>
> or 'invalid conversion from 'void*' to 'HFONT__*' occuring on this piece of code under WndProc:
>
> case WM_CREATE:
> {
> HFONT hfDefault;
> HWND hEdit;
>
> hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "",
> WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL,
> 0, 0, 100, 100, hwnd, (HMENU)IDC_MAIN_EDIT, GetModuleHandle(NULL), NULL);
> if(hEdit == NULL)
> MessageBox(hwnd, "Could not create edit box.", "Error", MB_OK | MB_ICONERROR);
>
> hfDefault = GetStockObject(DEFAULT_GUI_FONT);
> SendMessage(hEdit, WM_SETFONT, (WPARAM)hfDefault, MAKELPARAM(FALSE, 0));
> }
> break;
>
> Thanks for any suggestions,
>
> Rob
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive? Does it
> help you create better code? SHARE THE LOVE, and help us help
> YOU! Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|