DEMOPAGE_API HWND __stdcall Init(HWND hWndParent, unsigned __int64 gid, LPCTSTR pszUserPath)
{
if(g_pDllMainWnd == NULL)
{
g_pDllMainWnd = new CDllMainWnd;
g_pDllMainWnd->m_strText = pszUserPath;
g_pDllMainWnd->Create(NULL, _T("DllMainPage"), WS_CHILD|WS_VISIBLE, CRect(0,0,0,0), 
CWnd::FromHandle(hWndParent), 2344);
}
return g_pDllMainWnd->m_hWnd;
}如题,请帮忙用delphi写一下。

解决方案 »

  1.   

    我扔块小砖头, 引引玉哈!( 我知道我肯定译得不对...楼主和过往高人不要笑....我自己都不好意思了......)var g_pDllMainWnd : CDllMainWnd;function Init(hWndParent:HWND; gid:Cardinal; pszUserPath:string):HWND;stdcall;
    begin
        if(g_pDllMainWnd = 0)  then
           begin
           g_pDllMainWnd.m_strText := pszUserPath;
           g_pDllMainWnd.Create( 0 , _T('DllMainPage'), WS_CHILD + WS_VISIBLE, CRect(0,0,0,0), hWndParent.handle , 2344);
           end;
        result := g_pDllMainWnd.m_hWnd;
    end;
      

  2.   

    CDllMainWnd 应该是个窗体,对吗?