I generate several RODL files (without the servicebuilder) which then are combined into a main RODL file to serve all services together.
With version ROSDK8 I use the RODL.exe to generate the resource file using code like the following:
aShellString := Format(‘/language:res /type:intf /rodl:“%s” /out:“%s”’,
[aRODLFileName,aResourceFileName]);
ShellExecute(Application.Handle, nil, ‘C:\RemObjects\RemObjects SDK (Common)\Bin\RODL.exe’,
PWideChar(aShellString), nil, 0);
How can i generate the resource file with ROSDK9?
Thanks,
Agustín.
EvgenyK
(Evgeny Karpov)
2
You can use uROCodegen4Helper.pas.
sample is attached in rodl2code / Invoker and Impl? topic
I see no option for generation of resource files.
What I am tryin to achieve is what the compiler option
{#ROGEN:LibraryName.rodl}
does in order to generate the
RODLFile.res
The resource file generation is part of a build procedure, therefore i want to keep the generation outside the Delphi project.
EvgenyK
(Evgeny Karpov)
4
you can use WriteRES
from uROResWriter.pas
as
resdata := TFileStream.Create(resname, fmCreate);
rodldata := TFileStream.Create(RODLFileName, fmOpenRead + fmShareDenyNone);
rodldata.Position := 0;
try
WriteRES(rodldata, resdata, res_RODLFile);
finally
rodldata.Free;
resdata.Free;
end;
or GenerateRESFromRODL
from uROIDETools.pas
Evgenyk,
If I use the method proposed, the library uses are not expanded.
I get a lot of “Use” in my RODL resource file but no structures, arrays, services, etc.
Do you have another idea?
EvgenyK
(Evgeny Karpov)
6
rodl.exe contains this code:
procedure RodlToRes;
var
lxml: TRODLToXML;
ltemp: TMemoryStream;
begin
lxml := TRODLToXML.Create(nil, true);
ltemp := TMemoryStream.Create;
try
lxml.Convert(lRodl);
lxml.Buffer.SaveToStream(ltemp);
ltemp.seek(0, soFromBeginning);
WriteRES(lTemp, lOutstream, 'RODLFILE');
finally
lxml.Free;
lTemp.free;
end;
end;
lRodl := TRodlLibrary.Create;
lOutstream := TFileStream.Create(lOutfile, fmCreate);
try
with TXMLToRODL.Create do
begin
LoadFileToLibrary(lInfile, lRodl);
Free;
end;
RodlToRes;
Thanks EvgenyK, it works.
mh
(marc hoffman)
8
or just use rodl2code.exe?
@mh I cant see anything on the rodl2code commandline help that suggests you can generate the .res file from a .rodl file. Can you explain the usage.
mh
(marc hoffman)
10
Rodl2code generates code from RODL, not res files. My apologies, I misread your original request.