473,769 Members | 6,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5232
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*****@hotmai l.comwrote in message
news:uw******** ********@TK2MSF TNGP02.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_F ORMAT (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*********@gm ail.comwrote in message
news:uM******** ******@TK2MSFTN GP02.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*****@hotmai l.comwrote in message
news:uw******** ********@TK2MSF TNGP02.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_F ORMAT (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, BeginUpdateReso urce, 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.com wrote in message
news:7v******** *************** *********@4ax.c om...
"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_F ORMAT (Is not a valid application.)

Then to make sure was not because of the ICL, I uncompress a Win3.1
installatio n 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%******** *******@TK2MSFT NGP04.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, BeginUpdateReso urce, 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 CreateIconFromR esource 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.com wrote in message
news:7v******** *************** *********@4ax.c om...
>"news.microsof t.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_F ORMAT (Is not a valid application.)

Then to make sure was not because of the ICL, I uncompress a Win3.1
installati on 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.nos pamwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>
"news.microsoft .com" <gustavo_[remove]fr****@hotmail. comwrote in message
news:e%******** *******@TK2MSFT NGP04.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, BeginUpdateReso urce, 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 CreateIconFromR esource 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.com wrote in message
news:7v******* *************** **********@4ax. com...
>>"news.microso ft.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_F ORMAT (Is not a valid application.)

Then to make sure was not because of the ICL, I uncompress a Win3.1
installatio n 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******** ******@TK2MSFTN GP04.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.nos pamwrote in message
news:uB******** ******@TK2MSFTN GP05.phx.gbl...
>
"news.microsoft .com" <gustavo_[remove]fr****@hotmail. comwrote in message
news:uh******** ******@TK2MSFTN GP04.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*****@hotmai l.comwrote in message
news:uw******** ********@TK2MSF TNGP02.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

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

Similar topics

1
1851
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, it uses cl.exe (MSVC++ Toolkit 2003), and I would like to use icl because MSVC++ 2003 does not support C99. Any help will be much appreciated. Cheers,
4
6368
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 it is. I'm writing an application with a Tkinter GUI (Python 2.4, Tcl/Tk 8.4.) and I want to put a custom icon on the main window. I've followed (so far as I understand it) the recipe in the eff-bot's splendid Introduction to Tkinter - see:...
4
2025
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 add the icons dynamically at runtime. How can you add the icons at runtime without corrupting the image?
1
1501
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 with EnumResource. resource_number can be a negative one, I should increase it by 65536 to have the good one. The problem is the number obtained by increasing can't be the index of resources in the library! Is it an identifier? How can i get a...
2
1977
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 forms will load and others won't. Those that won't load at startup don't load with the Show or ShowDialog command either. Can anyone give me a hint as to what went wrong?
0
2982
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 numbers in sequential order (1-55 when ran against iexplore.exe). When I open up iexplore.exe in Visual Studio, I see 23 icons. Each icon has 1 or more sizes of the icon...I'm assuming that there are, in fact, 55 icon resources in iexplore.exe,...
8
2768
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
4941
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... >>; treeViewImageList.Images.Add("abc", sourceIcon); But when I first save the original icon to a stream and then try loading the
1
3907
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 to properly serialize the System.Drawing.Icon structure to an XML file? The following code doesn't write the icon information to the xml file. private void CreateXmlFile(string filename) {
0
9590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9424
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10223
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10000
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.