Board index » delphi » Fixed problem with my resource dll thanks all (including the fix fyi)

Fixed problem with my resource dll thanks all (including the fix fyi)

I discovered my problem. When creating resources outside of Borland Image
Editor you must surround the resource name with quotations ("MYIMAGE" BITMAP
"BLAH.BMP") .. Really strange huh? Were getting as literal as c/c++ here
what the heck?
 

Re:Fixed problem with my resource dll thanks all (including the fix fyi)


Quote
David S. wrote:
> I discovered my problem. When creating resources outside of Borland Image
> Editor you must surround the resource name with quotations ("MYIMAGE" BITMAP
> "BLAH.BMP") .. Really strange huh? Were getting as literal as c/c++ here
> what the heck?

The first token in a resource line is either an integer or a string. It
should come as no surprise that strings need to be quoted.

To specify an integer, you can either use a literal or you can use an
identifier previously defined with a #define directive. The latter
method is most useful for C and C++ developers, who can put all those
#defines in a header file and #include it in both the resource script
and their source code, guaranteeing that they use the same resource
identifiers everywhere. It's not so useful for us Delphi folk since the
resource compiler doesn't understand our const declarations.

--
Rob

Re:Fixed problem with my resource dll thanks all (including the fix fyi)


Yeah your right , I don't know why it took me so long to figure that out ..
what I'm wondering is would c/c++ or any other languages have problems
calling the resources from my dll with the quotations? I'd assume not.. But
just curious
Quote
"Rob Kennedy" <rkenn...@example.com> wrote in message

news:ve7s12iifjimb2@corp.supernews.com...
Quote
> David S. wrote:
> > I discovered my problem. When creating resources outside of Borland
Image
> > Editor you must surround the resource name with quotations ("MYIMAGE"
BITMAP
> > "BLAH.BMP") .. Really strange huh? Were getting as literal as c/c++ here
> > what the heck?

> The first token in a resource line is either an integer or a string. It
> should come as no surprise that strings need to be quoted.

> To specify an integer, you can either use a literal or you can use an
> identifier previously defined with a #define directive. The latter
> method is most useful for C and C++ developers, who can put all those
> #defines in a header file and #include it in both the resource script
> and their source code, guaranteeing that they use the same resource
> identifiers everywhere. It's not so useful for us Delphi folk since the
> resource compiler doesn't understand our const declarations.

> --
> Rob

Re:Fixed problem with my resource dll thanks all (including the fix fyi)


Quote
"David S." <big_d...@comcast.net> wrote in message

news:Ob6cnQPS15O-Un6jXTWcqQ@comcast.com...

Quote
> I discovered my problem. When creating resources outside of Borland Image
> Editor you must surround the resource name with quotations ("MYIMAGE"
BITMAP
> "BLAH.BMP") .. Really strange huh? Were getting as literal as c/c++ here
> what the heck?

I've never put them in quotes before? Did you have spaces in the name or
something?

Cheers,
Nicholas Sherlock

Re:Fixed problem with my resource dll thanks all (including the fix fyi)


Quote
David S. wrote:
> Yeah your right , I don't know why it took me so long to figure that out ..
> what I'm wondering is would c/c++ or any other languages have problems
> calling the resources from my dll with the quotations? I'd assume not.. But
> just curious

The quotation marks are not included in the compiled resource file --
they're part of the syntax of resource scripts, just like single
quotation marks are part of the string syntax in Delphi but they don't
actually appear in the compiled executable.

When you load a resource, you can specify either a name or a numeric
index. (The resource-loading function can tell the difference since
PChars' addresses have nonzero values in their high-order words and
resource indices must be less than 65536.)

