Author Topic: How do I convert a masm32 windows application to masm64  (Read 2254 times)

JLC

  • Regular Member
  • *
  • Posts: 5
How do I convert a masm32 windows application to masm64
« on: August 24, 2017, 04:39:45 AM »
I have a program I wrote a long long time ago in Masm32. I still use it but it does not run well in Windows 10. Mainly fonts and windows do not enlarge and I am getting old and loosing my reading eyesight. I want to re-write it but would not want to start from scratch.

What are the main changes that I would have to do for this update?

I have not programmed in masm for many years now but really need this program to work for me.

Any suggestions appreciated.
Not srre if this is the proper place for this type of question. Sorry if i mis-posted.

John

jj2007

  • Member
  • *****
  • Posts: 8773
  • Assembler is fun ;-)
    • MasmBasic
Re: How do I convert a masm32 windows application to masm64
« Reply #1 on: August 24, 2017, 05:06:30 AM »
Hi John,

Before taking important decisions, you should try, perhaps with help from members here, to fix the problems of your current Masm32 application. 64-bit code has its advantages, but in specialised areas: The speed gain is very limited, often there is no gain at all. You can address more that 2 Gigabytes - that is important for some top range graphics applications, but is it important for you?

Going from 16-bit to 32-bit was a giant jump. Remember that strange 640k limit? Selectors and all that bs? There is no similar gain from going from 32-bit to 64-bit code, and the learning curve is relatively steep.

Therefore I would suggest that you explain a bit more why "fonts and windows do not enlarge". The fix might be very simple indeed. Btw several members here, including me, have similar eyesight problems, so you are in good company.

Welcome to the forum :icon14:

Jochen

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5851
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: How do I convert a masm32 windows application to masm64
« Reply #2 on: August 24, 2017, 06:40:49 PM »
John,

JJ is right here, unless you have very good reason to rewrite the application from scratch in 64 bit you are far better to tweak your existing application to solve the problems you have mentioned. If you can give us some idea of what you need to do, it may just be a few simple tweaks to get it to work thew way you want.

Depending on how you created the fonts you have used, its not a big deal to use true type fonts and just change the size so they are easier to read. Tell us a bit more about what you need to do and we may be able to help you.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

JLC

  • Regular Member
  • *
  • Posts: 5
Re: How do I convert a masm32 windows application to masm64
« Reply #3 on: August 25, 2017, 07:46:45 AM »
You guys are right about the time it would take to re-write. I was not thinking clearly although I would like to learn more about 64 but now is not the time. What I need to do is just change a couple of the windows properties. If I was using visual studio C#, C++ or visual Basic I would just click on the properties tab and re set. The area that I need to correct is in a listveiw window. I should just sit down and look up the structure but I will take any advice to get me in the right direction with the minimum time.

The other item I would like to repair is the ability to resize using the touchscreen. I wrote this in the late 1990's and the files and I think I had win 3.1. This worked good on all versions of windows until Win7.

I know this is more windows programming questions then Masm and appreciate the time you have given to respond.

I know I could re-write this in Visual Basic or C++ but again there is a lot to re-do and I do not have the time. I currently am doing residential construction and Home inspections. This program is my Inspection software. I also am a contractor for FEMA and just received a call that put me on stand-by for the possible flooding in Texas.

I appreciate any help.


jj2007

  • Member
  • *****
  • Posts: 8773
  • Assembler is fun ;-)
    • MasmBasic
Re: How do I convert a masm32 windows application to masm64
« Reply #4 on: August 25, 2017, 10:18:44 AM »
> This program is my Inspection software

