com

COM object to create a “Open File” dialog under Vista?

浪尽此生 提交于 2019-12-11 02:24:39
问题 I would like to use the Windows Common Dialog "Open File", to get a file from the user under JScript. This used to be possible using "ShowOpen()" on MSCOMDLG.commondialog object but, I can't find an equivalent way to do this that works under Vista. 回答1: Try this: http://www.tech-archive.net/Archive/Scripting/microsoft.public.scripting.vbscript/2007-10/msg00444.html Helps? 回答2: You could probably fake it by using CreateObject("Shell.Application").BrowseForFolder( ... ) and use the BIF

Is there a way with MIDL to turn off C-style headers generation?

无人久伴 提交于 2019-12-11 02:18:44
问题 I have a simple .IDL file (iface.idl) which describes an IUnknown based interface: import "unknwn.idl"; [ uuid(80DFDD28-F033-431e-B027-CDD2078FC78A) ] interface ISunPathCalc : IUnknown { HRESULT Square([in, out] long * pVal); HRESULT Cube([in, out] long * pVal); }; When trying to compile it with midl /header iface.h iface.idl I'm getting 3 files: iface.h, iface_i.c and iface_p.c. The iface.h file contains a C++ declaration of ISunpathCalc interface: #if defined(__cplusplus) && !defined

How to Consume COM Server (ATL, DLL Surrogate) in .NET C# WinService?

岁酱吖の 提交于 2019-12-11 02:16:43
问题 I have a DLL Com Server, actually used only by one old Delphi exe-application. COM Server is written many years ago (not by me) in C++ ATL. It implements callbacks (event - is it the same?) - using outgoing interface IConnectionPointImpl . Class Factory is singleton (marked with DECLARE_CLASSFACTORY_SINGLETON ) Now it is required that this COM Server have to be shared between more than one clients: both Delphi and C# (.NET 2.0, VS2008). I put it as DllSurrogate and now I can use it from

Error when reading audio file?

女生的网名这么多〃 提交于 2019-12-11 02:16:07
问题 I have the following function that I am attempting to use to determine the length of an MP3 file: public static string GetMP3DurationBackup(string Filename) { string Duration = null; WMPLib.WindowsMediaPlayer w = new WMPLib.WindowsMediaPlayer(); WMPLib.IWMPMedia m = w.newMedia(Filename); if (m != null) { Duration = m.durationString; } w.close(); return Duration; } I have run into an issue where I get the following error: Retrieving the COM class factory for component with CLSID {6BF52A52-394A

How to Query the COM Apartment State for the Current Thread

吃可爱长大的小学妹 提交于 2019-12-11 02:15:51
问题 The .NET Thread class has a handy function GetApartmentState() that returns the apartment of context of the thread. Is there a similar Co<something-something> function for native code (C++, C)? I feel like I should know, since I've been programming COM for almost 10 years, but I cannot find the answer. 回答1: The function you're looking for is CoGetApartmentType. 来源: https://stackoverflow.com/questions/15981228/how-to-query-the-com-apartment-state-for-the-current-thread

COM Registration and the GAC

陌路散爱 提交于 2019-12-11 02:06:48
问题 I have a web project, a C# library project, and a web setup project in Visual Studio 2005. The web project needs the C# library needs to be registered in the GAC. This is simple, just add the GAC folder to the setup project and drop the primary output of the C# library in there. The C# library also needs to be registered for COM interop. I click select the primary output in the GAC folder and change the Register property to vsdrpCOM. I build the setup project and run it but the DLL never gets

Register com dll for use by vba

戏子无情 提交于 2019-12-11 01:57:29
问题 I have a very basic question. I have developed a com dll to be used from Access vba. Works great on my development machine. On a test machine I get the "error -2147024894 (80070002) Automation Error System can't find the specified file" msg when I run the Access application. When in design view the dll is referenced and all the objects and properties show up in the vba ide. I am wondering if I am using the wrong regasm to register the dll? I develop on a 64 bit machine using VS 2010. I

COM+ invoking method in remote instance Unknown name error

邮差的信 提交于 2019-12-11 01:39:20
问题 I have a COM dll which I was using in my .net project through interop referance. Now I got a requirement to move this COM component to another remote machine and create instance there.(kind of out of machine similar to out of process, probably this is remoting, i don't know :-)) What I have done was created a new COM+ applciation in server machine. Added this component inside this app. This is how it is listed in COM+ interface on server. Exported this app as proxy insatller and installed in

How to register a 64-bit COM dll on 64-bit Windows 7?

那年仲夏 提交于 2019-12-11 01:38:02
问题 I'm trying to register an x64 COM server dll for use in x64 office on x64 windows 7. I have followed the instructions here but I cannot register the dll. When I attempt to I get the following error: The command I use is regsvr32 my_x64_com_server.dll Why is this happening and is there a workaround? Thanks in advance. 回答1: How is the command being run? From a process or from a command line? Make sure the command is being run from a 64-bit process (or a 64-bit cmd.exe console window). Otherwise

Alternative for .NET's System.Convert within VBA

会有一股神秘感。 提交于 2019-12-11 01:32:47
问题 I'm writing a VBA function in Microsoft Access to Encrypt / Decrypt text data using RSA keys. The following works currently: CreateObject("System.Security.Cryptography.RSACryptoServiceProvider") CreateObject("System.Text.UTF8Encoding") but this is not working: CreateObject("System.Convert") I did some research and came across this stackoverflow question: Can I call a static method of a C# class from VBA via COM? So as it turns out, System.Convert is a static class so therefore it is