473,385 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Loading 16 bits dll (ICL icon library file)

Hi,

I'm creating a free Icon library in C# with source code include, it already
support .ico/.dll../exe and I'd like to support .ICL format too, I need to
load a file .ICL (Icon Library) that basically it is a 16-bit dll and then
after that I can extracts and insert icons inside.

I tried the only function in Win32API left for 16bit (LoadModule), it loads
the library but Windows starts to give strange message boxes, as "Not enough
memory to run 16-bit applications" or things like that.

So, do you know a way to load 16bit dll (New Executable format) in Win32? Or
how to read/write .ICL files?
Any kind of information RFC/Articles/News everything related to ICL file can
be useful and will be apreciated.

Thanks a lot.
Gustavo.



Oct 14 '06 #1
14 5193
You know, I was under the impression that Win32 apps could load 16bit
resource dlls by calling LoadLibraryEx with the LOAD_LIBRARY_AS_DATAFILE
flag.

"MsNews" <so*****@hotmail.comwrote in message
news:uw****************@TK2MSFTNGP02.phx.gbl...
Hi,

I'm creating a free Icon library in C# with source code include, it
already
support .ico/.dll../exe and I'd like to support .ICL format too, I need to
load a file .ICL (Icon Library) that basically it is a 16-bit dll and then
after that I can extracts and insert icons inside.

I tried the only function in Win32API left for 16bit (LoadModule), it
loads
the library but Windows starts to give strange message boxes, as "Not
enough
memory to run 16-bit applications" or things like that.

So, do you know a way to load 16bit dll (New Executable format) in Win32?
Or
how to read/write .ICL files?
Any kind of information RFC/Articles/News everything related to ICL file
can
be useful and will be apreciated.

Thanks a lot.
Gustavo.



Oct 16 '06 #2
When I tried that, the library (ICL) did not load and it gives, the
following error on GetLastError();

193 - ERROR_BAD_EXE_FORMAT (Is not a valid application.)

Then to make sure was not because of the ICL, I uncompress a Win3.1
installation and I tried to load some dlls as PBRUSH.DLL and I got the same
result.

So, I don't know what else to use to load this kind of resources.

Gustavo.
"Chris Becke" <ch*********@gmail.comwrote in message
news:uM**************@TK2MSFTNGP02.phx.gbl...
You know, I was under the impression that Win32 apps could load 16bit
resource dlls by calling LoadLibraryEx with the LOAD_LIBRARY_AS_DATAFILE
flag.

"MsNews" <so*****@hotmail.comwrote in message
news:uw****************@TK2MSFTNGP02.phx.gbl...
>Hi,

I'm creating a free Icon library in C# with source code include, it
already
>support .ico/.dll../exe and I'd like to support .ICL format too, I need
to
load a file .ICL (Icon Library) that basically it is a 16-bit dll and
then
after that I can extracts and insert icons inside.

I tried the only function in Win32API left for 16bit (LoadModule), it
loads
>the library but Windows starts to give strange message boxes, as "Not
enough
>memory to run 16-bit applications" or things like that.

So, do you know a way to load 16bit dll (New Executable format) in Win32?
Or
>how to read/write .ICL files?
Any kind of information RFC/Articles/News everything related to ICL file
can
>be useful and will be apreciated.

Thanks a lot.
Gustavo.




Oct 16 '06 #3
"news.microsoft.com" <gustavo_[remove]fr****@hotmail.comwrote:
>When I tried that, the library (ICL) did not load and it gives, the
following error on GetLastError();

193 - ERROR_BAD_EXE_FORMAT (Is not a valid application.)

Then to make sure was not because of the ICL, I uncompress a Win3.1
installation and I tried to load some dlls as PBRUSH.DLL and I got the same
result.

So, I don't know what else to use to load this kind of resources.
The NE file format is not really very complicated. Just open the file
using the standard file APIs and read it yourself. There must still be a
bunch of NE resources on the web.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 18 '06 #4
I was reading this excellent article about NE

http://support.microsoft.com/default...b;EN-US;q65122

Doesn't look too complicate, the problem is if I open and process the file I
won't get a valid Windows Handle, and will not be able to use the APIs like

LoadResource, FindResource, BeginUpdateResource, LoadIcon, etc.

I was reading that those APIs works under 32 and 16 bits, the problem is how
to get a handle to the module.

If I don't load the NE in the way Windows does, then I will have to
implement all those APIs myself, that means also I have to know and parse
the Resources format too inside the NE.

If I can get a 16bits load in memory as a DataFile and get a HMODULE handle
to it, the rest should be piece of cake using standards Windows APIs

Gustavo.

"Tim Roberts" <ti**@probo.comwrote in message
news:7v********************************@4ax.com...
"news.microsoft.com" <gustavo_[remove]fr****@hotmail.comwrote:
>>When I tried that, the library (ICL) did not load and it gives, the
following error on GetLastError();

