How to get CLSID variable name, like MSVC? - visual-c++

When you are debugging a program and you hover over a GUID variable, MSVC retrieves both the variable name (e.g. CLSID_FilterGraph) and the human name (e.g. Filter Graph Object).
It does the second by looking at HKCR\CLSID\GUID - but where does it get the variable name from?? It's not in the registry.
Any ideas?

The debugging info in the .pdb, probably. It just needs to iterate the CLSIDs defined in the mumble_i.c file generated by MIDL. No problem matching them, they are after all globally unique :)

Related

SQUISH issue to recognize "&" in GUI object names

I use SQUISH to perform automated tests (written in python) on a GUI application (based Linux SUSE 15) with Qt version 5.9.4.
This application contains objects with properties (example name of a menu) containing the character "&".
My test script crashes everytime an object containing the character "&" (in its properties) is called in the script.
The error is :
"LookupError: Object 'Hardwired links from RCSL to turbine I&C' not found
For debugging, I erase this character from the the application design ==> No more issues were observed, the test scripts passed.
But, it is not a sustainble solution, I need the "&" character in my application.
Do you guys have any information about SQUISH having problem with managing certain characters as "&" ?
The error message may indicate a special case: Using the plain text of an object to look up the same.
Please do not use this undocumented (and generally unsupported) approach.
Instead, please record an interaction with the respective object, and then make use of the object name that Squish automatically generated for it.
Or pick the object and copy the object name.

Bitbake: What data structure is datastore?

Following is a sentence from Bitbake user's manual:
"BitBake parses each recipe and append file located with BBFILES and stores the values of various variables into the datastore."
What data type is 'datastore' ? Is it list or Tuple or Dictionary ? Or what data type is it?
Bitbake's datastore is complex store of key+value pairs where keys also have flags (also key+value pairs). Its a custom structure written with a copy on write backend. It supports the idea of 'overrides' where one variable with special naming can override another. See https://git.openembedded.org/bitbake/tree/lib/bb/data_smart.py and https://git.openembedded.org/bitbake/tree/lib/bb/data.py within the codebase for the implementation, the Bitbake manual for information about how to use the data store and https://git.openembedded.org/bitbake/tree/lib/bb/tests/data.py for unittests of it.
You can work out the type of an object in python by executing type(foo) in the same environment. As for that specific type (datastore), a quick google indicates that it's neither a tuple or a dictionary, but a custom object with it's API documented here.

Is there an official list for Handlebars reserved words?

After struggling with a template var named {{engine.x.y}}, which was "silently" showing nothing until I changed it for something else such as {{_engine.x.y}}, I saw that other words such as {{action}} seemed to be "reserved", with no "escaping" possibility...
Is there any list of such "reserved words" in order to lessen the "surprise factor" ? I couldn't find any.
EDIT
even more strange, when I use {{engine}} directly (not engine.x.y) it always gets replaced by the string ".hbs"
however in my context (Node v4.6 + email-templates + handlebars) {{action}} works correctly (linked problem above looks specific to Ember.js)
Found it - the issue isn't with Handlebars (which Josh Crozier found to not reserve any names in the comments above), it's with the email-templates library that you're using. The render function it uses sets several properties on the object that gets passed as the template context, meaning that if your object contains properties with the same name, they get clobbered.
The relevant line of code in the email-templates source can be found here, but for the sake of completeness, the properties which get overwritten are:
filename (set to your template's filename)
engine (set to the file extension of the templating engine that's being used)
templatePath (set to the directory that contains your template)
The most obvious solution would be to just change the name, but if that's not an option you may need to file an issue on their repo.

SSIS File System Task Copy to New Excel File Name w/Date Variable Not Found

I have an SSIS File system Task to Copy an Excel template and create one with a date appended. I get the error saying "the connection is not found. This error is thrown by Connections collection when the specific connection element is not found." It's not found because I'm trying to make it!
The preceding error says "Error at File System Task: Failed to lock variable "c:\Reports\Unregistered_20150915.xlsx" for read access with error 0xC0010001 The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created".
I'm new to this, and all I want to do is run a procedure nightly and put the results in a new Excel file with the date name appended to the end. My plan was to take a blank worksheet/file and copy it into a new file, then execute the procedure on the server to load into this new file. As you can see, the variable is filling in the date just fine, so I don't understand how it says the variable cannot be found.
I've used these pages for guidance, but I am taking some of this and some of that, obviously missing something in between:
Including the Date in a Filename in SSIS using an Expression
and SSIS: Export a Query Result to a File
Any suggestions, articles, or videos would be vastly appreciated.
I found the error. When I set the destination variable, I also had an expression that kept kicking the variable out and using the evaluated result, which is not the name of the variable. I guess in some way that only a newbie can, I created the variable with the expression and created an additional expression which the program was trying to use concurrently.

Import Failure - Role With Id Does Not Exist

I am getting an import error in a specific environment with a managed CRM 2011 solution. The solution has been imported before into many other environments, but the one in particular where it is failing is throwing the following error:
Dependency Calculation
role With Id = 9e2d2d9b-645f-409f-b31d-3a9c39fcc340 Does Not Exist
I am a bit confused about this. I searched within the solution XML and was not able to find any reference to this particular GUID of 9e2d2d9b-645f-409f-b31d-3a9c39fcc340. I cannot really find it in SQL either, just wandering through the different tables, but perhaps I do not know exactly where to look there.
I have tried importing the solution multiple times. As a desperation effort, I tried renaming all of the security roles in the destination environment prior to importing, but this did not help.
Where is this reference to a security role actually stored? Is this something that is supposed to be within my solution--which my existing CRM deployment is expecting me to import?
How do I fix the problem so that I am able to import this solution?
This is the code we used to fix the issue. We had to run two different scripts. Script A we had to run a total of four times. Run it once, attempt the import, and then consult the log to find the role that is causing the problem--if you receive another error for another role.
To run script A, you must use a valid RoleTemplateId from your database. We just picked a random one. It should not matter precisely which one you use, because you will erase that data element with script B.
After all of the roles are fixed, we got a different error (complaining something about the RoleTemplateId was already related to a role), and had to run script B. That removes the RoleTemplateId from multiple different roles and sets it to NULL.
Script A:
insert into RoleBaseIds(RoleId)
values ('WXYZ74FA-7EA3-452B-ACDD-A491E6821234')
insert into RoleBase(RoleId
,RoleTemplateId
,OrganizationId
,Name
,BusinessUnitId
,CreatedOn
,ModifiedOn
,CreatedBy
)
values ('WXYZ74FA-7EA3-452B-ACDD-A491E6821234'
,'ABCD89FF-7C35-4D69-9900-999C3F605678'
,(select organizationid from Organization)
,'ROLE IMPORT FIX'
,(select BusinessUnitID from BusinessUnit where ParentBusinessUnitId is null)
,GETDATE()
,GETDATE()
,null
)
Script B:
update RoleBase
set RoleTemplateId = NULL
where RoleTemplateID='ABCD89FF-7C35-4D69-9900-999C3F605678'
Perfect solution, worked for me! My only comment would be the error in Script B: it shouldn't clear the template IDs of all roles for the given template, only the template ID of the newly created "fix" role, as follows:
update RoleBase
set RoleTemplateId = NULL
where RoleID='WXYZ74FA-7EA3-452B-ACDD-A491E6821234'
I would've gladly put this in a comment to the answer, but not enough rep as of now.

Resources