Konstantin Chugalinskiy
Mon, 05 Apr 2010 07:58:28 -0700
Hello, wxHaskell community! I need to embed web control into my application under Windows 7. I am trying to use wxWebconnect ( http://www.kirix.com/labs/wxwebconnect/documentation/getting-started.html ) library with Gecko engine for this. Haskell code: foreign import stdcall unsafe "_browserFrame" c_browserFrame :: Ptr a -> IO(Ptr ())
main :: IO ()
main
= start gui
gui :: IO ()
gui = do
f <- frame [text := "Hello world!", size := (sz 600 600) ]
withObjectPtr f c_browserFrame
return ()
where browser frame looks like
C++ code:
void* __stdcall browserFrame (wxFrame* ptrWxWindow)
{
wxString xulrunner_path = FindXulRunner(wxT("xr"));
wxString dir(wxT("\\plugins"));
wxWebControl::InitEngine(xulrunner_path);
wxWebControl::AddPluginPath(dir);
wxWebControl* ptrBrowser = new wxWebControl(ptrWxWindow, wxID_WEB,
wxPoint(0,0), wxSize(600,600)); //Here error comes from
return ptrWxWindow;
}
it is compiled as dll by MS Visual 2008 and linked to Haskell program.
Also it looks like CreateControl execution fails.
It should be mentioned that ptrWxWindow can be operated with no errors (I
mean hiding, resizing etc) and no any other kind of control can be created
(wxButton, wxLabel).
If first parameter to c_browserFrame (parent window) is objectNull then
everything is ok with no changes to gui. I can't understand what is wrong
with ptrWxWindow param when passed from Haskell.
typeid(ptrWxWindow).name() shows expected type of ptrWxWindow - wxFrame.
What am I doing wrong? Please help me. Or maybe can you help me using your
wxdirect subsystem to add this control to wxHaskell?
with best regards,
Chugalinskiy Konstantin
kchugalins...@gmail.com
Jabber: koschugalins...@jabber.ru
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev
_______________________________________________ wxhaskell-users mailing list wxhaskell-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxhaskell-users