mt.exe -replacements: xml file structure for registration free COM component is not documented - com

I am using mt.exe to generate a manifest for a registry free C++ COM component. The .rgs file passed on the command line has some replaceable strings whose value must be stored in a .xml file passed to the -replacements argument. The thing is, there is no documentation on the expected syntax for that xml file. I reported the issue to Microsoft but the ticket was closed without providing any solution. Does any one know how the replacement xml file should be structured?

Related

Bug in IDL parser in RedHawk IDE

Some valid IDL files, build as IDL Projects and install but some or all of their contents do not appear in the SCA Explorer/Target SDR/IDL Repository. I believe that the IDL parser used to build the tree in the IDL Repository is different from that used by the omniORB idl2cpp (omniidl) during building and it rejects some valid IDL. The cases I have found all use a value of a const previously defined. e.g.,
const Algorithm ALG_NONE = 0
const Algorithm ALG_LPC = ALG_NONE + 3
The second line can occur in the same file or in a file that includes the file containing the first line.
The file containing the first line is accepted if the second line is not in the same file, but the file containing the second line is rejected and none of its contents appear in the IDL Repository tree. It appears that it rejects a const appearing as a value on the right side of an assignment statement. These files however are valid and are accepted as valid by omniidl. But they cannot be used in RedHawk because they cannot be selected for a component interface.
I am not very familiar with RedHawk IDE sources or Eclipse plugins and so have not been able to find where the syntax for the parser is specified. I see "eclipsecorba" appearing in plugin lists so I assume that RedHawk is using the Eclipse CORBA Plugin (aka ECP) and that its parser is the one being used to build the tree. So I suspect that the parser error is in that package rather than in code added by RedHawk.
Can anyone confirm this and suggest where I might look in the ECP code for this? Should I report this as a ECP bug to the ECP group on SourceForge? I am not sure how active it is since it appears that the latest version is from 2008.
This seems to be a bug in the IDL editor, the IDL you have is legal. Would recommend you to report this to ECP but given the long inactivity of that project probably it will not fixed soon. I do know that one of our Remedy IT engineers has created a more modern IDL editor for Eclipse but due to lack of funding this work is not available publicly.

Migrating a string table (binary .res file) from VB6 to VB.NET

I have to port an old VB6 program to VB.NET and stumbled across an old ".res" (Resource) file, which is stored in binary format. Using VS 2013, I can embed that file into my .NET project, and VS shows me that it contains simply a string table.
The problem is, I cannnot figure out how to bring those res file into a more modern text format, or how to load the strings directly from the res file. I linked file to my application es an embedded resource, but all my atttempts to use VB6.LoadResString from the "Visual Basic Compatibility library" lead to an exception, showing the key was not found.
Furthermore, it seems VS does not allow me to copy/paste the string table into a text file, at least, not at a whole. Actually, it allows me to copy/paste one string after another, but as you can imagine, that is extremely cumbersome and error-prone. That is why I am looking for a better solution. Any ideas?
There is a functional VB6 Class for doing this at:
ResDecomp Class Decompiles RES Files
Sample programs are included, one of them a sort of "viewer" and the other just extracts RT_STRING resource strings to an XML document. You could easily change the latter to dump the string values to a text file, database, etc. instead.
Embed the .res file to a simple VB6 program which loops from min to the max ID and write out the strings to a text file using LoadResString (error trap for missing IDs).

Generate vb class from xsd. xmldsig#:SignatureType

I'm trying to generate a vb.net class using the xsd tool, from a xsd file, but I receiving the following message:
schema validation warning: complext type 'http://www.w3.org/2000/09/xmldsig#:SignatureType
Warning: cannot generate classes because no top-level element with complex type were found.
Thanks!
Davis
better late than never...
You have to pass 2 parameters. Your file, and the http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd reference. As XSD.exe only accepts 1 input parameter, you have to pass it .Xsd paths.
So, you have to do this:
Download xmldsig-core-schema.xsd schema.
Run this:
"C:\Program Files\Microsoft SDKs\Windows\vXXXX\bin\xsd.exe"
[path_your_folder]\your_file.xsd
[path_to_your_folder]\xmldsig-core-schema.xsd /c /n:mi_new_class_file_name /l:VB
The new file "mi_new_class_file_name.vb" may be now into your "C:\Program Files\Microsoft SDKs\Windows\vXXXX\bin" folder.
I had similar problems with XSD.EXE, it would work for some simple XSDs, but anything complex - bunch of various errors and that is. What made problem worse, I am fairly amature with XSD/WSDLs. In my experience, i had several WSDLs, each imported 2 to 5 external XSD.
Here is what I did to get Classes from XSD:
-Download and install free tool XSD2CODE
-Run in command line:
"<PATH to Xsd2Code executable>\Xsd2Code.exe" YourXSDFile.xsd /l vb
That generated classes for me even when XSD.EXE could not.
Good Luck!

reading a ptd/zgy file

Is there a way to read the ptd or zgy file outside of Petrel? I have an application that would like to read the 3d seismic data that petrel holds in these formats without opening petrel to export the data into ASCII or something else. Obviously its a better user experience to just read it from my own application.
You can use zgy access C++ library deployed with Petrel. It's named Slb.Salmon.ZgyPublic.zip and located in the Petrel root folder. The archive contains binaries (native DLLs), C++ header files and documentation.
As for ptd, it is an extension of a folder name which contains files in many formats (binary, XML etc.), belonging to one project. The project's main file has pet extension, it is stored in binary format. There is no documentation on the format, it may change without notice, so you are not supposed to read those files directly.

How can you _create_ a text file in Wix?

Is there any way to create a new text file and write to it using Wix? I have come across elements that will allow me to work with Xml files and Ini files, but nothing for a plain text file.
The root of the problem stems from the fact that we're using a third party library that reads from its own custom configuration file, which really ties my hands as to what the text file can look like. The configuration file is similar to an Ini file, minus the "sections." And I've noticed that Wix handles Ini files by always placing them in the system folder, which won't work for our needs.
The data that needs to be written to the configuration file is gathered at run-time, so there's no opportunity to simply lay down a pre-configured file.
I would be willing to accept a Wix extension to accomplish the same result if one exists, but haven't come across one yet.
There is no built-in feature in Windows Installer for this. You'll have to write code to do it and invoke that code with a custom action.
The IniFile element can write .ini files anywhere; use the #Directory attribute to specify which directory it should go in. If the library ignores [section] lines, you can use anything as the #Section attribute value.
You might want to have a look at this project. It contains the collection of WiX extensions and custom actions, and I suppose it also has CA to read and write text files. Try it out - it is claimed to be tested and proved by using in enterprise installations.