193 - ERROR_BAD_EXE_FORMAT (Is not a valid application.)

Then to make sure was not because of the ICL, I uncompress a Win3.1
installation and I tried to load some dlls as PBRUSH.DLL and I got the
same
result.

So, I don't know what else to use to load this kind of resources.

The NE file format is not really very complicated. Just open the file
using the standard file APIs and read it yourself. There must still be a
bunch of NE resources on the web.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.

Oct 18 '06 #5

"news.microsoft.com" <gustavo_[remove]fr****@hotmail.comwrote in message
news:e%***************@TK2MSFTNGP04.phx.gbl...
>I was reading this excellent article about NE

http://support.microsoft.com/default...b;EN-US;q65122

Doesn't look too complicate, the problem is if I open and process the file
I won't get a valid Windows Handle, and will not be able to use the APIs
like

LoadResource, FindResource, BeginUpdateResource, LoadIcon, etc.
By parsing the file yourself, you would need to write your own LoadResource
function, however after reading the raw data into memory you can still use
for example CreateIconFromResource for all the image manipulation.

All the functions that work on HMODULEs are designed for PE-format
executables.
>
I was reading that those APIs works under 32 and 16 bits, the problem is
how to get a handle to the module.
The file doesn't contain a PE module.
>
If I don't load the NE in the way Windows does, then I will have to
implement all those APIs myself, that means also I have to know and parse
the Resources format too inside the NE.
The way Windows loads 16-bit programs is through wowexec. You can probably
use its APIs. See http://www.microsoft.com/msj/0898/hood0898.aspx
>
If I can get a 16bits load in memory as a DataFile and get a HMODULE
handle to it, the rest should be piece of cake using standards Windows
APIs

Gustavo.

"Tim Roberts" <ti**@probo.comwrote in message
news:7v********************************@4ax.com...
>"news.microsoft.com" <gustavo_[remove]fr****@hotmail.comwrote:
>>>When I tried that, the library (ICL) did not load and it gives, the
following error on GetLastError();

193 - ERROR_BAD_EXE_FORMAT (Is not a valid application.)

Then to make sure was not because of the ICL, I uncompress a Win3.1
installation and I tried to load some dlls as PBRUSH.DLL and I got the
same
result.

So, I don't know what else to use to load this kind of resources.

The NE file format is not really very complicated. Just open the file
using the standard file APIs and read it yourself. There must still be a
bunch of NE resources on the web.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.


Oct 18 '06 #6
Thanks for the info... I keep researching on the article you sent me.

I just wanted to create a .ico file and now I'm swimming in deep waters to
understand MZ files and how to parse obsolete executables....

How I came here :)... the worst think is that the curiosity doesn't let me
go back to the library, I'm not interested in continue or publish it without
first at least know how to parse an ICL file.

Gustavo.

"Ben Voigt" <rb*@nospam.nospamwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>
"news.microsoft.com" <gustavo_[remove]fr****@hotmail.comwrote in message
news:e%***************@TK2MSFTNGP04.phx.gbl...
>>I was reading this excellent article about NE

http://support.microsoft.com/default...b;EN-US;q65122

Doesn't look too complicate, the problem is if I open and process the
file I won't get a valid Windows Handle, and will not be able to use the
APIs like

LoadResource, FindResource, BeginUpdateResource, LoadIcon, etc.

By parsing the file yourself, you would need to write your own
LoadResource function, however after reading the raw data into memory you
can still use for example CreateIconFromResource for all the image
manipulation.

All the functions that work on HMODULEs are designed for PE-format
executables.
>>
I was reading that those APIs works under 32 and 16 bits, the problem is
how to get a handle to the module.

The file doesn't contain a PE module.
>>
If I don't load the NE in the way Windows does, then I will have to
implement all those APIs myself, that means also I have to know and parse
the Resources format too inside the NE.

The way Windows loads 16-bit programs is through wowexec. You can
probably use its APIs. See
http://www.microsoft.com/msj/0898/hood0898.aspx
>>
If I can get a 16bits load in memory as a DataFile and get a HMODULE
handle to it, the rest should be piece of cake using standards Windows
APIs

Gustavo.

"Tim Roberts" <ti**@probo.comwrote in message
news:7v********************************@4ax.com.. .
>>"news.microsoft.com" <gustavo_[remove]fr****@hotmail.comwrote:

When I tried that, the library (ICL) did not load and it gives, the
following error on GetLastError();

193 - ERROR_BAD_EXE_FORMAT (Is not a valid application.)

Then to make sure was not because of the ICL, I uncompress a Win3.1
installation and I tried to load some dlls as PBRUSH.DLL and I got the
same
result.

So, I don't know what else to use to load this kind of resources.

