|
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
|
|
|
|
|
Hi,
I have written a SQL database application which works great. The client has a remote pc (off site - which has its own database) and a remote laptop (on-site - which has its own database) so the employee can work if the power goes out. What I want to set up is a way to extract changes made to the database into packets and FTP to the offsite pc and read in those changes. I want to achieve a simular result but over the network, not through FTP.
Is there a way to extract changes from an SQL database of all transactions so i can send this information to the offsite and onsite pc?
OR
Is there any way to achieve this????
I am open to realistic suggestions or products.
Thanks
Stephen
|
|
|
|
|
Replication will help you out. But i am not sure about how to configure Replication in SQL Server.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
|
Unfortunately, there is no .NET way of launching the .NET app. Your still dealing with a COM based app that knows nothing of the .NET Framework. So, the .NET application and Framework must be adapted to work in the COM world. That's why you need all the configuration on the client side. You can't get around it...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|