www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.dwt - Embedding DWT

reply "sleek" <cslush gmail.com> writes:
I have created an IE toolbar by creating a COM server and then using DWT for 
the interface. I'm able to get everything to display properly, but when I 
open windows and then close them, it seems like DWT is crashing somewhere 
because the parent windows disappear as well.

I'm using Shell.win32_new to create my Shell because I need it to use the IE 
hwnd as it's parent. I know that win32_new is makred as something that is 
not part of the public API, but I'm not sure how else I can solve my 
problem.

Are there any other ways that I can create a shell that has an HWND parent?

Lastly, are there any recommended ways of debugging a D dll? I'm having a 
hell of a time right now and frankly it seems that adding logging to a file 
is the only way that I can do it (ewwww).

Any help is _GREATLY_ appreciated. Thanks 
Oct 07 2008
parent reply Frank Benoit <keinfarbton googlemail.com> writes:
sleek schrieb:
 I have created an IE toolbar by creating a COM server and then using DWT for 
 the interface. I'm able to get everything to display properly, but when I 
 open windows and then close them, it seems like DWT is crashing somewhere 
 because the parent windows disappear as well.
 
 I'm using Shell.win32_new to create my Shell because I need it to use the IE 
 hwnd as it's parent. I know that win32_new is makred as something that is 
 not part of the public API, but I'm not sure how else I can solve my 
 problem.
 
 Are there any other ways that I can create a shell that has an HWND parent?
 
 Lastly, are there any recommended ways of debugging a D dll? I'm having a 
 hell of a time right now and frankly it seems that adding logging to a file 
 is the only way that I can do it (ewwww).
 
 Any help is _GREATLY_ appreciated. Thanks 
 
 
Well, a IE toolbar will never be X-platform, so I think it is OK to rely on win32 only features. Another good resource to get answers is eclipse.org/platform/swt newsgroup. Debugging: well you can load it and then "attach to the process". I am curious, how did you do the COM server? Did you use the DWT ole package or dwin or something else?
Oct 07 2008
next sibling parent Robert Fraser <fraserofthenight gmail.com> writes:
Frank Benoit wrote:
 Well, a IE toolbar will never be X-platform, so I think it is OK to rely
 on win32 only features.
IE is available for mac & Windows Mobile. Whether the toolbars will work is a different story.
Oct 08 2008
prev sibling parent reply "sleek" <cslush gmail.com> writes:
Frank,

So we are using win32_new which seems to be correctly creating the root 
shell for us. However, if we open any child windows that parent this root 
shell and then close those windows, it seems like something is crashing 
because the window _and_ the root window (in this case IE) go away. Any 
ideas?

As to the COM server, we used dwin. The activex control we created used DWT. 
I'd be more than happy to share this code with you. Do you have an IM 
account that we can chat live?

"Frank Benoit" <keinfarbton googlemail.com> wrote in message 
news:gchleo$10mk$1 digitalmars.com...
 sleek schrieb:
 I have created an IE toolbar by creating a COM server and then using DWT 
 for
 the interface. I'm able to get everything to display properly, but when I
 open windows and then close them, it seems like DWT is crashing somewhere
 because the parent windows disappear as well.

 I'm using Shell.win32_new to create my Shell because I need it to use the 
 IE
 hwnd as it's parent. I know that win32_new is makred as something that is
 not part of the public API, but I'm not sure how else I can solve my
 problem.

 Are there any other ways that I can create a shell that has an HWND 
 parent?

 Lastly, are there any recommended ways of debugging a D dll? I'm having a
 hell of a time right now and frankly it seems that adding logging to a 
 file
 is the only way that I can do it (ewwww).

 Any help is _GREATLY_ appreciated. Thanks
Well, a IE toolbar will never be X-platform, so I think it is OK to rely on win32 only features. Another good resource to get answers is eclipse.org/platform/swt newsgroup. Debugging: well you can load it and then "attach to the process". I am curious, how did you do the COM server? Did you use the DWT ole package or dwin or something else?
Oct 08 2008
next sibling parent reply "Michael Robellard" <mrobellard ag.com> writes:
Hello,