The NE file format is not really very complicated. Just open the file
using the standard file APIs and read it yourself. There must still be
a
bunch of NE resources on the web.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.



Oct 18 '06 #7

"news.microsoft.com" <gustavo_[remove]fr****@hotmail.comwrote in message
news:uh**************@TK2MSFTNGP04.phx.gbl...
Thanks for the info... I keep researching on the article you sent me.

I just wanted to create a .ico file
You could just write a 16-bit helper program that opens the dll, extracts
all the icons into standard format .ico files, then use those from your main
program.
Oct 18 '06 #8
Yes, but the idea is to full support ICL files, means read/write 16-bit
dlls. (simple dlls without code/data just resource table)

If I can extract the icons from the ICL is one big step, but still it is not
useful, because provide an application/library to open/read ICL (Icon
libraries) without able to change it, doesn't worth too much.

"Ben Voigt" <rb*@nospam.nospamwrote in message
news:uB**************@TK2MSFTNGP05.phx.gbl...
>
"news.microsoft.com" <gustavo_[remove]fr****@hotmail.comwrote in message
news:uh**************@TK2MSFTNGP04.phx.gbl...
>Thanks for the info... I keep researching on the article you sent me.

I just wanted to create a .ico file

You could just write a 16-bit helper program that opens the dll, extracts
all the icons into standard format .ico files, then use those from your
main program.

Oct 18 '06 #9
Finally I got everything under control and I published the library.

http://www.codeproject.com/useritems/IconLib.asp

Regards,
Gustavo.

"MsNews" <so*****@hotmail.comwrote in message
news:uw****************@TK2MSFTNGP02.phx.gbl...
Hi,

I'm creating a free Icon library in C# with source code include, it
already support .ico/.dll../exe and I'd like to support .ICL format too, I
need to load a file .ICL (Icon Library) that basically it is a 16-bit dll
and then after that I can extracts and insert icons inside.

I tried the only function in Win32API left for 16bit (LoadModule), it
loads the library but Windows starts to give strange message boxes, as
"Not enough memory to run 16-bit applications" or things like that.

So, do you know a way to load 16bit dll (New Executable format) in Win32?
Or how to read/write .ICL files?
Any kind of information RFC/Articles/News everything related to ICL file
can be useful and will be apreciated.

Thanks a lot.
Gustavo.



Nov 1 '06 #10


*** Sent via Developersdex http://www.developersdex.com ***
Nov 15 '06 #11


*** Sent via Developersdex http://www.developersdex.com ***
Nov 15 '06 #12
Hi -

Take a look at:

http://benoit.papillault.free.fr/c/disc2/exefmt.txt
http://www.itee.uq.edu.au/~csmweb/de...n/new_exe.html

They appear to document the MZ/NE executable format.

1. Open a binary file to the executable/dll.
2. Find the NE header by looking at the MZ header.
3. Locate the resource table segment in the NE header.
4. You should then be able to iterate over the resources one by one.

Haven't completed any work like that for a while and certainly not in .NET
but it should be fairly trivial once you get into it.

Looking in the Platform SDK in WINNT.H; if you search for MZ below that it
defines the structures referenced in the above documents.

HTH

- Andy

"MsNews" <so*****@hotmail.comwrote in message
news:uw****************@TK2MSFTNGP02.phx.gbl...
Hi,

I'm creating a free Icon library in C# with source code include, it
already support .ico/.dll../exe and I'd like to support .ICL format too, I
need to load a file .ICL (Icon Library) that basically it is a 16-bit dll
and then after that I can extracts and insert icons inside.

I tried the only function in Win32API left for 16bit (LoadModule), it
loads the library but Windows starts to give strange message boxes, as
"Not enough memory to run 16-bit applications" or things like that.

So, do you know a way to load 16bit dll (New Executable format) in Win32?
Or how to read/write .ICL files?
Any kind of information RFC/Articles/News everything related to ICL file
can be useful and will be apreciated.

Thanks a lot.
Gustavo.



Jan 4 '07 #13
Yep,

Those kind of source is exactly what I used to read/write ICL files.

Take a look at the article I wrote about Icons.

http://www.codeproject.com/useritems/IconLib.asp

Regards,
Gustavo.

"Andy Bates" <an**@ussdev.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Hi -

Take a look at:

http://benoit.papillault.free.fr/c/disc2/exefmt.txt
http://www.itee.uq.edu.au/~csmweb/de...n/new_exe.html

They appear to document the MZ/NE executable format.

1. Open a binary file to the executable/dll.
2. Find the NE header by looking at the MZ header.
3. Locate the resource table segment in the NE header.
4. You should then be able to iterate over the resources one by one.

Haven't completed any work like that for a while and certainly not in .NET
but it should be fairly trivial once you get into it.

