interop

Debug info hidden when calling C++ function from C# (VS2013)

蹲街弑〆低调 提交于 2019-12-13 07:44:14
问题 I have a VS2013 solution which consists of 2 projects: a C# project and a C++ (CLR/DLL) project I am currently trying to solve these problems, but I haven't been able to so far. If I put a break point in the C++ code and run the C# project, the debugger doesn't break/halt when the C++ code is called from C#. I can't debug (i.e. see the values) of local variables in the C++ entry function: I get this warning when I build the solution in VS2013: C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft

How can I run some common code from both (a) scheduled via Windows Task & (b) manually from within WinForms app?

邮差的信 提交于 2019-12-13 07:39:49
问题 QUESTION - How can I run some common code from both (a) scheduled via Windows Task & (b) manually from within WinForms app? BACKGROUND: This follows on from the How can I schedule tasks in a WinForms app? thread REQUIREMENTS C# .NETv3.5 project using VS2008 There is an existing function which I want to run both (a) manually from within the WinForms application, and (b) scheduled via Windows Task. APPROACHES So what I'm trying to understand is what options are there to make this work eg Is it

WPF Thread: “COM object that has been separated from its underlying RCW cannot be used.”

瘦欲@ 提交于 2019-12-13 07:16:24
问题 I am getting following error: "COM object that has been separated from its underlying RCW cannot be used." I am sure the problem is because COM object is being called not on the thread it has been created - STA. I tried to implement IDisposable but it has not worked for me. There is a couple of posts dealing with similar problem but which still do not solve my issue: Is it safe to call an RCW from a finalizer? Release Excel Object In My Destructor Could anyone post an example/explain how COM

How to make C++ code draw on Java components

跟風遠走 提交于 2019-12-13 06:31:56
问题 We are designing physics app, and we would like to have it written in Java, and also we want to use root (root is writen in C++). Root has some nice graphical features -- it is able to draw very nice 3D charts, and I'm thinking whether it's possible to embedd those charts in Java app. Is there any way to make C++ code draw on for example JPanel ? Is there a way to pass back mouse/keyboard events? - we would like to have some interactivity, like rotating a 3d chart. I asked similar question

Word interop using tables

南笙酒味 提交于 2019-12-13 06:24:48
问题 I have a word document with text paragraphs as well as tables. I want to search for a table which text starts with "This Act has been update to". The table has one one cell. row 1, column 1. How do i find this table using code. Not familiar with using tables and word interop. Thanks. 回答1: i have partially copied this example from one of my projects (replaced/removed some code - so it may contains syntax errors), but if you are already working with interop and early binding - it might be

Outlook Interop exception - displaying new mailitem

守給你的承諾、 提交于 2019-12-13 06:13:03
问题 Trying to automatically generate a mail message via Outlook - Added a reference to Microsoft.Office.Interop.Outlook 14.0.0.0 It works on a Win 8/Office 2013 PC, but fails with the following exception on Win 7/Office 2010. Code: Application outlookApp = new Application(); MailItem message = (MailItem)outlookApp.CreateItem(OlItemType.olMailItem); message.Subject = "subject"; message.Display(message); message.HTMLBody = "body" + message.HTMLBody; //to get default signature The exception is:

Pack = 4 and Pack = 1 makes the struct not equivalent to its C declaration

核能气质少年 提交于 2019-12-13 06:00:10
问题 There is struct: [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct WAVEFORMATEX { public ushort wFormatTag; public ushort nChannels; public ushort nSamplesPerSec; public uint nAvgBytesPerSec; public ushort nBlockAlign; public ushort wBitsPerSample; public ushort cbSize; }; public WAVEFORMATEX audioInfo = new WAVEFORMATEX(); With Pack=4 Marshal.SizeOf(audioInfo) returns 20 bytes With Pack=1 - Length = 16 bytes. On C++ level I do not use any options like "Pack" and sizeof is always

Open Excel Workbook with vba code - error to notify VSTO

浪子不回头ぞ 提交于 2019-12-13 05:36:55
问题 I am trying to open an Excel file from my C# code. workBook = workBooks.Open(fileName, //filename 0, //updatelinks true, //readonly 5, //format "", //password "", //WriteResPassword true, //IgnoreReadOnlyRecommended XlPlatform.xlWindows, //Origin "\t", //Delimiter false, //Editable false, //Notify 0, //Converter true, //AddToMru 1, //Local 0); //CorruptLoad I see that the code hangs at workBooks.Open if the excel has some error within it. I have kept the display property to true and that is

Strange dumpbin export table

牧云@^-^@ 提交于 2019-12-13 05:04:54
问题 Am interoping a c++ dll and am attempting to access it's functions. Below is the dumpbin /exports output from the dll: Dump of file C:\C#Processes\SummarizerApp\SummarizerApp\lib\summarizer37.dll File Type: DLL Section contains the following exports for summarizer37.dll 00000000 characteristics 458962FF time date stamp Wed Dec 20 11:21:19 2006 0.00 version 1 ordinal base 4 number of functions 4 number of names ordinal hint RVA name 1 0 00002960 ?delete_summarization@inxight@

How to get revisions from Excel or PowerPoint Files in C# using Interop?

偶尔善良 提交于 2019-12-13 04:46:47
问题 Am working on an application that needs to count words from documents and revisions. as you can see here, I have already resolved this for Word Documents (well, as much it can be resolved) but now i find myself wondering how to get that data from Excel or PowerPoint documents. The MSDN Documentation didn't help so far - i will keep looking but if anyone knows the answer i would appreciate a little help. EDIT: So taking the information provided by @Andrew (Thanks go to him) i got this code for