G'day All,

I am trying to call a property-sheet/wizard as a DLL from my "main" application.

I've build the property-sheet as a stand-alone EXE no problem, based on KetilO's WizDemo (http://radasm.visualassembler.com/projects/projects.html).

I can build the property-sheet as a DLL/Lib OK, And I can load the property-sheet DLL in my "main" application, and call a test method in the property-sheet DLL, so I think I've got the DLL loading OK.

The problem is that the actual property-sheet is not being displayed, even
though I can verify that the property-sheet function "WizShow" is being called.

Does anyone know what I am doing wrong, and how to fix it.

The property-sheet project and the main calling application are here:
http://phpmvc.net/asm/property-sheet-as-dll.zip ( 34,750 Bytes)


Here's a cut-down version of my property-sheet DLL/EXE application.



; PropTest.Asm

.386
.model flat, stdcall ;32 bit memory model
option casemap :none ;case sensitive

include PropTest.inc

; Select the exe/dll here.
; Uncomment for dll version or comment out for exe version
DLL equ <anytext>

.code

IFDEF DLL
PropTestDllEntry proc hInst:HINSTANCE, reason:DWORD, reserved1:DWORD
.if reason==DLL_PROCESS_ATTACH
invoke GetModuleHandle,NULL ; use the calling application's instance handle
mov hInstance, eax
; ...
.elseif reason==DLL_PROCESS_DETACH
; ...
.endif
mov eax, TRUE
ret
PropTestDllEntry Endp
ELSE
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke InitCommonControls
invoke WizShow
invoke ExitProcess,0
ENDIF


MessageBoxSTD proc STDCALL hParent:DWORD,lpMsg:DWORD,
lpTitle:DWORD,dlgStyle:DWORD,iconID:DWORD
--- cut ---
ret
MessageBoxSTD endp


WizShow proc
LOCAL PropSheet[3]:PROPSHEETPAGE
LOCAL PropHdr:PROPSHEETHEADER

; --------------------------------------------------------------- ;
invoke MessageBoxSTD, 0, addr szMessageBoxTxt, addr szMessageBoxTxt, MB_OK, 1
; --------------------------------------------------------------- ;

;Set up the 1st property sheet
--- cut ---
; As per KetilO's WizDemo
--- cut ---
; Display the property sheet control
invoke PropertySheet,addr PropHdr
ret

WizShow endp

WizDialog1 proc hWin:HWND,uMsg:DWORD,wParam:WPARAM,lParam:LPARAM
;This dialog processes property page 1
--- cut ---
; As per KetilO's WizDemo
WizDialog1 endp

WizDialog2 proc hWin:HWND,uMsg:DWORD,wParam:WPARAM,lParam:LPARAM
; This dialog processes property page 2
--- cut ---
; As per KetilO's WizDemo
WizDialog2 endp

WizDialog3 proc hWin:DWORD,uMsg:DWORD,wParam:WPARAM,lParam:LPARAM
; This dialog processes property page 3
--- cut ---
; As per KetilO's WizDemo
WizDialog3 endp


;end start
IFDEF DLL
include EndDLL.Asm
ELSE
include EndStart.Asm
ENDIF



Thanks
Dorf

And thanks to the Win32ASM Community Forum admins for reserecting the board. It was quite a shock to see the site all gorn !!!
Posted on 2004-11-28 23:43:50 by dorf
G'day All,

This is how I have implemented using a property-sheet/wizard as a DLL
module.

Perhaps this may be of use to someone, perhaps not :)

The property-sheet project and the main calling application can be downloaded
here:
http://phpmvc.net/asm/property-sheet-as-dll.zip ( 48,814 Bytes)


The property-sheet module (DLL/lib) resources must be compiled and linked
into the main application. The property-sheet module resources are included
using the MainAppFrame.RcDLL file:
#include "..\PropTest\Res\Wiz1Dlg.rc"
#include "..\PropTest\Res\Wiz2Dlg.rc"
#include "..\PropTest\Res\Wiz3Dlg.rc"
#include "..\PropTest\Res\PropTestRes.rc"


My example uses two projects: the property-sheet module and the main
application that uses the property-sheet module.

The property-sheet module:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This project creates a property sheet (wizard) application.
The project can be built to run stand-alone (as an EXE),
or built as a module (DLL/lib) to be used by another application.

Build as an EXE:
1) Comment out the "DLL equ <anytext>" definition below
2) Assemble and build as a regular RadASM project

Build as an DLL/lib module:
1) Un-comment the "DLL equ <anytext>" definition below
2) Assemble and build using the make-dll.bat file included


The main application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This project creates a main window frame that can load a property-
sheet module as a DLL.

Build without the property-sheet module:
1) Comment out the "DLL equ <anytext>" definition below
2) Assemble and build as a regular RadASM project

Build with the property-sheet module (DLL/lib):
1) Un-comment the "DLL equ <anytext>" definition below
2) Assemble and build using the make-wiz.bat file included


Regards
Dorf
Posted on 2004-12-05 22:34:12 by dorf