com

Is Microsoft.SmartDevice.Connectivity properly COM-registered?

I'm trying to use the Microsoft.SmartDevice.Connectivity library to talk to a windows phone 7 device, but whenever I try to create a DatastoreManager (which is the first step) I get a COMException about guid {250BEABB-55E8-43BB-AC97-2D95674ECE14} (which corresponds to the Microsoft.VisualStudio.DeviceConnectivity.Interop.ConManClass type...

Download Manager for Internet Explorer in C#

Hello, I want to override internet explorer download manager function. I've managed to implement IDownloadManager interface in c# and registered COM, so that i can catch the download event and perform custom action. I also have existing download manager application. My concern is whether the IDownloadManager implementation should be par...

Regasm fails if assembly depends on other assebmly not located in the same folder

Consider following scenario I have 2 assemblies Assembly named A.dll located in folder Fold_A Assembly named B.dll located in folder Fold_B A.dll depends on B.dll and A is COM visible when I'm performing comand regasm A.dll /codebase it fails , but when B copied into fold_a - the command succeeded The question is : Is there some wa...

Win32_WindowsProductActivation SetProductKey with python

I am trying to use the SetProductKey method of Win32_WindowsProductActivation to set the windows xp key for a custom need of mine as per the second Microsoft vbs script here :http://support.microsoft.com/kb/328874. No matter what method i use i always get shut down. I have tried wmi: import wmi c = wmi.WMI() c.Win32_WindowsProductActiva...

Problem reference a com assembly dll

I have a problem. When I import a COM dll (VB6) in my C# application, All is fine. It compiles and works. However when I use the app on an other PC, I have an error message : Unable to cast an object to COM type Installation.VB6FenetreClass Installation._VB6Fenetre interface type. This operation failed because the QueryInterface cal...

InvalidCastException when setting up handler for COM event

I have an unmanaged C++ COM server that is setup to fire events, and i am trying to handle these events from my C# app. However, I get an InvalidCastException when setting up the handler myCOMObj.MyCOMEvent += new MyCOMSource_MyCOMEventHandler(handler); The stack trace shows: Specified cast is not valid. at System.Runtime.Inter...

Example project with a C++ COM client that talks to a C# COM server?

Hi all, I'm stuck: I just can't get my head around how to access C# methods from C++. I've got as far as working out that you need a COM server, but none of the code I've tried works. Can anybody point me in the direction of a working project that demos how C++ can call methods from a C# library, using COM or otherwise? ...

php open excel file in browser

Hi, how to open excel file in browser , i dont want some thing like force download dialog , i want to open excel in browser somthing like in gmail when u click the excel file in the inbox, it will show browser itself, same like , how to do in php. ...

Table padding using the MS Word COM object in PHP

Hi guys, I've got some code here that will create a basic table in a Word document using PHP, it creates the table and populates it just fine, but I really need to kinda shunt the table across so that the address (first box of the table) fits into a windowed envelope! $word->ActiveDocument->Tables->Add ( $word->Selection->Range, 1,...

Create COM DLL from Unmanaged C++ LIB

I have followed the steps here to create a COM DLL in Visual Studio 2008. My objective is to wrap an existing unmanaged C++ .lib. Is there an easy way to implement the COM interface for the lib. Or do I just have to keep adding ATL simple objects which essentially wrap the objects in my library? For example, I have added the simple AT...

Migrating ActiveX Component from VC++6 to VC++2008 giving errors in cstdio and xiosbase

I am trying to port VC++6 code which builds an ActiveX component to VC++2008. Whenever I use "#include", it is giving me errors which point to cstdio and xiosbase. I dont understand the reason for it, Can someone let me know why this is happening? Error trace: c:\Program Files\Microsoft Visual Studio 9.0\VC\include\cstdio(34) : error C...

VB6 IDE Is Locking The Loaded Project's DLL

I'm responsible for maintaining legacy VB6 code, and have encountered an annoying problem with regard to the locking of a project's COM DLL. (We'll call it MyProject and MyProject.dll) When I load MyProject into the VB6 IDE, I am able to compile the resulting binary-compatible DLL MyProject.dll. I can then run my (Classic ASP) web appli...

Detecting the use of HRESULTs as bools

We have a big body of code that was refactored so that stuff which was plain-old C++ is now COM. I've been spending the last couple of days hunting out places in which we missed the fact that a function that previously returned a bool now returns an HRESULT (the problem is compound by the fact that S_OK == false). Is there a way to det...

Wix: COM registration with heat or ComPlusExtension?

We build our setups with Wix. We have a mix of native and .NET components, and use COM for interop. Until now, I have used heat.exe to generate wix fragments for installing .NET assemblies and registering them as COM servers. The wix fragment created by heat takes care of writing the COM related registry entries. However, somebody just...

Adding includes causes compilation error

Compiling with Visual Studio 2005, on Windows XP. I add the following headers to my "stdafx.h" file like so: #include <atlbase.h> #include <atlcom.h> #include <atlcore.h> #include <atlstr.h> (technically the same error appears with just atlbase.h included) which produces the following errors: error C2334: unexpected token(s) precedi...

How are STA COM components handled when used in a WCF service hosted in IIS (7+)?

From what I understand, when a COM component marked as using STA is used from a MTA thread, the calls are supposed to be marshalled to an STA thread and executed from that dedicated thread. In the case of a Windows client application, this would mean that it would execute on the UI thread (if marked as STA), and that callbacks from the C...

How can write a C function in a C# code.

I want to add a C file into my .NET application. How can I built this? How can i write unmanaged code in C#. Can someone explain with few lines code. Thanks ...

COM method call fails in C#, VB.NET, but works in Python

I'm having trouble with a COM library I'm trying to use. I get an ArgumentException when I call a particular method and pass it null. This happens to me in both a C# project and a VB.NET project (I call the method using Nothing) where I added the library reference from the "COM" list in Visual Studio 2008. When I call this same method...

How to distinguish different types of NaN float in Python

I'm writing Python 2.6 code that interfaces with NI TestStand 4.2 via COM in Windows. I want to make a "NAN" value for a variable, but if I pass it float('nan'), TestStand displays it as IND. Apparently TestStand distinguishes between floating point "IND" and "NAN" values. According to TestStand help: IND corresponds to Signaling NaN ...

COM Exception trying to get Presence from Office Communicator 2007

I am building a proof of concept on a new box that has been set up with Windows Server Standard running IIS 7. The task I need to do is take the logged in user and using Office Communicator 2007 check for the presence (and type of presence, online, offline, away, busy etc) of other users on the exchange box on the same machine. The cod...