Solved

ICONWRKS under VB4

Posted on 1997-04-29
9
223 Views
Last Modified: 2006-11-17

(also posted to comp.lang.basic.visual.misc)

I'm having trouble getting ICONWRKS to work properly under VB4.0 (16-bit) either with Win3.1 or Win95.  I know that VB 4.0 has some advanced graphics capabilities over VB 3.0 (which is where ICONWRKS came from) but I'm using ICONWRKS to understand API programming as described in Appleman's "Visual Basic Programmer's Guide to the Windows 3.1 API.

A friend of mine still has VB3.0 and ICONWRKS works fine both under Win3.1 and Win95.

I've noticed that after fixing a few initial VB3.0 -to- VB4.0 style bugs
that the programs runs enough to allow me to edit in the pic_edit
picture box (that's the one the user sees) but when the pic_edit_mouse_up event occurs, the copy of the current icon over in the status area doesn't update.  This copy of the icon is what gets saved to a file using the SavePicture statement.  My problem is that none of my edits make it to the file (whatever.ICO)

I've traced through the program after pic_edit_mouse_up and have come to a critical point with the update_icon subroutine. First I noticed that the source code used integers for the GetBitmapBits
function return when the (Win 3.1) API calls for long.  Also they pass numeric constants without enforcing integer vs. long but I guess VB takes care of that.

They copy bits from the pic_image and pic_mask to pic_icons(currentIcon) by BitBlt-ing the monochrome mask bits through a compatible memory device context (monohdc) and GetBitmapBits & GlobalLock to copy them to pic_icon(currentIcon).picture_base_address+12.  The image bits are copied by GetBitmapBits from pic_image.image to
pic_icons(currentIcon).picture + 12 + 128.  Then they force a paint event on pic_icons(currentIcon).  This all works under 3.0 (even with improper API function return types) but not for my case.

Since the problem moves with VB version and is independent of Win3.1 vs. Win95 could there have been a change in internal graphics controls' memory layout from 3.0 to 4.0?  Is the internal structure of .picture and .image detailed anywhere?

Did I miss a release notes file?  Should I be taking a different diagnosis track?

I have pro edition.  I have not looked into the CDK.

Thanks for any and all help,

--
Jeff Cooper
Digital Equipment Corp
Networks Engineering
Jeff.Cooper@xsw.lkg.dec.com
0
Comment
Question by:coop050498
9 Comments
 

Expert Comment

by:franswen
Comment Utility
This is not much of a solution, only a gesture and comforting. I'm stuck with exactly the same problem, started with trying Iconworks to work in VB4.
As far as I dug in it is a matter of changing one or to DLL's.
It is the GetBitmapBits or GlobalLock where the original code tumbles and puts the machine into a Sodom and Gamorra like still.
I think you can erase the 200 points upto 1000, because to my opinion nobody seems to know.
0
 

Author Comment

by:coop050498
Comment Utility
Edited text of question
0
 

Author Comment

by:coop050498
Comment Utility
Adjusted points to 295
0
 
LVL 3

Expert Comment

by:mheacock
Comment Utility
IconWrks was originally designed for VB 3.0...was it not?

It is reasonable to assume that it might now be compatible with
VB 4.0.  I know that Micrsoft changed its Variant record type
dramtically between the releases, therefore DLLs that relied on
the old format no longer work with the new format.  It is
reasonable to expect that MS made other substantial changes.
And like MS, they don't publicize these changes too loudly...
you're forced to find them out the hard way, then search for
the docs later.

I'd e-mail the makers of IconWrks and see what kind of solutions
they have for you and see if they have a VB 4.0 compatible
version you can get a hold of.

0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:coop050498
Comment Utility
I don't believe variant datatypes are involved.
0
 

Author Comment

by:coop050498
Comment Utility
Adjusted points to 355
0
 
LVL 5

Accepted Solution

by:
y96andha earned 350 total points
Comment Utility
I think that the problem has to do with string format changed between VB4 and VB3. Strings stored in memory occupy two bytes per character in VB4 whereas they occupied one byte in VB3. Try changing string declarations in the structures to byte declarations.
0
 

Author Comment

by:coop050498
Comment Utility
I DO NOT ACCEPT THIS ANSWER.  Seems to me nobody who really understands VB beyond a surface level is attempting to answer this question.  I'm not getting a chance to grade this answer but I grade it an F.

0
 
LVL 5

Expert Comment

by:y96andha
Comment Utility
Sorry to hear that. I just saw your question and got to think about my trouble declaring structures for API calls until I noticed that.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now