News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Try an automation masm project

Started by minor28, February 02, 2010, 03:09:58 PM

Previous topic - Next topic

minor28

Some years ago I wrote a comtool as an addin to RadAsm. This tool is now improved (stand alone) with some help from José Roca clearing out some brushy recursive ways in type libraries and a couple of macros with help from qWord and jj2007.

If someone is interessted to try, you are wellcome. The tool is writing settings to registry
HKEY_CURRENT_USER\Software\MINOR28\AutomationEXE.

These files are included.

Tool:      AutomationEXE.exe
Static lib:   Automation.lib
Include file:   Automation.inc
Masm template:   AutomationTPL.tpl

Example project:
TestAutomation100202.zip

hoverlees

Thank you minor28
I am your ComTool User. And I very like your tool.
:U :U :U

Your Automation.lib seems better than my own    :dazzled::lol :lol

minor28

I have digged deeper in the com mystery. Here is a new version of the stand alone app and a RadAsm addin (ver 0.0.4.0).

It is a type library browser and a tool for masm coding. Still working on it. I have also written a static lib for string functions.

Description of static libs are found here

These files are included.

Tool:     
AutomationEXE.exe (stand alone)
Automation.dll (addin)

Olefunctions:
static lib:   Automation.lib
Include file:   Automation.inc

String functions:
static lib:   StringFunctions.lib
Include file:   StringFunctions.inc

If anybody writes com applications I would appreciate some feed back. :toothy

Best regards

japheth


> if anybody writes com applications I would appreciate some feed back. tgrin

I don't have RadAsm, but I tried the stand-alone version AutomationEXE.exe. It starts and keeps running, but shows no window or any kind of user interface. Since there's no documentation at all, I have to ask myself if this effect is intentional. The  :toothy smiley might indicate that it's just meant as a joke?


minor28

Sorry for the  :toothy. It is no joke.

I have only tested on xp. In attached bmp the user interface is shown.

Slugsnack

it looks like you are using dialogs. i once experienced a similar issue, try calling InitCommonControlsEx()

minor28

OK, I changed to InitCommonControlsEx. For me, no difference. And also from debug to release.

Here is the code:

.686

.model flat,stdcall
option casemap:none

include Automation.inc

.const
include OleConstants.inc
include Constants.inc
include AboutDlgConst.inc

.data
include OleInitData.inc
include InitiatedData.inc
include AboutDlgData.inc

.data?
pCommandline dd ?
pNumArgs dd ?

include UninitiatedData.inc

.code

include AsmIncludes.inc

start:

invoke GetModuleHandle,NULL
mov hInstance,eax

invoke GetCommandLineW
mov pCommandline,eax
invoke CommandLineToArgvW,pCommandline,offset pNumArgs
mov edi,eax
mov eax,0
.if pNumArgs==2
invoke lstrlenW,edi
inc eax
shl eax,1
add edi,eax
invoke lstrlenW,edi
shl eax,1
.if eax==2
movzx eax,byte ptr [edi]
sub eax,30h
.if eax<0 || eax>4
mov eax,0
.endif
.elseif eax==4
movzx eax,byte ptr [edi]
sub eax,30h
xor edx,edx
mov ecx,10
mul ecx
movzx ecx,byte ptr [edi+2]
sub ecx,30h
add eax,ecx
.if eax<40 || eax>48
mov eax,0
.endif
.endif
.endif
push eax

;    invoke InitCommonControlsEx
    mov icc.dwSize,sizeof icc
    mov icc.dwICC,ICC_USEREX_CLASSES or ICC_TREEVIEW_CLASSES or ICC_TAB_CLASSES or \
    ICC_STANDARD_CLASSES or ICC_LISTVIEW_CLASSES or ICC_BAR_CLASSES
    invoke InitCommonControlsEx,offset icc
   
invoke LoadLibrary,addr szRichEditDLL
mov hRichEdit,eax

invoke GetThreadLocale
mov lcid,eax

pop eax
invoke DialogBoxParam,hInstance,IDD_MAINDLG,NULL,offset MainDlgProc,eax

invoke FreeLibrary,hRichEdit

invoke ExitProcess,0

end start

Slugsnack

where is your MainDlgProc. i'm surprised that even assembles

minor28

Quote
where is your MainDlgProc. i'm surprised that even assembles

Why are you suprised. No problem for me to make an exe.

The MainDlgProc is in an asm-file which is listed in the file AsmIncludes.inc with appr 60 other files

minor28

japheth,

Quote
It starts and keeps running, but shows no window or any kind of user interface.

When the app is closed some data are saved to registry as mentioned in the first post. I deleted this data. The only thing was window color turned out to be black but the app started. I have fixed this now.

I have also tested the app on a clean XP machine and on a Visata machine. No problems. I cannot understand why it is not working for you.

Has someone else tryed AutomationEXE.exe? I do want to solve this.

japheth

Quote from: minor28 on March 10, 2010, 08:17:36 AM
I have also tested the app on a clean XP machine and on a Visata machine. No problems. I cannot understand why it is not working for you.

I tried it on another instance of Windows XP and it does work there. Hence it is a problem of one specific configuration only. So no real problem, thanks for your efforts!

Ghandi

It runs fine on my box, XP Pro - SP3 with any/all updates as offered. Possibly the problem could be identified by debugging the application on a 'problem' box?

HR,
Ghandi

ecube

This is interesting, thanks for all the nice work. Your sites documentation sections isn't working, also can you give more info on how this works, I get it lets you explore activex controls and such, but does it generate code to make using them easier? also do you ever plan on releasing code for this?

minor28

Quote
...can you give more info on how this works.

I am working with the app and the documentation.

With the tool you generate code to use with the static library Automation.lib. It contains the ole functions. You find a template, example project and libs in first post.

Short info.

Tab "TypeLibraries":
Choose which typelibs you want to work with.

Tab "CoClasses":
Choose for which CoClass you want to create an instance. Masm code in the text area beneath the listview.

You can get code for creating a new instance or getting a running one with the buttons. Select text to copy with one of the copy buttons.

Tab "CoClass methods":
In combobox choose implemented interface. A list of interface methods in listview.

A click on an item in 6 column gives more information.

"Get Masm code" button open a new dialog to generate masm code.

Tab "Make TypeLib"
Not readt for use. I intend to use it for creation and compiling idl-files mostly to make it easier to use assembler dlls with visual basic.

File menu:
Open a typelib from the openfile dialog. Close typelib only returns, not unregister.  Save all selection is not implemented yet.

Register Module menu:
Register or unregister typelib.

Option menu:
Background color of controls.

Tool menu:
Generat an uuid.

Help menu:
Open helpfile refer to typelib helpfile. Not app helpfile.

An updated StringFunctions.lib is attached