Einzelnen Beitrag anzeigen

Benutzerbild von Remko
Remko

Registriert seit: 10. Okt 2006
Ort: 's-Hertogenbosch, Die Niederlande
222 Beiträge
 
RAD-Studio 2010 Arc
 
#17

Re: Convert sample from platform SDK to Delphi

  Alt 22. Dez 2006, 11:00
How to do this one:
Code:
HWND CPropSheetHost::_CreateHiddenWindow()
{
    WNDCLASS wc;

    if(!GetClassInfo(m_hInst, m_szHiddenWindowClass, &wc))
    {
        ZeroMemory(&wc, sizeof(wc));
           
        wc.style         = CS_HREDRAW | CS_VREDRAW;
        wc.lpfnWndProc   = (WNDPROC)_HiddenWindowProc;
<cut>

LRESULT CALLBACK CPropSheetHost::_HiddenWindowProc( HWND hWnd,
                                                    UINT uMessage,
                                                    WPARAM wParam,
                                                    LPARAM lParam)
I thought this:
Delphi-Quellcode:
function TPropSheetHost._CreateHiddenWindow: HWND;
var wc: TWndClass;
begin
  if not GetClassInfo(m_hInst, m_szHiddenWindowClass, wc) then
  begin
    ZeroMemory(@wc, SizeOf(wc));
    wc.style := CS_HREDRAW or CS_VREDRAW;
    wc.lpfnWndProc := @_HiddenWindowProc;
<cut>

function TPropSheetHost._HiddenWindowProc(hWnd: HWnd; Msg: UINT; WParam: WPARAM; LParam: LPARAM): UINT; stdcall;
But that doesn't make the compiler happy: [Pascal Error] PropSheetHost.pas(174): E2036 Variable required

Edit: Should I make that:
Delphi-Quellcode:
wc.lpfnWndProc := @TPropSheetHost_HiddenWindowProc;
function TPropSheetHost._HiddenWindowProc(hWnd: HWnd; Msg: UINT; WParam: WPARAM; LParam: LPARAM): UINT; stdcall;
?[/delphi]
or
[delphi][pre]wc.lpfnWndProc := @_HiddenWindowProc;
function _HiddenWindowProc(hWnd: HWnd; Msg: UINT; WParam: WPARAM; LParam: LPARAM): UINT; stdcall;[/pre]?
  Mit Zitat antworten Zitat