com

name mangling with def file and extern "C"

Hi, I'm creating a basic COM component so I can practice creating them. I'm exporting DllRegisterServer, DllUnregisterServer,DllGetClassObject and DllCanUnloadNow from a .def file with the PRIVATE keyword(I think Microsoft requires it). Anway, I specified all 4 functions with extern "C" and yet I'm still getting mangling. Here is my ....

Is it possible to write an ActiveX control in C# .NET CF for windows mobile?

We have a piece of legacy code in C# .NET, targetted for the Compact Framework. We would like to turn this code into an ActiveX control, which has to run on the .NET Compact Framework under Windows Mobile 5. Is it possible to implement such a control? If so, can anyone provice a good resource that explains how this can be done? I have a...

C# Outlook 2007 COM interop application does not exit!

Any ideas why the following code does not exit the Outlook 2007 process created via COM interop? Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application(); var item = app.Session.OpenSharedItem("C:\\test.msg") as Microsoft.Office.Interop.Outlook.MailItem; string body = item.HTMLBody; int att ...

Need message from ActiveX that runs in a thread

I have an activex control, that I developed myself. The activex runs in a thread to make sure that IE doesn't freeze when its executing the long task. The long task is pretty much looping through 32K rows. Now while its looping I would like to display a message to the IE user notifying him about the row position. That way the user can se...

C++ COM C# Mixed Mode Interoperation

I'm trying to understand my options for calling a C# library implementation from unmanaged C++. My top level module is an unmanaged C++ COM/ATL dll. I would like to integrate functionality of an existing managed C# dll. I have, and can recompile the source for both libraries. I understand from reading articles like this overview on MSD...

How to invoke Java methods through COM

I have a classic ASP/VBScript application that needs to call methods in a Java class. I discovered two products that apparently can do this: Java2COM and Java COM Bridge. Can you recommend one from experience, or is there yet another mechanism by which we can do this which is better? I'd rather avoid having to write C++ code if possible,...

Excel Automation works very slowly!

Hello, On my computer report is generated in about 3-4 seconds, and it was like this on all computers before. But recently on a couple of computers in the office report generating started to take 30-40 seconds. On other computers it is still fast. I tried to reinstall MS Office with no luck. For example, this code takes !!! 3 !!! seco...

Integrating Qt GUI code into C#

I have to develop a plug-in for an external program using C#. I am an experienced Qt/C++ programmer and the core of the plug-in is programmed in C++. My first idea was to program GUI in C#, which write settings to a text file and then call the core C++ code, as an external process, with this textfile as an input. However I also noticed...

MsBuild Task: Register Com Component on remote/deployed-to machine?

I am currently still fiddling with our msbuild & deployment script and one of the steps is to register a (legacy) com component on the machine the code is deployed to. Is there any 'elegant' way to accomplish this or would I have to call the regsvr32.exe via wmi on the remote machine? ...

Who am I? How to use Microsoft Office Permission/UserPermission

Microsoft Office documents, im my case: PowerPoint presentations, can have restricted permissions. How can I find out, programmatically, which permissions my code has on a given document? All I can find on MSDN on this topic is this: http://msdn.microsoft.com/en-us/library/aa432118.aspx If I run the following code, I get a list of user...

How can call instance by COM?

I try to call skype instance by COM on F#. A aim is get mood message. test.fs // Import skype4com Api open SKYPE4COMLib type SKYPE4COM = new() = new SKYPE4COM() let GetMood = let aSkype = new SKYPE4COM mood <- aSkype.CurrentUserProfile.MoodText mood But when build(before too),error occur. Incomplete structured...

Why should I learn COM?

Hello, Lately I'm hearing much about COM at my work. I also learnt that COM is old. COM is deprecated. There is no future for COM. Are these true too? I'm want to learn COM because I want to know what is the big fuss about it, but I'm unable to convince myself that this is a solid reason for spending so much time and learning it. So,...

basic playback with programmatically created windows media player

I was trying to "just quickly integrate" the Windows Media Player via COM to play single files from the local file system or http sources - but due to the sparse documentation and online resources to its usage when not embedding into some kind of an Ole container, i couldn't get that supposedly trivial use-case to work. Initialization e...

Does RTLCopyMemory work in Vista?

I've noticed that RTL*Move*Memory seems to work just fine. But when I try to use RTL*Copy*Memory I get: "Can't find DLL entry point RtlCopyMemory in kernel32". Here is my declare: Private Declare Sub CopyMem Lib "kernel32" Alias "RtlCopyMemory" ( _ ByVal dest As Long, _ ByVal source As Long, _ ByVal bytLen As Long) ...

C# WinForms control in .Net COM Server won't redraw

Hi everyone, I have a COM server app which uses some WinForms controls which, frankly, do not seem to be redrawing when their properties (Text, BackColor, etc) are changed. I have tried invoking txtControlName.Invalidate() as well as .Update() and neither seem to be affecting anything. It is a business requirement that we stick to .Ne...

What does `Exporting a function from a DLL` mean?

I don't know much about dlls. I'm reading a book on COM. In which author is referring to something Exporting a function from a DLL. He tells how to do that but he doesn't tell what is it or why it should be done? The method he suggests is: a) mark function with extern "C" (don't know why?) b) create a DEF file and add the function names...

Is the IShellItemImageFactory interface, used for getting Vista/7 shell thumbnails, broken?

I want to use IShellItemImageFactory to retrieve the shell thumbnail of files. According to the MSDN docs, if I pass in a SIZE struct of 256x256, it should populate the HBITMAP parameter with a 256x256 bitmap, and if I use the SIIGBF_RESIZETOFIT flag, it should resize smaller thumbnails to 256x256. It doesn't. Instead, the result is a 25...

How to get IDispatch information from a variant property in a Delphi com object in VBA?

I have a COM object written in Delphi that has a property that returns a variant. Basically this property returns a value depending on the parameter I pass it. When I access the object from VBA (Excel for example), I can write something like : MyObject.MyProperty("IntProperty") = 22 Now the property can also return an IDispatch object...

Out of Memory errors - tool for finding classic ASP memory leaks?

I am getting Out of Memory errors in classic ASP, probably where attempting to access data. For example: Microsoft VBScript compilation error '800a03e9' Out of memory (some file) Line 0 These errors only happen once in a while and they keep happening for a few minutes and then the webserver must be restarting the app pool because al...

Windows Server 2008 and com objects

Hi, im moving a Dll (built in c++) from windows 2000 server to a 2008 server but im have some trouble to register it. In 2000 all you normaly have to do is a "regsrv32 name.dll" but this will not work in 2008 because you get a pointer error, iv also tried to use "gacutil /i name.dll" because someone told me this might work, but it didnt....