i've encountered a problem when tried to add chart to PowerPoint in C++
AutoWrap(DISPATCH_METHOD, NULL, pShapes, L"AddChart", 0);
It throws "0x80020009 Exception occured" error. That code works for AddTable, AddTextbox etc.
I think you'll find help here:
http://support.microsoft.com/kb/222960
Note: Not all functions available in Office are available through ole in C++. AddChart may not be supported. If you can, look at using COM to call a managed dll. It is much easier. You will get full support when you add references to Powerpoint in .NET.
MDSN Interop Documentation:
http://msdn.microsoft.com/en-us/library/ms173184.aspx
I've managed to resolve the problem. There are two solutions:
-have PowerPoint opened in background
-make powerpoint visible when creating instace of it (by default it's invisible)
I don't know why it must be done this way, but it works :)
Related
Im trying to make (what I thought was a simple) extension for Game maker studio 2.
I am restricted to making a DLL app.
I am wondering is there any was to have a dll app open the file explorer have the user locate a file and then return said directory?
I fell like this is a sumb question but one I really need to know the answer too before slaving away coding for hours only to find its not possible.
You do not want to launch the explorer but to open a file dialog that allows the user to select a file.
Depending on the framework you use in your program the solutions may differ.
If you are using Qt framework you may use a QFileDialog for a platform independent mechanism.
If you are okay that it will only works on Windows then you may directly use the WinAPI functions GetOpenFileName or GetSaveFileName (that is a lot easier than the Common Item Dialog that is suggested as replacement on their documentation pages)
On GameMaker terms, you want to use get_open_filename or get_open_filename_ext.
See Dialog Module (marketplace, github) for C++ implementation reference.
I'm just taking my first steps in the Visual Studio 2008 / C++ world, and I do so by trying to create a new CTI Connector for Salesforce. I managed the first part without too much hassle, so now I have an almost-functional CTI Connector. There's only one, but vital part missing: The actual connection to the Call Center system.
The manufacturer provides a .NET integration DLL that also provides a COM interface. I've successfully used the COM part before in Delphi (my native environment...) and I wouldn't mind to use the COM approach here as well, though using the .NET interface seems a bit more natural to me.
Now I do have an ATL project created in Visual Studio 2008 SP1, providing a COM interface to the Salesforce side of the connection.
I do also have a .NET dll providing the interface to the Call Center, and a registered COM object that does the same.
What I don't have is the slightest idea how to get this into my C++ project.
From my Delphi experience I was expecting Visual Studio to have some Import feature that automagically builds a class around the integration object in order for me to simply use it, but obviously there isn't, at least not for ATL projects. Changing the project type to something else is currently not an option, as this is the documented way to interface Salesforce.
I found some hints to simply include the .tlb in a .cpp file in order to use the COM object, and doing so does indeed help IntelliSense to recognize the Namespace and Classes of this object, but this is where I'm stuck.
So my qustions are:
Am I required to create the methods and events provided by the .NET dll / COM object manually, or is there a simpler way to get them automatically?
If manual creation is required, how do I access the Event interface of the integration object?
How do instantiate the integration object, and do I have to do so at all?
Until now, I've created a class called CAgentIntegration. In the .cpp file I import the typelib provided with the DLL (AgentIntegration.dll and AgentIntegration.tlb), both files are present in the source folder of my project.
In the constructor of CAgentIntegration, I try to somehow access the imported object. IntelliSense obviously recognizes the Namespace AgentIntegration, because it offers the AgentClient class as code completion. It is the part after AgentClient of which I have no idea. The example below clearly doesn't work because the compiler complains that to the left of -> a class or struct is required.
#include "StdAfx.h"
#import "AgentIntegration.tlb"
CAgentIntegration::CAgentIntegration(void)
{
AgentIntegration::AgentClient->Initialize();
}
CAgentIntegration::~CAgentIntegration(void)
{
}
The following image is from Object Browser in Visual Studio, after adding the .tlb to it. Maybe this helps to better understand how things are arranged inside the DLL.
Please bear in mind that this is a qustion from someone who doesn't even know the correct syntax to include the integration object into the project, so the answer may be way less complex than you may assume - it would probably be enough to just provide a short code sample that I can use as a template to start from. On the other hand, "just use #import" as an answer would not help me much because I don't know how to use it ;-)
Thanks in advance
Patrick
When using SearchBox in Windows 8.1, on SuggestionsRequested event there is ability to separate results if they can be grouped with the help of AppendSearchSeparator.
But I can't find something similar for grouping in AutoSuggestBox.
How can grouping of search(suggestion) results be implemented/applied in AutoSuggestBox for UWP ?
It is strange, in MSDN it says (https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn301949.aspx)
SearchBox is no longer available for use as of Windows 10. Instead, use AutoSuggestBox.
So I tried to use a AutoSuggestBox in a UWP app, as it said here (https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn919949.aspx), there should be a event: onsuggestionsrequested, but in XAML, I didn't find it either.
So, I tried to find a new event in which the SuggestionsRequested event can be used, but I failed.
Finally, I downloaded a sample code of a Windows 8.1 SerachBox here(https://code.msdn.microsoft.com/windowsapps/SearchBox-control-sample-0f64f94d), and ported it to a UWP app, the result is, the SearchBox can still be used in a UWP app.
Maybe there is a event of AutoSuggestBox for this, I just didn't find it. This is a good question I think.
I am new to XLL development. I downloaded 2010 XLL SDK and was able to build the example in VisualC++ 2012. When I load the xll in Excel2010, I am seeing the popup with "thank you ..." message and I am seeing all the functions exported from the example in Excel, so it seems everything is loaded successfully.
But, the xlcalert does not work in most of the functions. I am only seeing popup dialog from xlcalert in xlAutoAdd and xlAutoRemove. I even modified EvaluateExample() function to just do:
Excel12f(xlcAlert, 0, 2, TempStr12(L"Finished EvaluateExample"), TempInt12(2));
When I run the function, I don't see popup. What am I missing? I can't seem to find much references to xlcalert.
Thanks in advance
If you are new to XLL development, do yourself a favor and use http://xll.codeplex.com.
Your example would be ExcelX(xlcAlert, OPERX(_T("Finished EvaluateExample")), OPERX(12))
The code will work with either the old or new SDK.
For everyone looking for the answer for this question - one can find it here:
https://social.msdn.microsoft.com/Forums/office/en-US/6951ef0a-a66a-489a-b0da-9516667bffa9/xlcalert-in-xll-example
Long story short:
You also see 1 in the cell if you use it as a function for cell. However if you run it as a macro via Application.Run "xlGetNameExample" you will see the dialog. I think your issue is similar like it. Please try it. Let's see whether you can see the prompt.
I'm trying to write a dll plugin for Winamp. I'm using Microsoft Visual Studio 2008 and Microsoft SAPI 5.1. I created the interface window using Windows Form (System::Windows::Forms::Form).
I tried to use SetNotifyWIndowMessage(), but the method is never called when I speak to the microphone. So I tried using SetNotifyCallbackFunction(), but I got a compile error saying that I should use '&' in front of the method name in the parameter. However, when I add the '&', I got another compile error saying that i can't take the address of the method unless creating delegate instance.
What should I do? Someone please help me..
Well, as indicated, you need to create a delegate instance to wrap your callback. But don't go there, SAPI 5.1 is quite outdated. Updates are no longer shipped because the .NET framework has a very nice wrapper for it. Check out the System.Speech.Recognition namespace and the SpeechRecognitionEngine class. You'll want to use the SpeechRegonized event. You'll find plenty of code samples in the MSDN Library pages for the class.