com

Changing run time of already scheduled tasks in windows task scheduler

折月煮酒 提交于 2019-12-01 09:15:54
I have problem with modifying tasks which already exists on machine. I'm trying to do this with generated interop interfaces from C# (Interop.TaskScheduler.dll generated from system32/taskschd.dll). To start with, I can't use other libraries like http://taskscheduler.codeplex.com/ . Already tested and it works with library mentioned before. Now when I try do same with generated interfaces nothing changes. Basically what I'm doing: string STR_DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; string taskName = "taskName", user = "user", pass = "pass"; DateTime nextRun = new DateTime.Now.AddDays(7);

How to extract a GUID from a Win32 DLL or OCX

跟風遠走 提交于 2019-12-01 08:57:03
We have a .NET app that needs to examine a folder that may contain COM libraries (DLL and OCX.) When we do encounter a COM library one thing we need to accomplish is to extract the GUID from the COM DLL or OCX. Is there a straightforward way to do this with .NET without using 3rd party libraries? JohnFx This should work for you. It requires a reference to c:\windows\system32\tlbinf32.dll , but I'm assuming that is okay because it isn't a third party component. Imports TLI 'from c:\windows\system32\tlbinf32.dll Dim reglib As TLI.TLIApplication = New TLI.TLIApplicationClass() Dim DLLPath As

AxAcroPDF swallowing keys, how to get it to stop?

守給你的承諾、 提交于 2019-12-01 08:51:07
The AxAcroPDF swallows all key-related events as soon as it gets focus, including shortcuts, key presses, etc. I added a message filter, and it doesn't get any key-related messages either. It's a COM component, could that be relevant? Is there any way to catch these before the control starts swallowing them? Kevin McCormick Hans is correct, the Acrobat Reader spawns two child AcroRd32 processes which you have no direct access to from within your managed code. I have experimented with this and you have three viable options: You can create a global system hook , and then look for and filter out

Using SqlServer CE without installation

时光怂恿深爱的人放手 提交于 2019-12-01 08:50:41
Given: A clean machine, no SQL Server CE present. A set of *.sdf files (Sql Server CE databases), never mind how they got there The DLLs of the relevant Sql Server CE (sqlceca35.dll, sqlcecompact35.dll, sqlceer35EN.dll, sqlceme35.dll, sqlceoledb35.dll, sqlceqp35.dll, sqlcese35.dll) Question: How to make available the Sql Server CE OLEDB provider implemented by the aforementioned DLLs. I am looking for a programmatic way to do so when running as a limited account. In other words, assuming we are talking about Sql Server CE 3.5, how to make the following code succeed: IDBInitializePtr

Why would Windows Search query my IFilter for a bunch of weird interfaces?

血红的双手。 提交于 2019-12-01 08:45:25
问题 I've implemented an IFilter as a native VC++ ATL in-proc COM server. Windows Search wouldn't use it - it creates an instance of my IFilter and then executes a bunch of QueryInterface() calls, specifically: IMarshal IStdMarshalInfo something with {4C1E39E1-E3E3-4296-AA86-EC938D896E92} interface id and a couple of others. Since my IFilter only implements IFilter, IPersist and IPersistFile most of the calls return E_NOINTERFACE, so Windows Search just releases my object and does nothing. Why is

COM methods, Char type and CharSet

和自甴很熟 提交于 2019-12-01 08:42:24
问题 This is a follow-up to my previous question: Does .NET interop copy array data back and forth, or does it pin the array? My method is a COM interface method (rather than a DllImport method). The C# signature looks like this: void Next(ref int pcch, [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] char [] pchText); MSDN says: When a managed Char type, which has Unicode formatting by default, is passed to unmanaged code, the interop marshaler converts the character set to ANSI.

Converting C++ string/wchar_t* to C# string?

强颜欢笑 提交于 2019-12-01 08:38:54
问题 Question: I need to call a C# dll from a C++ executable. I use COM, and it works fine for int, long and bool. But I can't get a string along... The IDL file says it's a BSTR, but I can't pass it correctly, and neither retrieve one. I tried using wchar_t* and using sysalloc as I did with VB6, but that doesn't seem to work. Anybody knows how, or what might be wrong ? 回答1: If you're using ATL you can do this: std::string theString = "hello"; CComBSTR bstr(theString.c_str()); DoSomething(bstr); /

How to register COM from VS Setup project?

别说谁变了你拦得住时间么 提交于 2019-12-01 08:00:00
I have marked my DLL as vsdraCOM, and I can see it in the registry after installing, but my application does not see the COM interface until I call RegAsm on it manually. Why could this be? The COM registration does not work on Vista (confirmed myself) and on XP (confirmed by a colleague). Using Visual Studio 2005 on XP. Well, I have found a solution: Run RegAsm.exe with the /regfile option to generate the registry entries. Manually import the .reg file into the VS Setup project by viewing the registry, right clicking, and choosing "Import..." 来源: https://stackoverflow.com/questions/12807/how

Unreleased DirectShow CSource filter makes program crash at process shutdown

左心房为你撑大大i 提交于 2019-12-01 07:58:57
问题 I'm developing a DirectShow CSource capture filter. It works fine, but when I close the program that is using the filter (in this case I'm testing with VLC, but the same happens with other programs), the program crashes (if I'm debugging it in Visual Studio then a breakpoint is triggered). I've been hunting down this problem for some time now and found that both, my source filter and my source stream are not being released; this is, their reference counter is 1 at the end of the program,

COM Exception 0x800A11F9 - Cannot activate application

余生长醉 提交于 2019-12-01 07:47:18
问题 I have a C# 2.0 (WinForms) project in which I try to activate word 2003 (word is installed on the system). By using the following code: private void ActivateWord() { this.Activate(); if (m_WordDocument != null) { try { m_WordDocument.Activate(); if (m_WordDocument.Application != null) { m_WordDocument.Application.Visible = true; m_WordDocument.Application.Activate(); } } catch (COMException comEx) { ShowError(this, comEx.Message, false); } } } When my application executes m_WordDocument