com

Use C# for Catia V5 Automation

我只是一个虾纸丫 提交于 2019-12-03 09:54:36
I want to write Macros/Programs for Catia V5 with the programming language C#. How is it possible to access the Catia applicataion via c#(and Visual Studio). I searched a bit and found out that Catia provides an API, which the Microsoft COM Technologie provides for 'COM-languages' like c# & python. This is how I imagine the connection/interaction between a C# Programm and Catia: C# - .NET <-bi-directional integration-> COM <-> Catia API Is that correct ? Also: How do I setup everything in Visual Studio , so that I can access the Catia API (and code completion etc.) Selin Raja M 1) Add INFITF

Silverlight and COM Interop

旧巷老猫 提交于 2019-12-03 09:49:42
What are my options for interacting with a COM control from silverlight? In my particular project, I have a legacy ActiveX authentication control which I would like to leverage in my silverlight application. Without too many boring details, the control takes a couple of parameters, prompts the user for credentials or tokens, and raises events. I need to set the parameters from my control, and somehow get the events' data to my control. Furthermore, I would like to get the UI to seem as homogeneous as possible. What are the best ways of doing this? IIRC, Silverlight doesn't provide any way work

Implement OPOS Device in C#

僤鯓⒐⒋嵵緔 提交于 2019-12-03 09:44:56
问题 For some interop with a legacy POS application, I was wondering if it was possible to implement a phony OPOS device in C#. Basically I would implement a phony keyboard that took web requests and passed on key presses to the legacy application. Does anyone know if this is possible or where to get documentation? I figured OPOS just called COM objects which are configured by registry keys. All of which should be implementable in C#. 回答1: Yes it's certainly possible. You can develop an OPOS SO

How to declare and implement a COM interface on C# that inherits from another COM interface?

送分小仙女□ 提交于 2019-12-03 08:52:51
I'm trying to understand what is the correct why to implement COM interfaces from C# code. It is straightforward when the interface doesn't inherit from other base interface. Like this one: [ComImport, Guid("2047E320-F2A9-11CE-AE65-08002B2E1262"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface IShellFolderViewCB { long MessageSFVCB(uint uMsg, int wParam, int lParam); } However things start to become weired when I need to implement an interface that inherits from other COM interfaces. For example, if I implement the IPersistFolder2 interface which inherits from

download a file using windows IStream

随声附和 提交于 2019-12-03 08:50:58
I'm implementing dragging a virtual file out of a website and onto the desktop with an activex control. How do I create an IStream on my http url, so Windows can execute the drop? The example I'm looking at uses SHCreateStreamOnFile to copy a local file; there must be an analogous function for other types of streams like http file download. How about using the URL Moniker Functions . You can use the URLDownloadToFile (blocking function), or URLOpenPullStream (asynchronous). 来源: https://stackoverflow.com/questions/3168145/download-a-file-using-windows-istream

How to convert BSTR to std::string in Visual Studio C++ 2010?

╄→гoц情女王★ 提交于 2019-12-03 08:50:00
I am working on a COM dll. I wish to convert a BSTR to a std::string to pass to a method that takes a const reference parameter. It seems that using _com_util::ConvertBSTRToString() to get the char* equivalent of the BSTR is an appropriate way to do so. However, the API documentation is sparse, and the implementation is potentially buggy: http://msdn.microsoft.com/en-us/library/ewezf1f6(v=vs.100).aspx http://www.codeproject.com/Articles/1969/BUG-in-_com_util-ConvertStringToBSTR-and-_com_util Example: #include <comutil.h> #include <string> void Example(const std::string& Str) {} int main() {

Call COM object method from Go without CGo

做~自己de王妃 提交于 2019-12-03 08:39:51
I have created a Direct3D9 wrapper in Go which uses CGo to interface with the COM objects in C. I would like to get rid of the dependency on a C-compiler under Windows so the user would not have to install MinGW or Cygwin to use DirectX from Go. The problem is that d3d9.dll does not expose C-functions but uses COM. The only function that can be called directly after loading the DLL (with syscall.LoadLibrary("d3d9.dll") ) is Direct3DCreate9 . This returns a COM object which exposes all functionality as methods. How can I call COM object methods in a DLL from pure Go without CGo? I know of the

C# - Hook into existing COM object

你说的曾经没有我的故事 提交于 2019-12-03 08:33:08
Say we have an existing process (or application) that calls a COM object from an ocx file such as "MyCOMLibrary.ocx". Is there a way to write a C# library to exactly replicate the ocx file? So that the original application can call your C# code rather than the original COM object? You would, of course, have to use identical CLSID and ProgIDs as the original ocx. And assuming there is no signing involved, such as a SNK in the .Net world. Also, are there any tools that exist to automate this? Something that takes in an ocx and spits out a C# file with methods to implement. EDIT: I want to add

Get a screenshot from an ASP.Net page

左心房为你撑大大i 提交于 2019-12-03 08:18:53
I have an ASP.Net page that has a button that when clicked I would like to take a screenshot of the user's PC and send it to a server. I'm ok with writing some sort of listener program to run on the server to accept requests to receive these images. Where I'm a bit hazy is the best way to get the user's PC to send the screenshot. Would this need to be done by writing some sort of Active X control for the ASP.Net page? It needs to be cross browser and operating system if possible. Just a point in the right direction and what technologies I should use would be great. I would rather write this

Creating directories during a copy using IFileOperation

心已入冬 提交于 2019-12-03 07:54:44
Using Stephen Toub's IFileOperation wrapper for C# ( link ), which has been working well until now. Now I am trying to do a copy to gather files from network locations, each network location into its own subdirectory. \\FOO\data into C:\gather\Foo_data \\BAR\manage\current into C:\gather\bar\manage And so on. The problem is in FileOperation.CopyItem . It must be because the destination directory doesn't exist yet— IFileOperation will create it during the copy, right? I used the technique from another question and changed Toub's FileOperation.CreateShellItem to this: private static ComReleaser