Visual Basic program using .Graphics.DrawString not working

Questions about Wine on Linux
Post Reply
fargodwe
Level 4
Level 4
Posts: 179
Joined: Mon Oct 02, 2017 7:08 am

Visual Basic program using .Graphics.DrawString not working

Post by fargodwe » Tue Jun 30, 2020 3:12 am

I recently had to reinstall linux since my old Linux Mint 19.3 installation stopped working. I went ahead and installed Linux Mint 20 64-bit and reinstalled wine using the ubuntu focal repository. I have 2 other wine prefixes, 1 64-bit and 1 32-bit, that are running commercial Windows software fine. I wrote a program using Visual Basic from 2008 and last year got a LOT of help from people online to get it to print bingo cards using .Graphics.DrawRectangle and .Graphics.DrawString. The .Graphics.DrawRectangle seems to work but the .Graphics.Drawstring is not in wine. I created a 32-bit prefix, installed dotnet 3 (and later dotnet 6) and vbrun6 (I don't know if i needed that or not). I don't have an installation program for my program - I just copy everything the program needs to a folder and then run the .exe (same as I have to do in Windows). All the regular things the program is supposed to do it does just the same in wine - so far it's the .Graphics.DrawString that isn't working. I know there were messages that came up when using winetricks to install the dotnet "packages" about not everything would work so perhaps this is one of those.

Any input would be greatly appreciated.

fargodwe
Level 4
Level 4
Posts: 179
Joined: Mon Oct 02, 2017 7:08 am

Re: Visual Basic program using .Graphics.DrawString not working

Post by fargodwe » Wed Jul 01, 2020 1:32 am

I guess I forgot to put in some pertinent information again, so here it is:

- Linux Mint 20 64-bit from beta release but has had several updates via update manager
- wine installed using the STAGING branch of ubuntu focal
- the wine prefix was created as a 32-bit prefix because when attempting to load one of the items - I think vbrun6 - it said it needed a 32-bit prefix, not 64-bit.

- the program is one I wrote to be used by a Bingo caller. I added a form that allows printing of Bingo cards. It uses .graphics.drawrectangle to create the Bingo grid and .graphics.drawstring to "write" the letters B I N G O and the random numbers in the grid. .graphics.drawrectandle works.

jkfloris
Level 7
Level 7
Posts: 993
Joined: Thu Aug 14, 2014 10:10 am

Re: Visual Basic program using .Graphics.DrawString not working

Post by jkfloris » Wed Jul 01, 2020 10:03 am

Can I download your self-written program somewhere so that I can test it for you?

fargodwe
Level 4
Level 4
Posts: 179
Joined: Mon Oct 02, 2017 7:08 am

Re: Visual Basic program using .Graphics.DrawString not working

Post by fargodwe » Wed Jul 01, 2020 9:45 pm

I don't really know how to do anything like that as I've never done it before. If you could guide me through what would work I'd be happy to. Would you want just the exe?

jkfloris
Level 7
Level 7
Posts: 993
Joined: Thu Aug 14, 2014 10:10 am

Re: Visual Basic program using .Graphics.DrawString not working

Post by jkfloris » Thu Jul 02, 2020 9:20 am

I just copy everything the program needs to a folder and then run the .exe
Are these special files or the normal visual basic DLLs?
Would you want just the exe?
If the file is not too big you can probably add it as an attachment.
(maybe you have to rename the .exe extension)

fargodwe
Level 4
Level 4
Posts: 179
Joined: Mon Oct 02, 2017 7:08 am

Re: Visual Basic program using .Graphics.DrawString not working

Post by fargodwe » Fri Jul 03, 2020 5:13 am

Outside of my exe the only things it uses it .net and the vb runtime as far as I know. It's been a while since I looked at what it actually uses. I myself didn't specifically add any .dll's, etc,

It does use a lot of text and jpg files I created. Just from the stupid way I did the programming it does require being in c:\Program Files (x86). It would be best if I could find some way to get you the entire folder you just put there as it requires so much of what I did. You would also have access to the source code as well.

I'll check and see if there is a free cloud backup I can use that I can also set to give you access.

fargodwe
Level 4
Level 4
Posts: 179
Joined: Mon Oct 02, 2017 7:08 am

Re: Visual Basic program using .Graphics.DrawString not working

Post by fargodwe » Fri Jul 03, 2020 5:52 am

I moved the folder to dropbox but I don't know how to private message so I can send you a link. Be forwarned - it will be the worst programming you have probably looked at. I orginally started with something simple then kept adding/changing things so some things are REALLY a mess. I'm just a novice so it will show!

jkfloris
Level 7
Level 7
Posts: 993
Joined: Thu Aug 14, 2014 10:10 am

Re: Visual Basic program using .Graphics.DrawString not working

Post by jkfloris » Tue Jul 07, 2020 9:21 am

Don't worry about the code. If it works under Windows, it should also work in Wine.
As far as I can tell your Bingo program works in a clean wineprefix with the winetricks dotnet35 and gdiplus.

fargodwe
Level 4
Level 4
Posts: 179
Joined: Mon Oct 02, 2017 7:08 am

Re: Visual Basic program using .Graphics.DrawString not working

Post by fargodwe » Tue Jul 07, 2020 2:17 pm

Thank you! I didn't know I also needed gdiplus. I added that and it works great! BTW - can you tell me how you knew it needed gdiplus? I look at all those things in Winetricks but don't know what most of them are for - gdiplus was one as the description itself doesn't mention graphics. Thanks again!

jkfloris
Level 7
Level 7
Posts: 993
Joined: Thu Aug 14, 2014 10:10 am

Re: Visual Basic program using .Graphics.DrawString not working

Post by jkfloris » Tue Jul 07, 2020 3:19 pm

BTW - can you tell me how you knew it needed gdiplus?
After clicking the Print Preview button, the follow line is printed on the terminal:

Code: Select all

078c:err:gdiplus:alpha_blend_pixels_hrgn This should not be used for metafiles; fix caller

fargodwe
Level 4
Level 4
Posts: 179
Joined: Mon Oct 02, 2017 7:08 am

Re: Visual Basic program using .Graphics.DrawString not working

Post by fargodwe » Wed Jul 08, 2020 12:38 am

I sure missed that! Thank you so much!!

Post Reply