ts-soft wrote:create a "myresource.res" with porc from your script and import this!
Hey, the best one, thanks!
And porc accepts all types of paths, relative and absolute
So I'm wondering if porc is not used by PB or the IDE makes something wrong - why else you need absolute pathes here
Michael
PS another (tiny) issue concerning resource files within the IDE: if add a new rc file via file selector and choose the file by a double click, the compiler options get closed
PSS wrote a small tool which "automatically" generates the RES file:
[-] you still need to write the RC file and add the Import "File.Res" into the source
[+] you don't have to use the command line, search for the porc.exe etc.
Code: Select all
; • "Tool PorcMeUp.exe" is located in directory "...\Purbasic\Catalogs\
;
; • Configuration of the Tool
; %COMPILEFILE\..\Catalogs\Tool PorcMeUp.exe
; "%TEMPFILE" "%PATH"
; %COMPILEFILE\..
;
; Auto &Indent
; Menu Or Shortcut
;
; - Wait until tool quits
; - Reload Source after tool has quit
; - into the current source
; • written by Michael Vogel...
Procedure Init()
; Dateinamen holen...
If CountProgramParameters()<>2
MessageBox_(0,"'Porc Me Up' needs two parameters!"+#CR$+"Add %TEMPFILE and %PATH to configuration","Error",#MB_ICONERROR|#MB_OK)
End
EndIf
Global SourceFile.s=ProgramParameter()
Global SourcePath.s=ProgramParameter()
Global FileRC.s=""
Global FileRES.s=""
EndProcedure
Procedure Doit()
Protected z.s
Protected l.s
Protected n
Protected m
Init()
ReadFile(1,SourceFile)
While Not(Eof(1))
z=ReadString(1)
l=LCase(z)
n=FindString(l,"import ",1)
If n
z=Trim(z)
z=Trim(z,#TAB$)
l=LCase(z)
If FindString(l,"import ",1)=1
n=FindString(l,".res",1)
If n
m=FindString(l,#DQUOTE$,1)
FileRES=Mid(z,m+1,n-m+3)
Break
EndIf
EndIf
EndIf
Wend
CloseFile(1)
If Len(FileRes)=0
MessageBox_(0,"'Porc Me Up' has nothing to do..."+#CR$+"Import ''Resource.Res'' missing!","Error",#MB_ICONERROR|#MB_OK)
Else
FileRC=Left(FileRES,Len(FileRES)-2)+"c"
n=RunProgram(#PB_Compiler_Home+"Compilers\porc.exe",#DQUOTE$+FileRC+#DQUOTE$,SourcePath,#PB_Program_Hide)
MessageBox_(0,"'Porc Me Up' has generated '"+FileRES+"'..."+#CR$+"Porc's Return Value = "+Str(n),"Information",#MB_ICONINFORMATION|#MB_OK)
EndIf
EndProcedure
Doit()