interop

Using interop.word ranges

假装没事ソ 提交于 2019-12-25 18:12:15
问题 I'm having trouble figuring out how to work with word ranges. I have picture files that I am adding to a word file, but I can't figure out how to add text and tables in between the pictures. The structure I want is this: Text, table, picture. Then repeat. However, when I add text or tables, they all area added after the four pictures, which stay at the top of the file. I've been reading and I've figured out I need to use ranges to specify where you want to place the tables/text, but all the

Using interop.word ranges

你说的曾经没有我的故事 提交于 2019-12-25 18:12:03
问题 I'm having trouble figuring out how to work with word ranges. I have picture files that I am adding to a word file, but I can't figure out how to add text and tables in between the pictures. The structure I want is this: Text, table, picture. Then repeat. However, when I add text or tables, they all area added after the four pictures, which stay at the top of the file. I've been reading and I've figured out I need to use ranges to specify where you want to place the tables/text, but all the

using Microsoft.Office.Interop.Word in Sharepoint environment

橙三吉。 提交于 2019-12-25 17:19:23
问题 You'll have to forgive my ignorance with regards to this code. I have written some code to modify an event receiver. I have set up a development environment for SharePoint and finally got it to access and change certain elements of the code. However, it is the following line where it fails: Word.Application wordApp = new Word.Application(); In that, it doesn't seem to be able to open the local word application installed on the Sharepoint server in order to process the uploaded document. Any

using Microsoft.Office.Interop.Word in Sharepoint environment

北城余情 提交于 2019-12-25 17:19:06
问题 You'll have to forgive my ignorance with regards to this code. I have written some code to modify an event receiver. I have set up a development environment for SharePoint and finally got it to access and change certain elements of the code. However, it is the following line where it fails: Word.Application wordApp = new Word.Application(); In that, it doesn't seem to be able to open the local word application installed on the Sharepoint server in order to process the uploaded document. Any

How to wrap C++ DLL in C# with pointers as parameters?

﹥>﹥吖頭↗ 提交于 2019-12-25 17:05:16
问题 I am trying to call some functions from a C++ DLL file in my C# program. But I got stuck when it comes to pointers. Could somebody point me to the right direction? Here's the C++ header file with the target functions: #pragma once #ifdef STCL_DEVICES_DLL #define STCL_DEVICES_EXPORT extern "C" _declspec(dllexport) #else #define STCL_DEVICES_EXPORT extern "C" _declspec(dllimport) #endif enum SD_ERR { SD_ERR_OK = 0, SD_ERR_FAIL, SD_ERR_DLL_NOT_OPEN, SD_ERR_INVALID_DEVICE, //device with such

Passing a C# callback function through Interop/pinvoke

佐手、 提交于 2019-12-25 09:03:37
问题 I am writing a C# application which uses Interop services to access functions in a native C++ DLL. I am already using about 10 different functions which are working. Now I am not sure how to handle passing a callback as a parameter so that the DLL can call my code. Here is the function prototype of the DLL: typedef void (WINAPI * lpfnFunc)(const char *arg1, const char *arg2) And the function that allows me to pass the above type: int WINAPI SetFunc(lpfnFunc f) Here is my C# code for the

How can I have a service run a process under the current user's session?

假如想象 提交于 2019-12-25 08:53:18
问题 I have a service, written in C#, that monitors a set of files. It uses Growl to notify the end-user if the modified time of one of these files is over 4 hours old. I've seen situations where Growl.exe was not running under the current user's session, thus they did not receive updates. I'd like my service to check to make sure Growl is running (either Growl.exe or maybe I could look for the application ID somewhere?) and start it if it's not. How can I ensure that Growl is always running in

Handling COM Callbacks in C# Client

孤人 提交于 2019-12-25 08:19:35
问题 Here is how the application is designed - I have a COM server raising events on certain conditions. I have a C# client UI which is supposed to handle these events raised by this COM server. There is a delegate in my C# client which I pass to the COM server and it calls back on an event. I have a custom wrapper which marshals the delegate as function pointer. Like so... Fxn1inCOMWrapper([In, MarshalAs(UnmanagedType.FunctionPtr)] Client.SetStatusDelegate StatusCallback); The callback mechanism

Cannot p/invoke C method from C# due to marshalling issues

早过忘川 提交于 2019-12-25 07:43:03
问题 I'm trying to invoke the I2CTransfer function below, and immediately getting a System.NotSupportedException . I suspect my marshalling is wrong, but cannot work out the problem. Here are the C structures: BOOL I2CTransfer(HANDLE hDev, PI2C_TRANSFER_BLOCK pI2CTransferBlock); typedef struct { I2C_PACKET *pI2CPackets; INT32 iNumPackets; } I2C_TRANSFER_BLOCK, *PI2C_TRANSFER_BLOCK; typedef struct { BYTE byAddr; BYTE byRW; PBYTE pbyBuf; WORD wLen; LPINT lpiResult; } I2C_PACKET, *PI2C_PACKET; And

Tried to call an unmanaged DLL, but it always returns junk values. Please help!

笑着哭i 提交于 2019-12-25 06:38:52
问题 Could someone please help me figure out what is wrong with the following code snippet. I tried to call an old DLL and have spent about 3 days but couldn't find why my returned array and the string is always junk. Unmanaged Codes: typedef struct { double a; double b; }UnmanagedStruct, far *lpUnmagedStruct; //.h file: __declspec( dllexport ) double far pascal Process(lpUnmagedStruct lpStruct, int size, char far szMessage[]); //.cpp extern double far pascal Process(lpUnmagedStruct lpStruct, int