|
For testing purpose the process is ran by the Administrater - so this should not be the problem.
|
|
|
|
|
I'm not sure of the underlying API's that the FileSystemWatcher class uses, but I know of a problem with using ReadDirectoryChangesW() for the Windows API. When I was using this function in a C++ project, it wouldn't work because the folder was actually a unix drive that was mapped to my machine, and looked like a regular windows folder. So I don't know if that class is using the same API underneath, but that API doesn't work on non-Windows drives. Your problem may be different, but possibly related. This may not even be near what the actual problem is, but hopefully it might get you thinking about any other possible anomalies in the way that folder is accessed.
If I write code in my sleep, does that make me brilliant, or just a lazy programmer?
My articles
www.stillwaterexpress.com
BlackDice - the programmer formerly known as bdiamond
|
|
|
|
|
Hi!
I was wondering how I could manually create a RCW for third-party ActiveX controls.
Creating 'regular' RCW's for COM dlls is quite straightforward, just running the dll through tlbimp.exe and I get the RCW.
Now when I add an ActiveX control to a form with VS, an AxInterop.Componentname.dll is created, along with Interop.Componentname.dll.
The second dll (Interop.*) seems to be equivalent to what I can create with tlbimp.exe, but what about the AxInterop.* ?
Can anyone shed some light on this subject?
TIA,
Mav
|
|
|
|
|
mav.northwind wrote:
but what about the AxInterop.* ?
Mav, the AxInterop assembly that is created literally wraps the ActiveX control to expose it as a Windows Forms control, it's base class is AxHost . You typically wouldn't want to create this manually, however you can use the Aximp.exe[^] (Windows Forms ActiveX Control Importer) to generate this assembly yourself.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thanks alot, Nick!
I was asking because I have to support two different versions of a third party program exposing ActiveX controls and COM objects in my program.
The problem is that the interfaces of these objects have changed but have kept the same name. So I couldn't find a way to instantiate a class implementing a specific interface version and am now trying to use 2 RCW dlls with different namespaces.
Don't know if this will work, though.
The core problem is: I can't have both versions of the application installed at the same time, so I must build against the version currently installed. When I build against the newer version, I'll get class not registered-errors when instantiating objects with the older version installed. The other way round I can't use any features from the newer version.
You don't have an idea how to do this by chance?
Thanks,
Mav
|
|
|
|
|
I am doing some code profiling on my project to try and identify any speed bottlenecks - I am using DevPartner community edition from Compuware - when I run the tests my project spends about 90% in WaitForSingleObject, Sleep and SleepEx - why would it do that? The program isn't multithreaded and the main part of the program I am testing has no user interraction - it's basically some IO and a lot of bit shifting.
TIA
|
|
|
|
|
PaleyX wrote:
it's basically some IO
You have to wait for the I/O finish. Often this is done by the CLR using WaitForSingleObject, because some I/O classes only implement asynchronous interfaces (Begin*/End*) - the synchronous versions of these methods simply call the Begin/End pair.
What you're seeing is that your program is spending 90% of the time blocked by I/O. Maybe multithreading would help you a bit.
Yes, even I am blogging now!
|
|
|
|
|
Thanks for that. It isn't really a problem as the program is fast enough - analyse 1 billion records per second anybody? I was just curious why it was spending so much time sleeping and waiting.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
hi all,
I want to find CRC32 value of any kind of file(*txt,*.jpg,etc....) using C#..
Can u please help me how to find that value?
Thanks in advance..
|
|
|
|
|
Hi,
Does anybody has any idea how to give implementation in c-sharp, of the following feature of Yahoo or MSN:
Show me as "Away" when I am inactive for 10 minutes.
I have a chat client application developed in c-sharp. And now I want to give the same feature in my app too.
Prompt reply will be appreciated.
Regards,
Kamran
|
|
|
|
|
You could take a timestamp everytime the user of your application does something and store it somewhere. This timestamp value then gets compared with the actual time inside of an timer event handler and if the difference is greater than 10 min you set the status to "Away".
www.troschuetz.de
|
|
|
|
|
Simple solution - have a timer that ticks every so often (depending on how accurate you want your away timer to be)
Every time the timer ticks, increment the counter, when the counter goes above a pre-set value (i.e. how ever many timer ticks there are in 10 minutes) you can set your status to away.
Now, in any of your mouse/keyboard handlers, just reset that counter to zero if you've got user input
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Hi Benjymouse,
Thanks for your prompt reply. It helps me a lot to understand the solution.
But how to capture mouse/keyboard events of windows. Remember my chat application application needs to be notified of any activity on windows for example if my chat application is minimized, and a user only moves his mouse on the desktop, my application should be able to capture this event.
I hope you understand what i mean.
Regards,
Kamran
dearkami@yahoo.com
|
|
|
|
|
|
Thanks a lot Benjymous,
I hope this will help me to resolve my problem.
Thanks again!
Best regards,
Kamran
|
|
|
|
|
hi there,
How can draw shapes inside a control( a custom label control). The real idea behind this is, partitioning status through this control. Otherwise how can i partition a label control with different region.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
overload the paint method of the control with what you want it to show...
|
|
|
|
|
I tried but failed. Reason is i need to split the entire size of controls into three different region and then need to get a block from that. This block need re design at run time based on user request(re design means - > assign back color,fore color,outer line color and highlight color etc). Some time user may merge any two block of region into one or the entire three block into one. So i am in trouble. Any idea ?
Sreejith Nair
[ My Articles ]
|
|
|
|
|
I load my data into Datagrid, I'd like open a new form(contain the data about this row) by clicking on each row of the Datagrid . How can i do that ???
|
|
|
|
|
Use HiteTestInfo class which contains information about a part of the System.Windows.Forms.DataGrid at a specified coordinate. See MSDN for more details.
Eg:
<br />
System.Drawing.Point pt = this.dgUnAllocatedOrders.PointToClient(Cursor.Position); <br />
DataGrid.HitTestInfo hti = this.dgUnAllocatedOrders.HitTest(pt); <br />
if(hti.Type == DataGrid.HitTestType.RowHeader) <br />
{ <br />
Yourform alloc=new Yourform();<br />
alloc.ShowDialog();<br />
}
Sreejith Nair
[ My Articles ]
|
|
|
|
|
Hi
If we check Font.Height property it returns the value in pixel. How to convert the same in Twips?
please guide
|
|
|
|
|
Try the following:
[DllImport("gdi32.dll")]
static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
int WU_LOGPIXELSX = 88;
int WU_LOGPIXELSY = 90;
int TwipsPerInch = 1440;
private int PixelsToTwips(int pixels, bool bIsHorizonal)
{
int twips;
Graphics g = Graphics.FromHwnd(IntPtr.Zero);
IntPtr hdc = g.GetHdc();
int pixelsPerInch;
if(bIsHorizonal)
pixelsPerInch = GetDeviceCaps(hdc, WU_LOGPIXELSX);
else
pixelsPerInch = GetDeviceCaps(hdc, WU_LOGPIXELSY);
g.ReleaseHdc(hdc);
double numInches = pixels/pixelsPerInch;
twips = (int)(numInches * TwipsPerInch);
return twips;
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thanks for the valuable input....
extending the same thread;
if the Unit of the given font is Graphics.World, how to convert the font height in to twips?
please guide
|
|
|
|
|
I've a server application, which will return some strings for different users. The users can set their locale to the server, so the return string is will be in the language they specified.
In my scenario, i coudln't use CultureInfo.CurrentCulture as my server has to serve differnt locales. Is it the only resort I've to use is creating different resources file, and load it up with differnt ResourceManagers, and get the string myself. Can I built them into 1 assembly and loading with 1 ResourceManager only ? As I heard that ResourceManager is quite resource consuming.
Hiya, Everybody ^^
|
|
|
|
|
Hi,
I want to implement several custom cursors in my application. Is it possible to load the cursors from an imagelist or do I have to put them as a ressource in my application and load them this way?
Thanks,
Dennis
|
|
|
|