I am working with sleek on this project and just wanted to update the 
newsgroup that we found the problem that was causing our crash. The bug has 
nothing at all to do with dwt. It ends up that DWT call 
CoFreeUnusedLibraries every time it does a release of a COM object. It ends 
up that our COM server was set up incorectelly. DllCanUnloadNow was 
returning true because we were not incrementing the Module lock count each 
time we created a COM object.

After fixing this things started working much better.

"sleek" <cslush gmail.com> wrote in message 
news:gcian7$2kvg$1 digitalmars.com...
 Frank,

 So we are using win32_new which seems to be correctly creating the root 
 shell for us. However, if we open any child windows that parent this root 
 shell and then close those windows, it seems like something is crashing 
 because the window _and_ the root window (in this case IE) go away. Any 
 ideas?

 As to the COM server, we used dwin. The activex control we created used 
 DWT. I'd be more than happy to share this code with you. Do you have an IM 
 account that we can chat live?

 "Frank Benoit" <keinfarbton googlemail.com> wrote in message 
 news:gchleo$10mk$1 digitalmars.com...
 sleek schrieb:
 I have created an IE toolbar by creating a COM server and then using DWT 
 for
 the interface. I'm able to get everything to display properly, but when 
 I
 open windows and then close them, it seems like DWT is crashing 
 somewhere
 because the parent windows disappear as well.

 I'm using Shell.win32_new to create my Shell because I need it to use 
 the IE
 hwnd as it's parent. I know that win32_new is makred as something that 
 is
 not part of the public API, but I'm not sure how else I can solve my
 problem.

 Are there any other ways that I can create a shell that has an HWND 
 parent?

 Lastly, are there any recommended ways of debugging a D dll? I'm having 
 a
 hell of a time right now and frankly it seems that adding logging to a 
 file
 is the only way that I can do it (ewwww).

 Any help is _GREATLY_ appreciated. Thanks
Well, a IE toolbar will never be X-platform, so I think it is OK to rely on win32 only features. Another good resource to get answers is eclipse.org/platform/swt newsgroup. Debugging: well you can load it and then "attach to the process". I am curious, how did you do the COM server? Did you use the DWT ole package or dwin or something else?
Oct 08 2008
parent Frank Benoit <keinfarbton googlemail.com> writes:
Michael Robellard schrieb:
 Hello,
 
 I am working with sleek on this project and just wanted to update the 
 newsgroup that we found the problem that was causing our crash. The bug has 
 nothing at all to do with dwt. It ends up that DWT call 
 CoFreeUnusedLibraries every time it does a release of a COM object. It ends 
 up that our COM server was set up incorectelly. DllCanUnloadNow was 
 returning true because we were not incrementing the Module lock count each 
 time we created a COM object.
 
 After fixing this things started working much better.
 
Thanks for the update and also thanks for using DWT. Frank
Oct 08 2008
prev sibling parent reply Frank Benoit <keinfarbton googlemail.com> writes:
 Do you have an IM 
 account that we can chat live?
If there is still the need, there is IRC freenode #DWT http://mibbit.com/
Oct 09 2008
parent reply "sleek" <cslush gmail.com> writes:
Frank,

We are having an issue right now that we can't debug. In particular, it has 
to do with multiple IE windows opening. When a single IE window is open, all 
works great. However, if a new one opens up, we get a crash. We have log 
statements in the code, but none of them are even getting hit, which leads 
us to believe that this probably is happening somewhere in the DLL attach. 
We have trying use windbg and ddbg to track down the issue, but we're at a 
loss here. Any ideas what we can look at to try and track this thing down?

"Frank Benoit" <keinfarbton googlemail.com> wrote in message 
news:gcmugi$2jn0$1 digitalmars.com...
 Do you have an IM
 account that we can chat live?
