com

Matlab Actxserver :How could I terminate process opened by actxserver in matlab

痞子三分冷 提交于 2020-01-21 05:54:00
问题 I want to open and close an Excel file in MATLAB. I have tried the code below, but it failed on closing process with actxserver h.WorkBooks.Item(wbkname).Close; here is my code for this issue, how can I terminate the excel file? .Quit .delete I also tried to close excel file via VBA sub-module, but it gives me an error message: fullFileName = [pwd '\KOSPI200_1월.xlsm']; excel = actxserver('Excel.Application'); file = excel.Workbooks.Open(fullFileName); excel.Run('jongho_bot_initial'); excel

Memory Layout difference between nested classes and multiple inheritance in C++?

此生再无相见时 提交于 2020-01-20 06:52:42
问题 I am trying to understand how COM specifies the layout of its objects so that a client that wants to use a COM object knows how to do it. I've read that a COM object that implements multiple interfaces can do it it in different ways including using nested classes or multiple inheritance. My understanding is that both techniques would have to produce the same memory layout (conforming to the COM spec) so that a client that wants to use the COM object (for example in C), knows how to do it. So

How do I prevent programmatically the “Program Compatibility Assistant” in Vista (and Windows 7) from appearing?

喜欢而已 提交于 2020-01-20 06:07:29
问题 I develop a C++ program which might use adobe flash, although it is not essential. I use CoCreateInstance to create the flash object, and if it fails, I know flash is not installed so I don't use it. However, in Vista (and I think Windows 7 as well), when flash is not installed, after leaving the application, the "Program Compatibility Assistant" pops up a message saying that "This program requires a missing Windows component" specifying the flash.ocx. Is there a way to prevent this message

How do I prevent programmatically the “Program Compatibility Assistant” in Vista (and Windows 7) from appearing?

◇◆丶佛笑我妖孽 提交于 2020-01-20 06:03:49
问题 I develop a C++ program which might use adobe flash, although it is not essential. I use CoCreateInstance to create the flash object, and if it fails, I know flash is not installed so I don't use it. However, in Vista (and I think Windows 7 as well), when flash is not installed, after leaving the application, the "Program Compatibility Assistant" pops up a message saying that "This program requires a missing Windows component" specifying the flash.ocx. Is there a way to prevent this message

Trying to do Office Automation with Excel 2007, but keeps using Excel 2003

安稳与你 提交于 2020-01-20 02:43:36
问题 Environment: Windows XP machine Both Excel 2007 and Excel 2003 installed (in that order, not chronologically). C# 3.5 Problem: When I use the PIAs to do some Office automation, I use the following line of code: var excel = new ApplicationClass(); The PIA's version specifically refers to it as Excel 12. C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Excel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll But: excel.Version;//this is 11.0 instead of 12.0 Thus, when I try to open a

Trying to do Office Automation with Excel 2007, but keeps using Excel 2003

拟墨画扇 提交于 2020-01-20 02:43:05
问题 Environment: Windows XP machine Both Excel 2007 and Excel 2003 installed (in that order, not chronologically). C# 3.5 Problem: When I use the PIAs to do some Office automation, I use the following line of code: var excel = new ApplicationClass(); The PIA's version specifically refers to it as Excel 12. C:\WINDOWS\assembly\GAC\Microsoft.Office.Interop.Excel\12.0.0.0__71e9bce111e9429c\Microsoft.Office.Interop.Excel.dll But: excel.Version;//this is 11.0 instead of 12.0 Thus, when I try to open a

Intermittent Error (System.TypeInitializationException: Type constructor threw an exception ) passing data to word addin from wpf app

我的未来我决定 提交于 2020-01-17 08:30:33
问题 WE have a WPF application which will launch a word and then pass some information to a VSTO Application addin. I have written the code as has been explained here We defined the interface and the implemtation as follows [ComVisible(true)] [Guid("B523844E-1A41-4118-A0F0-FDFA7BCD77C9")] [InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface IBridge { /// <summary> /// Loads a task /// </summary> /// <returns> </returns> string Load(SomeDTO dataTransferObject); } [ComVisible(true)]

How do I write to the VB6 immediate window from C++ based COM object?

谁都会走 提交于 2020-01-17 05:04:32
问题 I have developed a C++ based COM object to use it in a VB6 application. Now I need to add some logging to catch some of the bugs. I discovered from the answer to 'How to debug COM object in Visual Studio 6.0' question that I can use the OutputDebugString function. But is it possible to write to the VB6 immediate window somehow? 回答1: Rather than attempting to write to the immediate window, it would be generally more useful to use DebugView from Sysinternals (now part of Microsoft technet):

IronRuby: Cannot call method on a COM Object with one or more arguments

雨燕双飞 提交于 2020-01-17 03:34:27
问题 When I try and call any method on a COM Object that takes one or more arguments, I get the following error on the last argument: Could not convert argument 0 for call to Open. (ArgumentError) Everything works fine when calling a method that takes no arguments, or getting/setting a property. Here is the code that gives me the error above: def new_com_object(prog_id) System::Activator.CreateInstance(System::Type.GetTypeFromProgID(prog_id)) end xls = new_com_object('Excel.Application') xls

Convert BSTR to CHAR* and CHAR* to BSTR in C

放肆的年华 提交于 2020-01-16 19:24:46
问题 I have to convert a BSTR to CHAR* datatype in C. Is there anyway to do this without using VC++ libraries or functions. The code has to be in pure C. I think 'comutil.h' has got functions but they are in C++ I suppose. Also, about the SysAllocString function, can we use it in C and convert to CHAR*?. Please help. Thanks, sveerap 回答1: You can go from a char* to a BSTR with SysAllocStringByteLen(). But this is only safe if the char* contains only ASCII characters, no character conversion takes