|
I've tried stopping COM objects before (in C++, not in C#), and all I can say is that it's simply not reliable if you do it in-process (e.g., loading a DLL). I tried creating the object in another apartment, asynchronous COM calls, aborting the threads, etc, and nothing was reliable enough. After a while instability started to happen.
The only reliable way I found was using out of process COM servers (.exe), so as I killed the process, the OS done all the cleanup needed. I suggest you to load this dll in a surrogate process and kill it when you need to cancel the call.
I know that starting and stopping processes in Windows is not a fast task, but in some cases, it can be fast enough for what you need.
Yes, even I am blogging now!
|
|
|
|
|
Got an web application where users can select applications they would like to use. They can choose several applications. The choices i want to store in a database. A table with fields like userid, appname. The combination of the two can occur only once.
I can of course use an insert statement and loop for the number of applications but i was wondering if .net has a better way. Something like filling up a dataset and passing the dataset to a insert method.
Glad to hear some suggestions.
|
|
|
|
|
I am implementing a UI for debugger, and trying to do a step mechanism where the current source code line is highlighted (its background is colored).
So basicly I am trying to set a background for the selected text (only).
Any ideas?
Thanks,
Orly
|
|
|
|
|
I believe that the RichTextBox is fast enough for a debugger, so I would suggest you to use it, as it's easy to change colors, fonts, etc, of the text.
Yes, even I am blogging now!
|
|
|
|
|
I am intending to use the RichTextBox, but I haven't found an easy way to color the background only of a selectedText...
|
|
|
|
|
|
have anyof you made projects related to hardware....and interfaced it with c# i.e parallel port, serial port or usb devices....if so...How????
|
|
|
|
|
can anyone tell me how add a command to windows explrere context menu and how do i interface my program with it....
|
|
|
|
|
It's called a Context Menu Shell Extension (there are others like Property Sheet Shell Extensions to add your own tab to the File Properties dialog.)
Search on CodeProject, there are several good articles and tutorials.
See this: Search Results[^]
Most articles are for C++ or MFC, but there's an article on page 2 about a property sheet extension in C#. Take a look.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Hello
I'd like to be grouping taskbar button.
I know how to set group on registry. But this setting is for user.
I'd like to do for my application, so I need to develop this function.
If you have some solutions, please tell me.
regards,
yu-yu
|
|
|
|
|
Hi,
Please look at www.sahometraders.co.za. I have to do the website in ASP.NET, and I want to get started with the top menu. People say that I must use a user control for this. I'm not entirely sure how to do this. I will be using C#. COuld someone please send some sample code, or give me a link where I can download some good sample code on how to create this type of control. Any links to other good articles will be appreciated.
When will I use user controls? People say I must use a an includes files, so if I were to use an include file in the old ASP, would I then just have to create a user control every time?
BRENDAN
|
|
|
|
|
already answered in ASP.NET forum of CP
"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
|
|
|
|
|
|
An idl as the one below
import "oaidl.idl";
import "ocidl.idl";
[
object,
uuid(1F797987-FC69-43F7-B263-F93001092B6B),
helpstring("ICOMDispatcher Interface"),
pointer_default(unique)
]
interface ICOMDispatcher : IUnknown
{
[helpstring("method ProcessFBOData")] HRESULT ProcessData([in]BSTR xmlStream);
};
[
uuid(A3359D17-EDC8-4F58-A00E-75EB1A13EE85),
version(1.0),
helpstring("ScriptIfDispatcher 1.0 Type Library")
]
library SCRIPTIFDISPATCHERLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(A250FE7E-2E0A-4FD7-B770-E338FFDD7465),
helpstring("COMDispatcher Class")
]
coclass COMDispatcher
{
[default] interface ICOMDispatcher;
};
};
generates a metadata as below
___[MOD] D:\Code\CScriptAppInterface\ScriptIfDispatcher\ScriptDispatcher.dll
| M A N I F E S T
|___[NSP] ScriptDispatcher
| |___[INT] COMDispatcher(>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.interface 1)
| | | .class interface public abstract auto ansi import
| | | implements ScriptDispatcher.ICOMDispatcher
| | | .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 31 46 37 39 37 39 38 37 2D 46 43 36 39 // ..$1F797987-FC69 ...
| | | .custom instance void [mscorlib]System.Runtime.InteropServices.CoClassAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 23 53 63 72 69 70 74 44 69 73 70 61 74 63 // ..#ScriptDispatc ...
| |
| |___[CLS] COMDispatcherClass(>>>>>>>>>>>>>>>>>>>>>>>>>>>>class )
| | | .class public auto ansi import
| | | implements ScriptDispatcher.ICOMDispatcher
| | | implements ScriptDispatcher.COMDispatcher
| | | .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 41 32 35 30 46 45 37 45 2D 32 45 30 41 // ..$A250FE7E-2E0A ...
| | | .custom instance void [mscorlib]System.Runtime.InteropServices.ClassInterfaceAttribute::.ctor(int16) = ( 01 00 00 00 00 00 ) ...
| | | .custom instance void [mscorlib]System.Runtime.InteropServices.TypeLibTypeAttribute::.ctor(int16) = ( 01 00 02 00 00 00 ) ...
| | |___[MET] .ctor : void()
| | |___[MET] ProcessFBOData : void(string)
| |
| |___[INT] ICOMDispatcher(>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>interface 2)
| | | .class interface public abstract auto ansi import
| | | .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 31 46 37 39 37 39 38 37 2D 46 43 36 39 // ..$1F797987-FC69 ...
| | | .custom instance void [mscorlib]System.Runtime.InteropServices.InterfaceTypeAttribute::.ctor(int16) = ( 01 00 01 00 00 00 ) ...
| | |___[MET] ProcessFBOData : void(string)
| |
|
I would have expected a class COMDispatcher and interface ICOMDispatcher as per the idl.Then why are the interface COMDispatcher and class COMDispatcherclass introcuded?Can someone explain the purpose of this modification while generating metadata.Any reference will also be appreciated.
|
|
|
|
|
hello.
Do you know how to get click event of taskbar button.
Windows form object have a taskbar button.
When I clicked, I'd get event.
The event I think is not windows style change.
please tell me.
regards,
yu-yu
|
|
|
|
|
Hello there,
I just wanted to make sure before I attempt to do anything. It's okay to concurrently access a file as long as it's only being read right?
Thanks
Rafferty
|
|
|
|
|
Rafferty Uy wrote:
It's okay to concurrently access a file as long as it's only being read right?
This is generally true. However keep in mind that you'll never know in advance what other running processes might do with the file you want to read. If the file has already been opened without the FileShare.Read flag set you will get an exception. Also you might want to set specific FileShare [^] flags yourself when you open the file (for example to prevent that another process writes to the file while you're reading it).
Best regards
Dennis
|
|
|
|
|
Hm.. things are getting complicated, because I'm going to access the file using DTS in SQL Server. And come to think of it, I might be renaming the file somewhere along the way. uhh.. haha I think I need to detail the design a bit more.
Thanks for the tip!
Rafferty
|
|
|
|
|
A neural network that composes music or a batch creator. if you have your own ideas post 'em up.
IM PROUD TO BE A GMAIL;
|
|
|
|
|
in case of more scientific, i think the neural network would be more scientific...
btw : wats the meaning of -> IM PROUD TO BE A GMAIL;
"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
|
|
|
|
|
|
I guess I'm not the only one who always thought that the .NET Framework 1.x collections were lacking of some useful features. Implementing the version 2 collections with generics made them more flexible and easier to use. However one might still miss some features.
It is the intention of the Power Collections open/shared source project to furthermore close the gap in the list of features with additional collection classes written in C#. The project is co-sponsored by Microsoft and Wintellect and led by Peter Golde[^]. Developers are welcome to participate as it is still in progress and not even the specification has been finalized yet.
Power Collections Project Homepage[^]
MSDN Community Center (CodeWise): Power Collections[^]
Best regards
Dennis
|
|
|
|
|
Hi,
i am working on a network project and i need to control the noise rate , thats to calculate the data transfare rate in the connection in different noise rates !
can that be done ?!
|
|
|
|
|
I'm using the MOOL to send e-mails and scan the inbox. The one thing i can't see is how to get the e-mail address of the sender from an Inbox message.
I'm able to successfully get a MailItem for each e-mail in the inbox, but the Sender Property has the "Friendly Name" not the e-mail address of the sender. I've got to be missing something obvious. Any help out there ?
App = new Outlook.Application();
oNS = App.GetNamespace("MAPI");
oNS.Logon(Missing.Value,Missing.Value,false,true);
Inbox = oNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
Outlook._MailItem Msg = (Outlook._MailItem)Inbox.Items.GetFirst();
Email = Msg.Sender;
Well I found my own answer. I'm sure this has been posted before, but just in case:
App = new Outlook.Application();
oNS = App.GetNamespace("MAPI");
oNS.Logon(Missing.Value,Missing.Value,false,true);
Inbox = oNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
Outlook._MailItem Msg = (Outlook._MailItem)Inbox.Items.GetFirst();
Outlook._MailItem ReplyMsg = Msg.Reply();
string Email = ReplyMsg.Recipients.Item(1).Address;
|
|
|
|
|
Seems that no matter what I try, I cannot get my bulk load to work. According to different info I've found around the internet that if you get this message:
QueryInterface for interface Interop.SQLXMLBULKLOADLib.ISQLXMLBulkLoad failed.
then you need to add [STAThread] to your code to ensure that it runs in a single threaded environment. I have done this and it doesn't work.
I've also read that if you're getting this message, it means it can't find the assembly you're looking for. I have registered my assembly with RegAsm and with gacutil and that doesn't help either. What else is there?
Here is my setup. I am using a vbscript to intantiate a COM+ component I created using C#. That instantiation is successful. That component processes my data and creates an XML file. It then uses the Interop.SQLXMLBULKLOADLib library to bulk load my xml file into the DB. When it goes to create the Interop.SQLXMLBULKLOADLib object I get the error message mentioned above.
Any suggestions?
Thanks.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|