com

How do I return an array of strings from an ActiveX object to JScript

爷,独闯天下 提交于 2019-12-07 05:19:48
问题 I need to call into a Win32 API to get a series of strings, and I would like to return an array of those strings to JavaScript. This is for script that runs on local machine for administration scripts, not for the web browser. My IDL file for the COM object has the interface that I am calling into as: HRESULT GetArrayOfStrings([out, retval] SAFEARRAY(BSTR) * rgBstrStringArray); The function returns correctly, but the strings are getting 'lost' when they are being assigned to a variable in

Debugging a crash while unloading DLL in Win 10, but not Win 7

自闭症网瘾萝莉.ら 提交于 2019-12-07 05:01:27
Not totally sure that I've got this problem nailed down yet, but here's what I'm seeing and what I think is going on. I have a Win32 program mostly written in C that loads a C++ DLL. That DLL passes data from the C program to another application via a COM object--one that's probably instantiated by the DLL itself. All of this has apparently worked fine through at least Windows XP and Windows 7 (possibly Win95 and Win98, I'd need to look back deeper into the code history to find out when this interface was introduced), but in Windows 10 the program crashes during the FreeLibrary() call for this

Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a

 ̄綄美尐妖づ 提交于 2019-12-07 04:50:20
问题 Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a. We are getting above said error from our production server which is hosted in SharePoint farm environment, where as not able to reproduce the same issue from our staging server which is standalone server. I hope, the above said error will be throwing when Microsoft.Office.Word component accessing from remote machine. I've updated all users under "Launch

Microsoft objects, the Release() functions return value?

橙三吉。 提交于 2019-12-07 04:48:28
问题 I'm curious because I couldn't find out about this on MSDN. I've found the Release() function is present in various COM objects which I'm obviously supposed to use for deleting pointers. But I'm not sure what does it return exactly? I used to think it would return the number of references which still exist to the object remaining, therefore something like: while( pointer->Release() > 0 ); Would obviously release all references to that pointer? Or am I not seeing something? *note I'm talking

How do I use iFileDialog in a VC++ 2010 project converted from VC++ 6.0?

若如初见. 提交于 2019-12-07 04:46:32
问题 I am able to use a FileSaveDialog (Common Item Dialog) in a VC++ 2010 app like this: IFileDialog *pFileDialog; HRESULT hr = CoCreateInstance(CLSID_FileSaveDialog, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pFileDialog)); but when I put this code into my project that has been converted from VC++ 6.0 to VC++ 2010 I get the following error: "error C2787: 'IFileDialog' : no GUID has been associated with this object" I also get a red squiggle under the IID_PPV_ARGS macro and the float-over error:

Delphi 2007 using Windows Imaging Component (WIC)

谁都会走 提交于 2019-12-07 04:41:11
问题 I need to read and convert some pictures around 1.7mb from jpg to bmp in Delphi 2007. Some pictures are cut out, grayscale or worst after conversion. I searched, but in no way i found a trick to add WIC routines like TWicImage in delphi 2007. I read somewhere that it can be easily added via COM, but I do not know how or what file has to be imported. Thank you. 回答1: Here is an example how to convert JPEG to bitmap using WIC: unit Unit1; interface uses Windows, Messages, SysUtils, Variants,

C# Com Interop with Windows Media Player Visualisation (With Sample Code)

非 Y 不嫁゛ 提交于 2019-12-07 04:41:01
问题 I am attempting to create a Windows Media Player (WMP) Visualization plugin in C#. I am quite new to exposing C# to COM and may have missed something basic. I have persisted with this for 3 days (about 20 hours) and not got past the single issue I will describe below. For those who don't know, WMP visualizations are the pretty images that show in media player while listening to music. In a nutshell : WMP will call certain methods on my C# COM interface, but not others. I have WMP 11 installed

How to return positive error code from ATL to VB6?

有些话、适合烂在心里 提交于 2019-12-07 03:58:47
问题 I have checked out the answer at: How can I return both an error string and error code to VB6 from an ATL activex control? I am able to return custom negative error codes, ie with the severity bit set, and a custom error message. But, I would like to be able to generate a code that VB6 will present as a positive # for Err.Number that the user will find easier to use. I'm pretty sure that it can be done since Microsoft's DAO 3.6 DLL is able to. For example, it returns Err.Number= 3078 with Err

HOWTO: Call Managed C# Interface From Unmanaged C++ On WindowsCE Compact Framework

十年热恋 提交于 2019-12-07 03:54:25
问题 I have extensive unmanaged Windows CE 5 C++ code that provides a UI that I want to use in a new product by combining it with a large amount of newer business and communications logic written in managed C# on Windows CE 6 and the Compact Framework. The UI may know about the business logic, but I want the business logic ignorant of the UI such that I can later replace it with a managed version, or any other UI that I choose as a front-end. I found an article that describes how to use COM as the

GAC – Assembly is in the GAC but “Could not load file or assembly”

て烟熏妆下的殇ゞ 提交于 2019-12-07 03:47:58
问题 I have an Interop dll that was generated by Visual Studio for a third-party COM object that I am consuming in a .NET dll. I have registered both my consuming dll and the Interop dll in the GAC. I have to use the GAC because these DLLs are being used by a SharePoint 2010 workflow. When the execution gets to the point where my dll calls the Interop dll the following error was thrown” “Could not load file or assembly” … “The system could not find the file specified” together with the expected