When you load a resource by name in Delphi, you'll wrap the name in
single quotes since that's what the Delphi syntax requires you to do. In
C++, you'd wrap the name in double quotes since that's how you make
strings in C++. The syntax of a resource script also uses double quotes
to indicate strings, but the syntax for the resource script is not
related in any way to how you access the resultant resource at run time.
(You don't "call" a resource.)

--
Rob

Re:Fixed problem with my resource dll thanks all (including the fix fyi)


No no spaces.. When you use borland image editor or resource workshop it
does it automaticly ... I only found it by opening the .res in an old copy
of visual studio.. I don't quite understand it myself but I know when you
generate a res with image editor and open it in visual studio the resource
names have quotes around them .. And when I put the quotes around them I no
longer get a resource not found error
Quote
"Nicholas Sherlock" <n_sherl...@hotmail.com> wrote in message

news:bc107n$914$1@lust.ihug.co.nz...
Quote
> "David S." <big_d...@comcast.net> wrote in message
> news:Ob6cnQPS15O-Un6jXTWcqQ@comcast.com...
> > I discovered my problem. When creating resources outside of Borland
Image
> > Editor you must surround the resource name with quotations ("MYIMAGE"
> BITMAP
> > "BLAH.BMP") .. Really strange huh? Were getting as literal as c/c++ here
> > what the heck?

> I've never put them in quotes before? Did you have spaces in the name or
> something?

> Cheers,
> Nicholas Sherlock

Re:Fixed problem with my resource dll thanks all (including the fix fyi)


Quote
"David S." <big_d...@comcast.net> wrote in message

news:soOcncd9k7jtk3mjXTWcog@comcast.com...

Quote
> No no spaces.. When you use borland image editor or resource workshop it
> does it automaticly ... I only found it by opening the .res in an old copy
> of visual studio.. I don't quite understand it myself but I know when you
> generate a res with image editor and open it in visual studio the resource
> names have quotes around them .. And when I put the quotes around them I
no
> longer get a resource not found error

Yup.. but I write my own .rc files (As the one below) with Delphi 5 and I've
*never* put quotes.......... uhhh wait actually... :). Yeah, you need quotes
around the filename. I don't know why I've never noticed that before :).
Good luck with your project!

Cheers,
Nicholas Sherlock

Re:Fixed problem with my resource dll thanks all (including the fix fyi)


no i put quotes around the RESOURCE NAME ie "MYIMAGE" bitmap "blah.bmp" I
don't know why this is they don't end up compiled into the dll like that but
it has to have them for some reason or it doesnt find them.. Maybe this is
d7 specific i don't maybe I'll ask borland whats up with this someday
Quote
"Nicholas Sherlock" <n_sherl...@hotmail.com> wrote in message

news:bc15q8$d4e$1@lust.ihug.co.nz...
Quote
> "David S." <big_d...@comcast.net> wrote in message
> news:soOcncd9k7jtk3mjXTWcog@comcast.com...
> > No no spaces.. When you use borland image editor or resource workshop it
> > does it automaticly ... I only found it by opening the .res in an old
copy
> > of visual studio.. I don't quite understand it myself but I know when
you
> > generate a res with image editor and open it in visual studio the
resource
> > names have quotes around them .. And when I put the quotes around them I
> no
> > longer get a resource not found error

> Yup.. but I write my own .rc files (As the one below) with Delphi 5 and
I've
> *never* put quotes.......... uhhh wait actually... :). Yeah, you need
quotes
> around the filename. I don't know why I've never noticed that before :).
> Good luck with your project!

> Cheers,
> Nicholas Sherlock

Re:Fixed problem with my resource dll thanks all (including the fix fyi)


In article <Ob6cnQPS15O-Un6jXTW...@comcast.com>, "David S."

Quote
<big_d...@comcast.net> writes:
>I discovered my problem. When creating resources outside of Borland Image
>Editor you must surround the resource name with quotations ("MYIMAGE" BITMAP
>"BLAH.BMP") .. Really strange huh? Were getting as literal as c/c++ here
>what the heck?

In D3 and compiling with BRCC32.exe (05/08/97), putting single or double quotes
around the resource name gets an "Expecting resource name or resource type"
error from the compiler. OTOH it _will_ take double quotes around the filename
(required if containing spaces), and also dotted directories.

Alan Lloyd
alangll...@aol.com

Other Threads