You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
If you have Visual Studio, then you should be able to open the compiled EXE and inspect the resources it contains. This should at least verify if the binary resource file is bing linked correctly.
This may also be possible with Resource Workshop (I don't have it installed currently to check this).
Also, have you tried to compile the .RC from the command-line, so you can check that the .RES file is being built correctly? For example, if you use a script or batch file to do the RC compilation, then you could could be missing (an important) compilation error (because the console could be closed too quickly to see the error message), and you may then be unaware that you are really using a .RES file from a previous compilation attempt, ie, the file may be from before you added additional items to the .RC file.
In this case i did it manually (after doing it auto.)
So, i see all errors.
Below, BRC and RC logs.
Code:
D:\TEMP>brc -32 -r -v myrc.rc
Borland Resource Compiler Version 5.20
Copyright (c) 1990, 1997 Borland International. All rights reserved.
Lines: Current 0, Total 0
New File: myrc.rc
Lines: Current 1, Total 0
New File: D:\TEMP\myrc.rc
Lines: Current 1, Total 1
New File: D:\TEMP\myrc2.rc
Lines: Current 3, Total 3
Compiling RCDATA: RTFINFO
Lines: Current 5, Total 5
Compiling RCDATA: FILE1
Lines: Current 6, Total 6
Compiling RCDATA: FILE2
Lines: Current 7, Total 7
Compiling RCDATA: FILE3
Lines: Current 9, Total 9
Compiling CURSOR: HYPERHAND
Lines: Current 0, Total 11
New File: myrc.rc
Lines: Current 0, Total 12
New File:
D:\TEMP>
D:\TEMP>c:\PBDLL60\Bin\Rc.exe -v -r myrc.rc
Microsoft (R) Windows 32 Resource Compiler, Version 4.00 - Build 1367
Copyright (C) Microsoft Corp. 1985-1994. All rights reserved.
Using codepage 1252 as default
Creating MYRC.RES
RC: RCPP -CP 1252 -f D:\TEMP\RCa56631 -g D:\TEMP\RDa56631 -DRC_INVOKED -D_WIN32
-pc\:/ -E -I. -I .
MYRC.RC.
Writing RCDATA:RTFINFO, lang:0x409, size 16625.
Writing RCDATA:FILE1, lang:0x409, size 2596375.
Writing RCDATA:FILE2, lang:0x409, size 206.
Writing RCDATA:FILE3, lang:0x409, size 345000.
Writing CURSOR:1, lang:0x409, size 748
Writing GROUP_CURSOR:HYPERHAND, lang:0x409, size 20
D:\TEMP>
piece of the res file, it seems that the cursor is very small in rescode.
This doesn't look good. (i think)
Ó + Ç Ç _ _ ³ ³ °`
°Ó Ó Ó Ó¤ Ó ß ß ß ß ¾ ¶ 0 H Y P E R H A N D
0 @ ý
So I gather you used Resource Workshop to create the RC file? That may explain why the MS resource compiler has problems.
You should always use the RC compiler that matches the resource editor you used to create the script in the first place.
For example, a common problem I come across in Tech Support is the use of RC.EXE (that ships with PB/DLL) on a script that was created with Visual Studio. In this case, the RC.EXE supplied with Visual Studio should be used to compile the script.
I didn't use any other tools than my own '10 tools' (fingers).
The rc is created in notepad.
I tried BRC (borland res compiler only, stripped from an old delphi 2 version.
I also tried RC.
Both have the same problem.
All info/code i used is posted above.
This is it.
What's wrong, why is the cursor_group appended and why is my cursor not retrievable?
Because noone is able to duplicate your problem without actually having the files (at least, I've never heard of this problem before), we are only going to be grasping at straws.
Have you tried substituting other files, rearranging the ordinal order of the resource items, or...
As RC from PB/DLL and BRC.EXE both have a problem, then it is *something* either in your script or in the data used to build the script. I note that the cursor filename contains an underscore... what happens if this underscore is removed?
Substituting another cursor file is definitely something that seems worth trying, as your file is truncated at 20 bytes for an apparently unknown reason.
i tried everything.
also double entries of the same cursor,
Qua data it seems to be inserted.
The group_cursor (and group_icon if you have one) is aut. inserted for some reason.
It looks if the loadcursor api is taking this one but can't load.
So, I think that there are 2 entries in the resources.
I have BC5, i'm not familiar with it, does this have a resource viewer?
This is a stripped version.
if i remove file1, wich is 2.5mb, all others are ok.
Just grasping at straws here, but does the icon in question open and display correctly in the icon editor? Resource Workshop has an icon editor, just maybe the file is glitched on the hard drive. Just a thought.
I just did use BC5.
i compiled the resource from the ide to a res file.
Now i'm thinking about my code:
Code:
Function WinMain ( ByVal hCurInstance As Long, _
ByVal hPrevInstance As Long, _
lpszCmdLine As ASCIIZ PTR, _
ByVal nCmdShow As Long ) As Long
#Register None
Dim hDlg As Long
Dim a As Long
Dim Result As Long
Dim hRichEdit As Long
Dim hCtrl As Long
Dim T As String
Dim az as asciiz * 20
az = "HYPERHAND"
HYPERHAND = LoadCurSor( hCurInstance, az )
Msgbox Str$( HYPERHAND )
Returns zero.
As i said, when i remopve the large file (//), the rest becomes ok.
Edwin --
Situation looks absolutelly clear (at least, for me) -- it's not possible to include separate objects larger than 13xx Kb (total size is not important).
Plus, PBRES/PB doesn't like something else.
Do you plan to rewrite PBRES/PB ?
------------------
[This message has been edited by Semen Matusovski (edited May 18, 2000).]
When LoadCursor() fails, what does GetLastError() return?
Semen's 1.3Mb limit suggestion implies a stack overflow or stack limit is occuring somewhere (ie, in the API). If you reduce the size of the RTF file to around 1Mb, you may be able to test this concept further. I've never used such a large resource file - most of mine are well below 1Mb.
I have a working example here where I use a 3.8 meg file as a
binary resource and it uses standard RC.EXE syntax and builds
without either error or warning so there is no problem with
either RC.EXE or PBRES.EXE.
The RES and PBR files are both in the 3.8 meg range so the
problem must be somewhere else. It appears to be in the syntax
used in the RC file.
This is the line from my RC file,
2 RCDATA DISCARDABLE "Files.bin"
I routinely use number IDs for resources as the Microsoft
literature says it is more efficient and I have also found it to
be more reliable.
All I can suggest Edwin is that you try using a number ID and see
if that fixes it.
Semen, i build the res file as described but for appending i used 2 methods:
The PBRES method and the rsrc tool wich appends Res files afterwards (like in 16bit)
In that case, no PBRES util is used..
The appending of a LARGE file is not the problem.
I have two problems when i use large files:
1) icons are no longer loaded(!)
2) this cursor described above won't load either.
The BC5 ide shows the resources correctly (visually)
Might this be a PB.exe <> res problem??
Lance, i certainly hope you want to take a look about my test zipfile.
At the end i will (of course) compress the data except for the RTF data.
This might result in a correct working exe, but not to be trusted when i append larger files in the future.
Edwin --
Sorry, I have stupid idea about 1,3 because of ASCIIZ strings.
But look your code.
You should use
a = LoadCursor(GetModuleHandle(ByVal 0), "HYPERHAND" )
I wrote a test piece and could duplicate you problem exactly with
both icons and cursors. I wrote a small test piece in MASM and it
has exactly the same problem, cannot load menus, icon etc...
The problem is in the resource file format so for a quick work
around, I would suggest putting the resources in a DLL and see if
you can call them from that, this will allow your EXE file to function
normally while using a DLL that does not need other resources.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment