Microsoft Development





Most development for the Microsoft platform is done utilizing the technologies supported by the.NET framework. Other development is done using Visual Basic for Applications (VBA) for programs like Access, Excel, Word and Outlook, with PowerShell for scripting, or with SQL for large databases.


Using MFC, I want to add a tooltip to a tab on a CTabView.  I don't care if it's just the tab itself or the full view.  The particular tab is a CHtmlView and is in one of the panes of a CSplitterWnd.    So I have the CMainFrame that creates a couple CSplitterWnd items on OnCreateClient  where one of those panes uses a CTabView.

I tried using a CToolTipCtrl created in CMainFrame::OnCreateClient after adding the CSplitterWnd for the CTabView since the CTabView::OnCreate adds the tabs but nothing seemed to work.


I implemented the suggestion on page 941-942 in the book Programming Windows with MFC second Edition to derive from CToolTipCtrl and implement new functions that use TTF_SUBCLASS.   I tried it with in the CMyTabView on the client area of the tabs.  It sort of works with the Edit and Rich Views but not HTML view.  By sort of, I mean, it works maybe twice then doesn't come up again.  Here's that part:

    int CMyTabView::OnCreate(LPCREATESTRUCT lpCreateStruct)
      if (CTabView::OnCreate(lpCreateStruct) == -1)
        return -1;
      AddView(RUNTIME_CLASS(CMyEditView), _T("Tab1"));
      AddView(RUNTIME_CLASS(CMyRichView), _T("Tab2"));
      AddView(RUNTIME_CLASS(CMyHtmlView), _T("Tab3"));
      m_ToolTip.Create(this, TTS_ALWAYSTIP);
      CMFCTabCtrl &tabctrl=GetTabControl();
      for (int i=0; i < tabctrl.GetTabsNum();

Open in new window

I have a stored procedure that timed out intermittently and when i run it using Actual execution plan it returned high logical and physical reads on some tables. Just wanted this to be rewritten or maybe I'm missing some indexes.
I am trying to find the (very) old Help Workshop (Microsoft) compiler for .hpj files
Visual Studio 2017.

I am getting this message from the compiler:

Accessing "TextDocument" should only be done on the main thread. Call lMicrosoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread() first.

Could someone explain what I am doing wrong please?

I am not sure I understand what the "main thread" is in this case or where I should be accessing this code?

EnvDTE80.DTE2 DTE2 = Package.GetGlobalService(typeof(DTE)) as DTE2;
if (DTE2.ActiveDocument != null)
     TextDocument TheDocument = (TextDocument)DTE2.ActiveDocument.Object("TextDocument");

Open in new window

I can remove the warning by adding ThrowIfNotOnUIThread() but is this the real solution?
HI Expert,

I have issue  with mobile application, it is hosted on local Server with IIS and
Images are not showing on mobile apps. it works fine if I reset  IIS. But the issue occures again after a period of time. at the Same time the default website is working on all browsers internally and externally.

please  let me know if there is any solution for this issue
Hello all,
I am writing a DLL (in windows), with a function that needs a lot of stack size.
The problem is that I am not creating the thread, and probably can not determine the thread size.

Is there a way in which I can "switch to 'MyStack' " whenever my functions are called ?  Automatically or hard coded ?

I want to implement a openfiledialog using CFileDialog with custom filter,
where I can get list of files and choose one by one which one to be shown or not,

For this I have tried to hook with OPENFILENAME's HookProc, But it only gets callback for old style dialog I want to implement it for new style dialog,

Could anyone please explain me, how can I implement this type of filter with new style explorer dialog, using any possible way or workaround.
I'm trying to use the MS Installer. The installer fails because the parameters for Short Cuts doesn't allow any assignment. I'm guessing that's  why it failed.

This video gives correct instructions up to shortcuts:

Deployment around the corner and I don't see what's wrong.  

Thank you for any insights you may give.
I have 2 very similar VB.NET applications.  They are both Windows Forms applications, and both have some "maximized" forms and some "windowed" forms.  They are deployed to Windows 7 PC's with monitors set at 1280x800 at 125%.  

One application  sizes properly -- All forms and controls in the app size "up" properly, and all fonts size up properly.  The second application seems to size up the fonts, but not the controls or the forms themselves.  There is a form in both apps sized 450 x 500 -- One displays larger than the other at 125%.  After switching the monitor to 100%, both those forms show at the same size.

These applications are created using VS 2017 "Community".   I have checked the properties of those two forms, and they are the same.   However, since I see the problem on all forms, I am assuming it is a setting at the application level, not the form level.   In both apps, the "Enable XP visual styles" is set the same, and that's the only setting I see that may be related to how forms are displayed.

This may or may not be a clue (and I have to verify it), but when running at 125% on a Windows 10 machine, both applications size properly.

Any ideas what setting I need to change to fix this?
Error Publishing Template Set in HotDocs Server V11.0.1 from HotDocs Developer V11.2.4
Error message HotdocsError.jpgPublishing Errors.txt
(1) Error in '180830 Business Incentives and Tax Savings Review Services.docx': failed to copy a file to the publishing folder.

Any expertise in troubleshooting issues like this with HotDocs is appreciated.
When opening or creating a key in the Windows Registry using the WIN32 C API it is possible to specify the REGSAM as one of the arguments. This details the access rights to the key, but can also be used to set the "view", be it 32 bit or 64 bit. This is achieved by passing either KEY_WOW64_64KEY or KEY_WOW64_32KEY.

My question is this: given just a HKEY, is it possible to identify the original REGSAM value that was used to open that key? The program I am writing needs to be able to make this distinction and whilst I could "cache" the original REGSAM, it would be smarter and cleaner if there was a way (using WIN32 C API) to get these details.
CWinThread wont exit in Release mode but will in Debug mode visual studio 2017.

Here is what I am doing
CWinThread *ptrDecode = AfxGetThread();
CCriticalSection c_sDecode;
static UINT mDecode(void*);
ptrDecode = NULL;

void myfuction::startThread()
      if (ptrDecode == NULL) {
	  ptrDecode = AfxBeginThread(mDecode, this);
	  WaitForSingleObject(ptrDecode, INFINITE);

UINT /*WINAPI*/  mDecode(void* pParam)
	myfuction* pThis = (myfuction*)pParam;
	CSingleLock lock(&c_sDecode);

	while (1) {
               if (! {
				if (!theApp.RTSPChangeCam) // if == false break out of while loop
				cv::resize(RTSPframe, RTSPResize, cv::Size(RTSPWidth, RTSPHeight), 0, 0, INTER_LINEAR);
ptrDecode = NULL;
	theApp.KillDecoder = false;
	return 0;

void myfuction::OnDestroy()
	//## make sure nothing is being rendered ##//
	//## kill any RTSP Streams ##//
	theApp.RTSPChangeCam = false;
	while (ptrDecode != NULL) {} // wait until thread exits


Open in new window

In OnDestroy() function the while loop waits until ptrDecode == null after theApp.RTSPChangeCam is set to false this cause the while loop in the thread to break and set ptrDecode to null and the dialog then can safely exit this work fine in debug mode and my watch window is showing me that ptrDecode has been set to null but in Release mode ptrDecode dose gets set to null if I place a break point in the thread code but then is reset to not null (seems to get reloaded) when my bullet point hits ptrDecode in the OnDestroy() function, I do not know why this is being re initilized after its been set to null. At no point in my code dose the thread get called again and it only dose it in Release mode.
Is there a setting in my release properties I need to change any help would be great
Hi, so I have a Visual Studio 2010 solution that I'm trying to open.  The problem is two-fold:

1. I can't open the solution in VS 2010 because it keeps saying I need to install SQL SSDT for 2010.  Tried to find and install it with no luck.  Keeps prompting me for it even when I "think" I have it installed

2. I have VS 2013 also installed but that has SSDT installed for it (again, I believe).  The problem though is that it's saying the solution is under source control so it won't even open it.  How do I "break" the bindings of the source control?

I did not create the solution, it was from a third party.  Any and all help would be great, thanks!
SharePoint 2013 Workflow Process Task action always redirects to the Tasks List.  Who wants that and how can I choose an alternate URL?
Having bought a new machine (running Windows 10 professional) I Have installed the following:

MS Visual Studio 2017 community
MS SQLServer express 2017
Team Foundation Server express 2015

I find that I do the have the option in VS to "Connect to Team Foundation Server"

I have "Visual Studio Team Foundation Server" set as the Source-Control Plug-in.

I can see my server in Source Control Explorer but cannot add folders or items.

If I go into Team Explorer I can see GIT repos   (dunno how to use these) and I can sometimes add a solution to Source control whereby it is visible in Source Control Explorer temporarily.

How can I connect to TFS correctly in VS 2017 Community please?
A  RichTextBox is used to right justify numerals. This is the only reason to use it.

The content to save cannot be directly accessed. Looking on the web examples are found that are complex and difficult to understand. Not realizing that there is some "hoop-jumping" required to get its content, the control was selected. Does anyone know how to do this simply and if not is there any advice that will make retrieving content easier to understand?

Thank you for any advice you may offer.

Bob - NYC Department of Parks & Recreation
There is a section in an app that requires the user to type each of 5 items into a RichTextBox. Whenever a controls has focus, SelectAll is called highlight the numeral for quick edit.

--Tab event highlights on entry
--Focus event highlights

--Mouse events do not fired: MouseLeftButtonUp, MouseLeftButtonDown, MouseDown,  MouseUp, etc.

    Private Sub richtxtPerennialsCount_MouseLeftButtonUp(sender As Object, e As MouseButtonEventArgs) Handles richtxtPerennialsCount.MouseLeftButtonUp
    End Sub

Without these events when a controls is clicked the content is not highlighted.  What's needed is to highlighted so the content is deleted on first key press.

Any help is appreciated. Thank you.

Bob Cannis, NYC Department of Parks & Recreation
Horticulture Planting Counts
Published iOS app about 18 months ago using Xamarin Studio.  Now that its Visual Studio 2017, need to recreate Apple certificates and profiles and then use fastlane to install them on my Mac.  App builds fine and it runs on an iPhone attached to my Mac.  Looking for a consultant who can help me with this process.
I'm trying to get the Word Inking feature to start when opening a document.  I have tried the following code:


This throws an error on Document Open, running it from a macro and running it from the immediate window.

What am I missing?
Issue adding a local wsdl file for royal mail to visual stusio 2017 in c#.
Print screen f error attached. Invalid URI.
How do I get Visual Studio 2017 to validate <script> tags in source code with CORS attributes?

Okay, this is an annoyance rather than a life or death problem!  I am working on a website which uses externally hosted scripts in some of its pages.  The script tags have CORS attributes (integrity and crossorigin).  Visual Studio is validating the code against the HTML5 schema.  So Visual Studio is picking these up as warnings in its error list and underlining the code with green squiggly lines.

I know I can just ignore them, or turn validation off.  I'd prefer to have them recognised as valid markup.  Is there any way that I can do that?
InfoPath 2010 form submission is not saving to sharepoint 2010 site, and end user has no errors upon submission.  The .xml file does not get saved to sharepoint, how do you troubleshoot this?  I figured it was something like incorrect permissions to a site/library for the end user to save their files.  But I check an Identical user permission with someone that is able to submit and view their documents.  The user that does not work has identical permissions.  Its very strange, and there are no reported errors from the user...
Creating an SSIS app with VS 2015.  Finally have the pieces connected.  When I run it I receive the below error.

Failed to start project (Microsoft Visual Studio)


Error starting debugging. (Microsoft.DataTransformationServices.VsIntegration)

Program Location:

   at Microsoft.DataTransformationServices.Project.DataTransformationsPackageDebugger.LaunchVsDebugger(IVsDebugger iVsDebugger, DataTransformationsProjectConfigurationOptions options)
   at Microsoft.DataTransformationServices.Project.DataTransformationsPackageDebugger.ValidateAndRunDebugger(Int32 flags, IOutputWindow outputWindow, DataTransformationsProjectConfigurationOptions options)
   at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.LaunchDtsPackage(Int32 launchOptions, ProjectItem startupProjItem, DataTransformationsProjectConfigurationOptions options)
   at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.LaunchActivePackage(Int32 launchOptions)
   at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.LaunchDtsPackage(Int32 launchOptions, DataTransformationsProjectConfigurationOptions options)
   at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.Launch(Int32 launchOptions, DataTransformationsProjectConfigurationOptions options)


Unable to 

Open in new window

I'm able to pass the query parameter successfully to the field however when the item is saved the record is not being saved to the list. What's interesting is that if I manually override the passed value by typing into the field on the form and then clicking save, the record is saved to the list .

We have a working example of this on the same site for a different list that we created about a year ago and does not have this issue.

Original Code Provided when a new form was created for the list in SPD:
<SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="New" FieldName="AttachmentsID" __designer:bind="{ddwrt:DataBind('i',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@AttachmentsID')}"/>
<SharePoint:FieldDescription runat="server" id="ff1description{$Pos}" FieldName="AttachmentsID" ControlMode="New"/>

Removed the above code and replaced with the following:                                                            
<asp:TextBox runat="server" id="ff1{$Pos}" Name="FileName" Text="{$AttachmentsID}" Value="{@AttachmentsID}" __designer:bind="{ddwrt:DataBind('i',concat('ff1',$Pos),'Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@AttachmentsID')}" Width="100px" Height="20px" BorderWidth="0" />
I have just started to deploy and learn Microsoft Power Bi. I installed the BI gateway and able to get it connected in the portal.  My question is, how to i make a BI workspace that calls to that data?  DO i need the BI desktop app or can i not create that from the portal?

Microsoft Development





Most development for the Microsoft platform is done utilizing the technologies supported by the.NET framework. Other development is done using Visual Basic for Applications (VBA) for programs like Access, Excel, Word and Outlook, with PowerShell for scripting, or with SQL for large databases.