How can I add Windows right click context menu items? - c++

I am trying to add new actions to the right click context menu when you select a file or many files. I am writing a program in C++ which contains the functionality that I want to trigger.
As far as I know I have to add new entries to the registers when installing my program and also, I have to use COM(here I got completely lost).
Is there a straightforward way of doing this?

As already suggested by #Igor Tandetnik you can do almost everything you want with Registry entries.
https://msdn.microsoft.com/en-us/library/windows/desktop/cc144169.aspx

Related

Does MFC CRichEditCtrl has a display level?

i'm currently working on a legacy project in MFC.
I encounter an issue where i create a bunch of CRichEditCtrl objs in the view, many of them are overlapping each other. When i select them, the visual is totally messed up.
Is it possible to click on a particular control and bring it to the "foreground". so i can edit on that particular control?
Other question is that is there a way to distinguish those controls dynamically?
I know when i create them, the last parementer is their ID. But when i click on those, i want command handler in parent dialog or view knows which one i'm about to edit.
Thanks in advance

How to look for a specific mapping in the navigator window

I'm new to powercenter and the learning curve of this tool seems to be different from the programming languages I'm used to. Where I work everyone tells me to ask people in the office. Access to the internet is non existant. Stack overflow is one of the few places where I can look for info.
I would like to do something basic like, in the navigator window, there are sometimes thousands of mappings with veeeery similar names, I would like to know if there is a way to enable a "control-f" type of functionality. As of right now, placing the mouse on the window and writing the name kinda helps, but since the names are stuff like
k_l_ll_sigpir_proyectname_mappingname
and there are dozens and hundreds that share the same structure: "k_l_ll_sigpir_" trying to navigate when you don't know where info is other than the name is a bit of a nightmare, compared to other tools at least.
Can someone point me in the right direction? Thanks in advance.
I guess I was able to find something that might help, although this is a bit counter-intuitive. I'm assuming you want to find and open some mapping in Mapping Designer. Here goes:
After you've connected to Repository and have the right folder opened (not just connected!), choose Tools => Queries from the menu bar. A Query Browser should open for you.
Choose New to create a new query
In the Query Editor there's a grid. Choose Object Name in the Parameter Name column. Change the Operator to Contains and put whatever you're looking for as Value 1 (using your example: mappingname)
Click the blue play button on the menu bar or choose Query => Execute from top menu. Give this a few seconds.
Give it a few more seconds...
A Query Results window should be opened for you. NOTE: if you've been clicking anything it might get opened in the background - just check the Designer button on Start Bar. It should contain all the objects that contain mappingname string it the name. We've not limited this to mappings only though (I'll discuss this below).
=== now here's the odd part ===
You can right click any item on the list in Query Results window and choose Open in Workspace. And it won't work :)
Switch back to Query Editor window and close it (don't close the Query Results!). You may save you'r query if you like to.
You should be back at Query Browser. Close it.
Return to Query Results.
Right click the desired item and choose Open in Workspace.
Voila!
Now some remarks:
The whole repository is searched. The Query Results may therefore contain items from other folders, than the one you have open. Trying to Open in Workspace such objects won't work since the folder is not open in Designer.
You may construct more sophisticated queries. Just click 'Add new...' icon on the Query Editor window. This will add a line and allow you to choose extra conditions. It will be spawned by a AND condition which you may change to OR. You get the idea.
PS.
Yes, it's odd, I know. Just don't blame me ;)
The quick answer is that the 'metadata manager' tool can do exactly what you ask for. It is basically a 'google search' for your entire data warehouse. Only hiccup is that it requires a lot of work from the admins of your power center servers to get it up and running...
Alternatives:
Basically it depends on what you want to DO with the mapping after you've found it and why you look for it in the first place:
1) in the 'designer tool' you can look under 'targets' in the right hand tree structure
- when you've found the target table you want the mappings for
- simply right-click and choose 'dependencies'
- in the following dialog uncheck everything except 'mappings'
- in the following right click on the most likely mapping and choose 'open in workspace'
2) in the repository database there is a view called opb_task_inst_run that contains a row for each session that has ever run. You can write simple sql against that view with '%like patterns%' to locate mappings... you may want to add a where clause to 'start time' for the most recent week or so - especially if the repository is old and runtime metadata has never been deleted...
Please write back if you need something different...
I'm not aware of the functionality you're after within informatica, however, the mappings are listed in alphanumeric order which should alleviate this. Within the mapping itself there is search functionality to find transformations within the mapping.
As far as a place to start learning Informatica, informatica tv is one place to get your feet wet https://network.informatica.com/support-videos.jspa