John,
We all understand that you won't show us sensitive code, but we need some beef to put our teeth into.
How big is that application (#lines)? Can you hide away the proprietary stuff and just fill the listview with dummy items?
You can zip up the source and attach it here, limit is 512kBytes.
How did you create the fonts?
...

FORTRANS

  • Member
  • *****
  • Posts: 1025
Re: How do I convert a masm32 windows application to masm64
« Reply #5 on: August 25, 2017, 11:50:16 PM »
Hi,

I wrote this in the late 1990's and the files and I think I had win 3.1. This worked good on all versions of windows until Win7.

   Probably a stop gap measure until you have time to fix things
properly, but you could run the program under VitualPC or DOSBOX.
That can give you a more compatible environment if the Windows 7
problems are minor.

Regards,

Steve N.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5851
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: How do I convert a masm32 windows application to masm64
« Reply #6 on: August 26, 2017, 01:51:10 AM »
If it is what I think it is from what John has said, its a 16 bit Windows app and it will not run on Win7 or later. If its an important app, set up a machine with nothing later than XP and use it where it is properly supported. Put it on a laptop or similar and use it as before until you have enough inspiration to do it in 32 or 64 bit.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

AW

  • Member
  • *****
  • Posts: 1519
  • Let's Make ASM Great Again!
Re: How do I convert a masm32 windows application to masm64
« Reply #7 on: August 26, 2017, 02:55:53 PM »
Mainly fonts and windows do not enlarge

Unlike your alias which does not shrink. :bgrin:

sinsi

  • Member
  • *****
  • Posts: 1072
Re: How do I convert a masm32 windows application to masm64
« Reply #8 on: August 26, 2017, 04:19:38 PM »
Old 16-bit windows programs will still run on Windows 32-bit because NTVDM can be enabled.
I can walk on water but stagger on beer.

JLC

  • Regular Member
  • *
  • Posts: 5
Re: How do I convert a masm32 windows application to masm64
« Reply #9 on: August 12, 2018, 03:31:37 AM »
Well it's been a year since I posted. Sorry about that, I did end up working Hurricane Harvey for 3 1/2 months and this went on the back burner. Thank you everyone for replying. Here is what I did for a work around.
In my rsrc.rc file I changed font and size of all my dialogs.

RENT DIALOG 0, 0, 120, 105   ;10, 160, 113
STYLE 0x0004  | WS_CAPTION |WS_SYSMENU | WS_VISIBLE | WS_OVERLAPPED | DS_MODALFRAME | DS_3DLOOK
FONT 14, "Times New Roman"
CAPTION "Check or Comment"
BEGIN

Which was an easy fix for most of the program. I thought of this while working Harvey. I change the main window to open full screen and I still have one issue left. My listview window which is the main window of the the lists(items) of the inspections still uses the windows assigned font. My work around for this is to use a much lower display the default for my tablet is 1920 x 1080 and I set it to 1280 x 720 to get a text my eyes can read.

Here is my code
; ########################################################################

ListView proc a:DWORD,b:DWORD,wd:DWORD,ht:DWORD,hParent:DWORD,ID:DWORD
LOCAL   crect:RECT

        invoke  InitCommonControls
        invoke  GetClientRect, hParent, addr crect
        mov ecx,crect.right
        sub ecx, crect.left
        mov eax, crect.bottom
        sub eax, crect.top

      INVOKE     CreateWindowEx, WS_EX_CLIENTEDGE, addr ListViewClass, NULL,
                 WS_CHILD or WS_VISIBLE or LVS_REPORT or LVS_EX_CHECKBOXES,
                  a, b, ecx, eax,                   
                 hParent,ID,hInstance,NULL     
       
    ret

ListView endp

invoke ListView,0,34,CW_USEDEFAULT,CW_USEDEFAULT,hWin,500
       mov hList1, eax

What is a simple way to change font size for this listview?

Again Thank you for your help.

fearless

  • Member
  • ***
  • Posts: 361
    • LetTheLightIn
Re: How do I convert a masm32 windows application to masm64
« Reply #10 on: August 12, 2018, 08:44:02 AM »
If the listview is included as a resource on your dialog it will use the same font size as the dialog.

If the listview is being created programmatically, then you can create a font and assign it to the listview:

Code: [Select]
.data
szFontTimes             DB 'Times New Roman',0

.data?
hLVFont                 DD ?
hList1                  DD ?

.code
Invoke CreateFont, -24, 0,0,0, FW_NORMAL, FALSE, FALSE,0,0,0,0, PROOF_QUALITY, FF_DONTCARE, Addr szFontTimes ; adjust the first param for size of font
mov hLVFont, eax
Invoke SendMessage, hList1, WM_SETFONT, hLVFont, TRUE
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI

www.LetTheLight.in  My Github  Twitter

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5851
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: How do I convert a masm32 windows application to masm64
« Reply #11 on: August 12, 2018, 08:58:25 AM »
John,

We need a favour from you, would you go to the settings for your account and shorten the name you use so it does not run across into the headings in the forum software.

Shorten it to "JohnCharzynski" would work fine. If you are not sure how to do that I will do it for you if you let me know.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

JLC

  • Regular Member
  • *
  • Posts: 5
Re: How do I convert a masm32 windows application to masm64
« Reply #12 on: August 12, 2018, 01:09:58 PM »
Thank you for your replies. (I did change username. Sorry about that)
My include directories lacks the wingdi.inc .h, and .lib files that CreateFont exist in if I am reading the Microsoft documentation correctly. Where can I find them to download?

I have thought of re-writing so that the listview is in a dialog as I have done this before. but would rather try the createfont method that I have not used and like to try new things.

I appreciate all of your help.

JLC

  • Regular Member
  • *
  • Posts: 5
Re: How do I convert a masm32 windows application to masm64
« Reply #13 on: August 16, 2018, 08:01:07 AM »
Never mind. I found the gdi32.inc file and now I am all set. I tried the createfont method last year and ran into errors and never followed through to correct. I wish I would have as it would have prevented a lot of frustration trying to get the look I needed with the application. Getting old and blind.

Thanks again.