MFC SDI Application without a default "New Document" on Startup - visual-c++

My application is an SDI with multiple views. By default, it creates a new document when the application starts. I want to modify this behavior so that a new document is created only when user explicitly clicks on "New". Or at least mimic this behavior. Any ideas? I am using Visual Studio 2008 with MFC feature pack. I googled and found some solution to this problem in an old MS Journal article. But unfortunately it doesn't seem to work now. Any workarounds or solutions? In short, I need to differentiate between framework call to OnFileNew() and User Click on New.

Are you sure the frame work calls OnFileNew? If so, set a breakpoint in the function then trace back to where its called. If necessary, override the function calling it and do everything the same except the creation of a new document. That should do it.

Related

where to put the C# code if you don't want to use WEB PART in SharePOINT via iSharePoint designer

I'm site collection administrator for a site in SharePoint 2010. I'm using SharePoint Designer 2010.
I'm not allowed to use WebPart etc. I created a some HTML pages and Javascript files and using the LISTDATA.SVC to update my lists and uploading documents to my document library programmatically via Javascript.
Till here it's fine. Now when I click a button, I need to call a webservice (*.ASMX) file and need to use file.readallbytes and call the webservice with this bas64 encoding stuff etc. a 20 lines of C# code.
I can't write these in Javascript so I need to write this in C#, Which I already wrote, but where do I put my 20 lines of C#.NET code? There is no code behind file.
I just see default.aspx.... If I create default.aspx.cs file and add button event handler will this work or how can I get this working?
I can't change anything in Central Admin (not access to it). I've just full SCA right.
I googled and find something "PageParserPath" but it's not clear?
http://msdn.microsoft.com/en-us/library/bb862025%28v=office.12%29.aspx
I've just 2 months exprience with SP, so please be more concreet when responding.
please advice where and how to put the C# code?
For security reasons, SharePoint designer removes almost all C# code that you put directly into the aspx page. You will need to either use Visual Studio to build a web part or find a JavaScript solution. What you're asking is very likely possible through JS, so you might consider posting a new question giving your C# code and asking for help doing the same thing with JS.

QTP Addin - Object is not being recognised

QTP doesn't recognize item when I disable some add-ins which was checked when I added them in to the repository
Note: I actually selected all the add in's when I added the objects into repository - .Net, JAVA, Oracle, Siebel, SAP, Web Services, Silverlight, ActiveX(I know I am a Noob). When I just select Web right now and run the script, it's unable to recognize the object and when I add the object again(with only Web checked), it's being added as a new object and is being recognized when I run it.
So my question is what is the relationship of an object with respect to add in? How does it go on to affect the property of the same object?
Add-Ins are Collections of Pre-Defined Object Types
The add-in contains built-in property sets for a specific group of related UI objects. This helps QTP identify the runtime objects more effectively for a specific type of application.
For instance, it's quite predictable that browser-based applications will be using the standard HTML elements, so the basic web objects (i.e. Page, Frame, WebButton, WebList) have already been defined in advance inside the Web add-in.
The Evil in Enabling All Add-Ins
Most likely, you're facing the issue because all add-ins were enabled during recording. QTP had the option to choose from any of the pre-defined objects in all of those add-ins as it sees fit. You could have ended up with an object repository that's a hybrid of object types found in multiple add-ins.
We faced this similar issue before where a web button (i.e. html input type="button") was recorded as a SAPWebButton. That's because all add-ins were enabled during recording and no one noticed. It worked fine until we disabled all other add-ins, except for the Web add-in. Since the Web add-in only knows about a WebButton not a SAPWebButton, this resulted into identification problems.
Prevention and Fix
The correct approach is to decide which add-in is most appropriate for your application type before recording, enable it and disable the rest.
You will have to manually update the problematic object via Update Run Mode. If there's too much, you'd be better off recording from scratch.

How do I safely add an attribute to an Opportunity?

I am building a plugin that utilizes the new Business Process Flow in Dynamics 2013, and in order to take full advantage of the easy to use check-list style menu I have added two new attributes to the default Opportunity entity in Dynamics CRM.
I have done this in the plugin's customizations.xml file by adding the attributes to the Opportunity Entity under the EntityInfo->Entity->Attributes section of the Entity xml.
The addition of this field to the Opportunity works just as expected, though I am running into issues when uninstalling the plugin.
Since this plugin will be widely available, I can't expect users to keep it on their systems forever.
On uninstallation of the plugin, however, Opportunities can no longer be viewed in the CRM 2013 Online. When I try to view one I get the following:
Critical
Query Builder Error
The specified field does not exist in Microsoft Dynamics CRM
Is there something I can do within the customizations.xml file to ensure that once the plugin solution has been uninstalled, Dynamics CRM will no longer reference these fields?
note: This issue occurs on a brand new instance of Dynamics CRM 2013 (trial) with the plugin simply installed / uninstalled, so no other customizations are linking to changes from the plugin and causing the crash
If you were to make this change via the UI, it would block you from deleting these fields until all dependencies have been removed as well. Because you chose to do this without the assistance of the UI, it is breaking on you. If you go back and make this change via the UI, the customizations.xml file should be properly updated and you should be good to go (or it will error and say where there is still a dependency - making it easy to go and fix it).

How to override DbContext.Seed() when using the Visual Studio Model Designer

I just started to play around with EntityFramework. In VS2012 I can use the designer which nicely creates all the boilerplate code. However, I am now at a point where I wanted to start playing with overriding DbContext.Seed() to initialize the database with some data. While there is this quite easily done writing the DbContext myself, I was not able to find a way to do this from within the designer. It seems to be no option to modify the Designer created 'Context' class. The comment at the top of the file tells me, that all manually added code will be lost when the file is regenerated.
Am I missing something? Can someone please point me in the right direction. How can I do all the nice more advanced things and still continue to use the designer.
try to find a package in Nuget there will be a ready solution to connect. Read more here http://nugetmusthaves.com/Tag/POCO or search in google poco Nuget.

Sharepoint includes control template twice

I'm working on a SharePoint 2010 project. We have a usercontrol to include all of our custom javascript. I popped an alert in there whilst debugging something else, and lo and behold the alert was called twice. I checked and the file in question is included by only one Elements.xml file in one feature. So how can this be? I've tried searching the whole solution, and I only get one hit, so I must be missing something.
EDIT:
This is the code calling the User Control:
<Control Id="AdditionalPageHead" Sequence="10" ControlSrc="/_controltemplates/company/UCLoadJS.ascx" />
This code is found in the Elements.xml of the MasterPages folder, which deploys our custom master page.
Having searched the whole project for UCLoadJS, I cannot find another instance.
I think you have hidden WPs loading these Controls.
Try creating a new page and add the Visual WP once and try again
I know that this question is 9 years old but I just had the same problem, so in case someone stumble across this thread, maybe this will help you:
try to list all your delegate controls. you can slightly modify the script provided by Waldek Mastykarz : Checking which Delegate Controls are activated on your site
if you find duplicated controls (and that was the situation in my case) then its probably because you deployed your control using one feature scope (Site for example) and then redeployed with another one (Web). Follow the steps below to solve the problem:
1). switch to another feature scope (the one you no longer want to use)
2). deploy the feature
3). deactivate it
4). switch feature scope to the required one and redeploy it
Source: SharePoint delegate control is rendered twice

Resources