Qt - How to create extra roles for a QDialogButtonBox

I apologize in advance for not having more code to show, this is more of a conceptual question. I am working in Qt 4.7 and I have a QDialogButtonBox in my UI to which I need to add several custom buttons*. I set the buttons up like I normally would. For example, if I'm adding a Save button, I would create it like this:
QPushButton *myButton = new QPushButton(tr("Save"));
Usually I could just add this to my UI as is. However, I've found with the button box, it needs to have a "ButtonRole" attached, which are built-in to Qt. The only role that seems close to matching what I want is "ActionRole", but that's still sort of vague as to it's meaning when looking at it later in the code. I know theoretically any of the roles could be associated with this button, but it seems like really bad practice to me to attach an unrelated-named role like "RejectRole" or "HelpRole" to it just to make it work. My question is, how can I create a new role, something like "SaveRole", that I can use for this button? I tried putting a line like #define SaveRole (some int value) in my code and using that since the ButtonRoles are enumerators, but that gave me an error saying it couldn't convert the parameters. I know there's also NRoles in ButtonRole, and it seems like that can probably be used to create new Roles, but I've been searching for about a half hour and am finding it EXTREMELY difficult to find any information on how to use this. If anyone has suggestions it would be greatly appreciated. Thanks!
*For the record, I know how easy it would be to avoid this problem by using QPushButtons individually instead of a QDialogButtonBox, but my project head wants the button box used, so unfortunately I don't have that option.
EDIT: I forgot to mention before but it may be worth bringing up, this button box is pretty large, and all the built-in roles are already in use.

Is there a way to have multiple columns in a QMenu?

Is there a way to have multiple columns in a QMenu? I'm using Qt with C++. I have searched and there does not seem to be a way to do this built in to Qt. The question then is how do I add this functionality to my program? Has anyone built a custom menu that can have multiple columns?
Maybe a submenu is what you're looking for. As qt doc says:
Separators are inserted with addSeparator(), submenus with addMenu(), and all other items are considered action items.
For example, here there is a full example. And "Format" menu item is a submenu. You can add a submenu with:
m_mysubmenu = QMenu(...);
...
m_menu->addMenu(m_mysubmenu);
I found a way to do this here. This is not normally something that you want to do; there is usually a better way; but in my application, the user will be greatly helped by it.

How can I visually design a component in C++ Builder?

I have been away from C++ for a couple of years now doing AS3/Flex work. I have gotten used to being able to create a component and place it in design mode with very little fuss and I am struggling to get my head around the C++ Builder way of doing the same thing.
I have written many components for C++ Builder in the past, but none of them have been visual. What I would like to do now is create a component for customer search and another for order processing because I want to be able to create a new instance of these on the fly. What I don't want to do is have to place each of the components like the dbgrid and search fields manually in code. I would like to do this (as well as set their properties) in design mode.
How do I go about this? I have browsed the source for other Delphi components and I notice they have dfm files which seems to be what I need. How do I do this in C++ Builder? The only option I see is to add a new form if I want a dfm, but this isn't what I want as my components will be based on TPanel.
Is there a way to do this or do I have to resort to doing it all in code with no visual reference?
Pursuing the DFM idea I did a test this morning where I created a component based on TPanel and added a new form to it which I create and parent in the constructor of the component. In design mode I set the form border to none and placed a grid on it. This all looks OK until I place the component in my application, at that point it looks like a panel with a standard looking form in it and the grid is missing. If I run the app the panel shows as expected, borderless and with a grid. The DFM appears to be ignored in design mode for some reason.
If you know a better way to do this than using components then please give me some pointers.
Any help and advice will be appreciated beyond words
You might want to have a look at frames (look for "Frame objects"). They are "subforms" you can design visually and then place on forms.
Just as an FYI item, you can also drop the panel on a form, put any other controls on it, position them, set captions, etc..
Now, click the panel to select it, and use Component->Create Component Template from the IDE's main menu. This creates a unit you can install as a component which will add the panel and it's sub-controls (as a single component) to the IDE's component palette.
Of course, you can then modify the source for that new component like any other component source.