If there is still the need, there is IRC freenode #DWT http://mibbit.com/
Oct 10 2008
parent reply "sleek" <cslush gmail.com> writes:
Threading issues have been resolved. Basically we needed to create a shell 
that parented an HWND we were provided. We tried using display.syncExec 
which worked until we attempted the Shell.win32_new ... apparantly you can't 
create a window that parents an HWND from a different thread. So instead, in 
the syncExec, we create a new normal shell, create an OleFrame that parents 
the shell. After the syncExec, we now have a shell object with a bogus hwnd. 
So what we do is a simple Windows function call:   SetParent(shell.handle, 
hwndParent). voila, problem solved. DWT is making me happy again

"sleek" <cslush gmail.com> wrote in message 
news:gcnko8$25d6$1 digitalmars.com...
 Frank,

 We are having an issue right now that we can't debug. In particular, it 
 has to do with multiple IE windows opening. When a single IE window is 
 open, all works great. However, if a new one opens up, we get a crash. We 
 have log statements in the code, but none of them are even getting hit, 
 which leads us to believe that this probably is happening somewhere in the 
 DLL attach. We have trying use windbg and ddbg to track down the issue, 
 but we're at a loss here. Any ideas what we can look at to try and track 
 this thing down?

 "Frank Benoit" <keinfarbton googlemail.com> wrote in message 
 news:gcmugi$2jn0$1 digitalmars.com...
 Do you have an IM
 account that we can chat live?
If there is still the need, there is IRC freenode #DWT http://mibbit.com/
Oct 14 2008
parent reply yidabu <yidabu.spam gmail.com> writes:
On Tue, 14 Oct 2008 18:28:26 -0400
"sleek" <cslush gmail.com> wrote:

 Threading issues have been resolved. Basically we needed to create a shell 
 that parented an HWND we were provided. We tried using display.syncExec 
 which worked until we attempted the Shell.win32_new ... apparantly you can't 
 create a window that parents an HWND from a different thread. So instead, in 
 the syncExec, we create a new normal shell, create an OleFrame that parents 
 the shell. After the syncExec, we now have a shell object with a bogus hwnd. 
 So what we do is a simple Windows function call:   SetParent(shell.handle, 
 hwndParent). voila, problem solved. DWT is making me happy again
How about post simple sample code for the trick? -- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D ÓïÑÔ-ÖÐÎÄ(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/
Oct 15 2008
parent "sleek" <cslush gmail.com> writes:
We will be contributing both the in-place COM server implementation as well 
as our trick to allow for embedding DWT. I'll try to put some stuff together 
before the weekend. I just need to make sure I exclude work-specific code so 
I'm not violating any policies at the job.

"yidabu" <yidabu.spam gmail.com> wrote in message 
news:20081015192013.3d783c34.yidabu.spam gmail.com...
 On Tue, 14 Oct 2008 18:28:26 -0400
 "sleek" <cslush gmail.com> wrote:

 Threading issues have been resolved. Basically we needed to create a 
 shell
 that parented an HWND we were provided. We tried using display.syncExec
 which worked until we attempted the Shell.win32_new ... apparantly you 
 can't
 create a window that parents an HWND from a different thread. So instead, 
 in
 the syncExec, we create a new normal shell, create an OleFrame that 
 parents
 the shell. After the syncExec, we now have a shell object with a bogus 
 hwnd.
 So what we do is a simple Windows function call: 
 SetParent(shell.handle,
 hwndParent). voila, problem solved. DWT is making me happy again
How about post simple sample code for the trick? -- yidabu <yidabu.spam gmail.com> http://www.dsource.org/projects/dwin D ÓïÑÔ-ÖÐÎÄ(D Chinese): http://www.d-programming-language-china.org/ http://bbs.d-programming-language-china.org/ http://dwin.d-programming-language-china.org/ http://scite4d.d-programming-language-china.org/
Oct 15 2008