Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PythonWin question: application build strategy

0 views
Skip to first unread message

Ilya Kuznetsov

unread,
Mar 6, 1999, 3:00:00 AM3/6/99
to
Hello All,

I'm started to build own MFC-frontend application, using the nice
PythonWin package from Mark Hammond. I use version 123.

Followed demos are whetting my appetite ;-) and sources of framework
are best samples. In the manuals wroted: "PythonWin is only wrapper
for win32ui.pyd" -- it is not clear for me.

Question 1: for build completed application I need to overwrite
startup.py, intpyapp.py and other framework?

Question 2: win32ui has some resources (Toolbars, Menus, String
tables, and so other). How to use customize dll with resources?
I know how to create *.pyd with module-initialization code (or just
win32-dll) and resources, but how to load these resources from my
application? For example, some help page:

PyCToolBar.LoadToolBar
LoadToolBar( id )
Loads a toolbar from a toolbar resource.

and
win32ui.LoadString
PyUnicode = LoadString( stringId)

but
win32ui.LoadMenu
PyCMenu = LoadMenu( id, dll )
Creates and loads a menu resource from a DLL.

It's not clear: how to load my resource from my DLL, not from
win32ui.pyd?


Best regards,
Ilya mailto:chu...@chat.ru

Roger Burnham

unread,
Mar 6, 1999, 3:00:00 AM3/6/99
to
On Sat, 6 Mar 1999 12:23:05 GMT, Ilya Kuznetsov <chu...@chat.ru> wrote:

>Hello All,
>
> I'm started to build own MFC-frontend application, using the nice
> PythonWin package from Mark Hammond. I use version 123.
>
> Followed demos are whetting my appetite ;-) and sources of framework
> are best samples. In the manuals wroted: "PythonWin is only wrapper
> for win32ui.pyd" -- it is not clear for me.

> <Snip>

Ilya,

This prompted me to clean up for release my framework for creating just such apps.

If anyone would like a copy of the Wise installer for this, email me for a copy.
I hope to have a starship page set up soon from which to distribute this.

(from the readme)

PythonWin MFC MDI App Builder
$Revision: 1.1 $

Generates the MFC resource DLL and python files for
an MFC "Multiple Document Interface" application.

Requirements:
* Python 1.5.1 or later already installed.
* PythonWin build 123 or later already
installed.
* MS Visual C++ 5.0 or better.

Basic features of the generated Apps:
* Command line parsing.
* Log file (optional debug tracing).
* Persistent variable storage in the Windows
registry.
* (Optional) Splash screen.
* Error trapping & reporting.
* Multiple document types (in addition to the
basic doc type, can edit .log, .txt, and .py
files).
* Manage startup state (minimized, maximized,
etc.) from the state the app was last quit in.
* Resource DLL for GUI components.
* Accepts "Dropped" files.
* "About" dialog reports loaded module versions.
* "Observer/View" event notification.
* Support for tabbed dialogs (aka Property
Sheets).
* Central User message notification.
* Incorporates PythonWin's "tools" menu.
* Support for modal and modeless dialogs.
* Cancelable progress dialog.
* Floating toolbar.

You specify the application name, company name,
document descriptor, and file extension, and a
Python based MFC MDI application is generated.


PyScribble

An implementation of the famous MFC tutorial (thru
step 6) is included. The skeleton was generated
using the MFC MDI App Builder.


Cheers,
Roger Burnham
rbur...@cri-inc.com


Mark Hammond

unread,
Mar 7, 1999, 3:00:00 AM3/7/99
to
> Question 1: for build completed application I need to overwrite
> startup.py, intpyapp.py and other framework?

Note absolutely necessary. If you look into the sources, you will see that
startup.py is the code that actually loads intpyapp.py. You can override
this by specifying "pythonwin.exe /app yourapp", and yourapp.py will be used
instead of intpyapp.py Alternatively, you can hack the _compiled_
Pythonwin.exe to change the behaviour.

> Question 2: win32ui has some resources (Toolbars, Menus, String
> tables, and so other). How to use customize dll with resources?
> I know how to create *.pyd with module-initialization code (or just
> win32-dll) and resources, but how to load these resources from my
> application? For example, some help page:

To do this, you simply use the code:
dll = win32ui.LoadLibrary(dllname)
win32ui.AttachToMFC(dll)

From that point on, all resources in the DLL can be loaded as if they are in
Pythonwin itself - ie, you simply pass the ID of a resource in your DLL, and
it will magically be located. It is important that your IDs dont conflict
with the builtin ones.

Hope this helps...

Mark.

Roger Burnham

unread,
Mar 8, 1999, 3:00:00 AM3/8/99
to

PythonWin MFC MDI App Builder is now available on starship:

http://starship.python.net/crew/roger/

Roger Burnham
rbur...@cri-inc.com


0 new messages