Pelles C forum

Pelles C => General discussions => Topic started by: marzioni on July 24, 2008, 10:45:24 AM

Title: error in dll created
Post by: marzioni on July 24, 2008, 10:45:24 AM
hello at all,
i have built a dll with pelles c 5, and i obtain the follow message:

Building contes32.obj.
warning #2024: Empty input file.
Building CONTES32.res.
Building contes32.dll.
Done.

when i perform a double click on the dll file to open with pelles c 5, pelles gives to me the follow message:
Error reading from file 'contes32.dll'.
It's impossible to find the name of resource specified in the image's file.

what is wrong?

thanks in advance, marzioni
Title: Re: error in dll created
Post by: JohnF on July 24, 2008, 05:09:41 PM
I suggest, you need to post the project.

John
Title: Re: error in dll created
Post by: marzioni on July 25, 2008, 09:13:03 AM
i have attached the project.
marzioni
Title: Re: error in dll created
Post by: JohnF on July 25, 2008, 10:38:02 AM
My guess is that you need to define the resource identifiers.

For example

AIUTO BITMAP "res1.bmp"
AIUTO2 BITMAP "res2.bmp"
BOTTOM BITMAP "res3.bmp"

AIUTO has no value associated with it.

Make a header file (.h) that is included in the RC file containing all identifier defines.

e.g.

// start contes32.h
#define AIUTO 1000
#define AIUTO2 1001
#define BOTTOM 1002
//end

You will need to define all resources hopefully with unique identifiers. That is for 'cursors', 'icons', 'bitmaps', 'dialogs', etc.

Include that header file in the RC file like so.

#include "contes32.h"

John
Title: Re: error in dll created
Post by: marzioni on July 25, 2008, 11:44:51 AM
i have tried with a little piece of contes32.rc file (see below) and without h file the dll created works fine.

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>

LANGUAGE LANG_ITALIAN,SUBLANG_ITALIAN

AIUTO BITMAP "res1.bmp"
AIUTO2 BITMAP "res2.bmp"
BOTTOM BITMAP "res3.bmp"
Title: Re: error in dll created
Post by: JohnF on July 25, 2008, 12:29:03 PM
Ok, well, it seems that the compiler does not like various names.

These for example
PRINT_BLACK
PRINT_PROC
PRINT
MESS_CODICI

And a few more I can't remember.

I have changed various names so that it is ok. See the attached RC file.

You are better off using identifiers, not strings, IMO.

John
Title: Re: error in dll created
Post by: marzioni on July 28, 2008, 09:06:43 AM
many thanks John, now works fine.

I have had messages from the compiler with the following bitmap names:
DELETE, HELP, MENU, i have changed the names, and the compiler has not given anymore messages.
now i will use the numeric identifier.

thanks again,
marzioni