AbiCollab Win32 GUI - so close, need some answers

From: Ryan Pavlik <abiryan_at_ryand.net>
Date: Tue Jul 17 2007 - 06:55:42 CEST

Hey all! As those of you subscribed to the commit list know, I've been
making some large changes to the Win32 port of AbiCollab in an attempt
to get it to have a GUI. I am very close now, and could use some
pointers (no pun intended) with regard to a few specific questions.

I am calling the Win32 function DialogBoxParam() in order to create a
dialog. One of the parameters is an HINSTANCE of the image (exe/dll)
that contains the resource. Setting this up in the most obvious manner
gets the HINSTANCE from XAP_App, which seems incorrect: that is the
handle to the AbiWord.exe image, not the AbiCollab.dll image where the
dialog actually is stored. The error I am getting (1814) when running
the dialog seems to confirm this suspicion.

Browsing around Aiksaurus and Google Code Search of Abi, it seems as
though ABI_PLUGIN_DECLARE gets expanded on Windows to create a DllMain
function [1], which gets an HMODULE from Windows and which can be used
interchangably with HINSTANCEs. The commit log [2] seems to confirm my
thought that I need to get to the s_hModule in the plugin and use that
when creating the dialog.

I have added code to the AbiCollab plugin to store this value. In the
best way that seems to be possible, it is being stored in the Session
Manager, with the same methods used in the XAP_App. So, I think I have
that part right.

Here's my question. The code in AbiCollab_Plugin.cpp is telling me that
the HMODULE it's getting (s_hModule) is 0, and this 0 is getting
successfully passed along to the dialog code, where it does nothing to
help display a dialog. Is there something I'm missing in
AbiCollab_Plugin to extract the correct value? Could someone with more
experience review my latest commit (mainly the AbiCollab_Plugin part and
the ap_Win32Dialog_CollaborationAccounts part) and see if I've made any
glaring errors and/or oversights?

Thanks to sum1 for helping me debug this code tonight and serving as a
highly accurate neural grep :)

Ryan

[1]
http://google.com/codesearch?hl=en&q=show:LrJWkZWx3uk:zvP-LlwbTE4:QKYDkVjdkNk2
[2] http://www.abisource.com/mailinglists/abiword-dev/02/Feb/0362.html
(from Dom)

-- 
Ryan Pavlik
AbiWord Win32 Platform Maintainer, Art Lead: www.abisource.com
AbiWord Community Outreach Project: www.cleardefinition.com/oss/abi/blog/
"Optimism is the father that leads to achievement."
 -- Helen Keller
"The folder structure in a modern Linux distribution such as Ubuntu
was largely inspired by the original UNIX foundations that were
created by men with large beards and sensible jumpers."
 -- Jono Bacon, The Ubuntu Guide
Received on Tue Jul 17 06:54:20 2007

This archive was generated by hypermail 2.1.8 : Tue Jul 17 2007 - 06:54:20 CEST