Looking in the Platform SDK in WINNT.H; if you search for MZ below that it
defines the structures referenced in the above documents.

HTH

- Andy

"MsNews" <so*****@hotmail.comwrote in message
news:uw****************@TK2MSFTNGP02.phx.gbl...
>Hi,

I'm creating a free Icon library in C# with source code include, it
already support .ico/.dll../exe and I'd like to support .ICL format too,
I need to load a file .ICL (Icon Library) that basically it is a 16-bit
dll and then after that I can extracts and insert icons inside.

I tried the only function in Win32API left for 16bit (LoadModule), it
loads the library but Windows starts to give strange message boxes, as
"Not enough memory to run 16-bit applications" or things like that.

So, do you know a way to load 16bit dll (New Executable format) in Win32?
Or how to read/write .ICL files?
Any kind of information RFC/Articles/News everything related to ICL file
can be useful and will be apreciated.

Thanks a lot.
Gustavo.




Jan 19 '07 #14
Hello Gustavo,

I read your article. Much impressed!

Regards,
Cyril Gupta
- You can do anything with a little bit of 'magination.

- I've been programming so long, my brain is now soft-ware.

MYep,
M>
MThose kind of source is exactly what I used to read/write ICL files.
M>
MTake a look at the article I wrote about Icons.
M>
Mhttp://www.codeproject.com/useritems/IconLib.asp
M>
MRegards,
MGustavo.
M"Andy Bates" <an**@ussdev.comwrote in message
Mnews:%2****************@TK2MSFTNGP04.phx.gbl...
M>
>Hi -

Take a look at:

http://benoit.papillault.free.fr/c/disc2/exefmt.txt
http://www.itee.uq.edu.au/~csmweb/de...n/new_exe.html

They appear to document the MZ/NE executable format.

1. Open a binary file to the executable/dll.
2. Find the NE header by looking at the MZ header.
3. Locate the resource table segment in the NE header.
4. You should then be able to iterate over the resources one by one.
Haven't completed any work like that for a while and certainly not in
.NET but it should be fairly trivial once you get into it.

Looking in the Platform SDK in WINNT.H; if you search for MZ below
that it defines the structures referenced in the above documents.

HTH

- Andy

"MsNews" <so*****@hotmail.comwrote in message
news:uw****************@TK2MSFTNGP02.phx.gbl...
>>Hi,

I'm creating a free Icon library in C# with source code include, it
already support .ico/.dll../exe and I'd like to support .ICL format
too, I need to load a file .ICL (Icon Library) that basically it is
a 16-bit dll and then after that I can extracts and insert icons
inside.

I tried the only function in Win32API left for 16bit (LoadModule),
it loads the library but Windows starts to give strange message
boxes, as "Not enough memory to run 16-bit applications" or things
like that.

So, do you know a way to load 16bit dll (New Executable format) in
Win32?
Or how to read/write .ICL files?
Any kind of information RFC/Articles/News everything related to ICL
file
can be useful and will be apreciated.
Thanks a lot.
Gustavo.

Jan 19 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dayzman | last post by:
Hi, Does anyone know how I can use "icl" (Intel C++) to compile C extensions? I'm on Windows, and my Python is compiled using VS7.1 (binary distribution). Right now, when I run setup.py install,...
4
by: Tim Jarman | last post by:
Apologies in advance for the long post - I wanted to be sure I included all the relevant details. The answer is probably very, very simple. I am doing something stupid here, but I don't know what...
4
by: Carl Scarlett | last post by:
When I display icons in controls from an imagelist, the icons are "corrupted" if they are added from a resource (or a file) but are fine if I add them using the designer at design time. I need to...
1
by: Julien | last post by:
In the registry, the application icon are stored in the format: filename,resource_number I can open the library "filename" using the native API function LoadLibrary, and then enumerate resources...
2
by: Rob | last post by:
I was working on a project and everything was going fine, then all of a sudden the form set as my startup object stopped loading. I tried setting some others as the startup object, and some of my...
0
by: Mythran | last post by:
I wrote some code that is supposed to enumerate through the specified file's win32 resources and return a string-array of all icon names. When it runs, it returns a string-array with a bunch of...
8
by: Frank | last post by:
Given a bitmap I want to write a Icon file using it. I believe I can do it except for writing the bits of the image. Can you tell me how to get the bits into a ByteArray Thanks
1
by: =?Utf-8?B?QWRhbQ==?= | last post by:
I'm having a problem loading an Icon into an ImageList. When I load the icon directly it works fine, like this: Icon sourceIcon = << Get an icon from somewhere... >>;...
1
by: =?Utf-8?B?U3RldmVU?= | last post by:
I have a structure that contains both 32x32 and 16x16 icons plus some text. I want to write all this to an XML file so that I can recover the icons later in an application. Can someone tell me how...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.