Alex Dresko (MVP wannabe)'s Q&A profile
Visual C++ How to eject removable devices programmatically?
Removable devices, such as usb devices, flashmedia card, can only be safely removed by clicking the icon in system tray in WinXP. But how to make it programmatically I tried IOCTL_STORAGE_EJECT_MEDIA, FSCTL_DISMOUNT_VOLUME, but only have effect in several special cases. Any advice appreciated! Thanks for your reply. I searched one KB that talking about this topic: http://support.microsoft.com/kb/165721 But it uses the same method as I mentioned above, and can't completely remove devices from system. However, that KB article is helpful and the code provided is more clear & reasonable than mine. :- ) ...Show All
Smart Device Development problem in loading the 1[custom service] in samrtphone and 2[Extending contact tools menu] in smart phone
problem in loading the custom service in samrtphone I made myservice for pocketpc WM5.0 its runs successfully in pocketpc by activate service. I'm using device emulator for pocket pc sdk 5.0. Now i want to use that service in samrtphone WM 5.0. for this i change the SDK to smartphone and signed the Myservice.Cab file with "SDKSamplePrivDeveloper.pfx". The cab file installed successfully but not loaded with the "ActivateService" or "RegisterService" method for smartphone. As far as I remember it needs to be signed with trusted privileged certificate. SDK cert would only work if your phone trusts it and of course no production phones would trust SDK cert. ...Show All
Visual Studio Team System Visual Studio Team Edition for Database Professionals v1.0 RTM
Yeah, it is for real! On December 1st the product team has officially signed off on v1.0 of "Visual Studio Team Edition for Database Professionals". Build x251 is released to manufacturing (RTM). It was Euan Garden who started talking about the need for a product like this in November 2004; this is when the "DataDude" was first conceived. In April of 2005 the project was funded and the team was established in July of 2005 by hiring Cameron Skinner as the Product Unit Manager for this product. In November of 2005 we reach critical mass and effectively January 1st of 2006 we started building on what is now known as "DataDude v1.0". It truly feels great to build a product from incubation to release within a year! 10358 check-in ...Show All
Visual Studio Tools for Office Excel 2007, XlPattern.xlPatternLinearGradient question
Hi, I'm trying to color some cells of an excel sheet using managed code. More specific I want to apply a custom style to a certain cell. This style has the pattern property of the interior set to Excel.Pattern.xlPatternLinearGradient (which is new for Excel 2007) The problem that I have is that I cannot set the gradient color at all. If I do not specify any coloringI will get a gradient from white to light blue (default values). If I set the color property of the interior to red, it will reset the gradient and I will get a red cell. How can I have a gradient from white to red The same issue I have when using XLPattern.xlPatternRectangularGradient. Observation: I'm developing an addin for Excel 2007 using C# and VSTO 2005 SE, I' ...Show All
Windows Forms launch condition to check for available disk space
I am trying to add a launch condition to check for available disk space before uses can install my application. I tried to use the PrimaryVolumeSpaceAvailable Property but it looks like it has no value at launch. I also wanted to check the processor speen so I used a registry search to HARDWARE\DESCRIPTION\SYSTEM\CentralProcessor\0 to get key '~Mhz' , its returning the correct value but with a #, I wanted it to return an integer so I can use it to set my cpu speed launch condition. Please help the installer automatically checks the diskspace before installing....is this not enough There is no need to create duplicates of the setup process if a method already exists to check the disk space.... :-) ...Show All
.NET Development Displaying and manipulating pixels of a non-standard image
Language: C# I have written a (small) library of image processing functions that work on a System.Drawing.Image object. Works fine for BMPs and JPEGs and PNGs and the like. Yesterday my boss told me the next step is to be able to handle proprietary formats that some of our clients use. All of them follow a basic principle: some header, then pixel values. So to get started the first file format is simply pixel values as raw data. The pixels are stored as 16-bit unsigned words. So I've read a file in through a filestream and converted them to a byte[] the length of the file stream. This works for standard images (like BMP) fine; However I cannot just create an image object from the array of raw pixels. I will need to take my pixel values an ...Show All
Visual Studio 2008 (Pre-release) Not able to add a visual to another UIElement
I am trying to copy a visual to another UIElement like canvas from my selected/hit test visual and I am getting this errror. Must disconnect specified child from current parent Visual before attaching to new parent Visual. Although I am removing the visual from the current parent. _currentVisualCollection.Remove(( Visual )_hitResultsList[0]); Any suggestions. Basically I am trying to implement drag preview with lower level visual objects. Thanks Atul ...Show All
Visual C# Returntype of Methods
Hallo, May be it sounds like little over ambitious. Still i want to clear my doubt. Is it possible to determine the returntype of a method at runtime regards swingme Returning Object works, you'd have to cast the Object back to the type of the variable you're assigning. Something like: int ival = (int)myObject.getText(s, len, type); A much cleaner way that doesn't require casting is to provide overloads of the getText method, one for each type you're handling. For example: class MyObject { public void getText(String s, out int value) { value = 1; } public void getText(string s, out double value) { value = 2; } } int ival; double dval; switch(str) { case "N": myObject.getText(s, ...Show All
Windows Forms loading large image in picturebox
Hello. I'm working with large pictures (one of them is 4021x3123) and I want to load them inside o PictureBox so the user interacts with it (draws on it). The problem is after I load the picture, when I use the scroolbar to move around it, it has that flicker effect and also the interaction with my application has a delay (it takes about 1 sec for the other controls to react). I'm guessing my problem appers because of the large picture I'm loading, so is there a way not to load the entire picture inside the PictureBox and only load that portion of the picture that is currently dispayed by the PictureBox Is there a better solution to that Thanks. PS: I'm using C#. Check out this thread , it is pr ...Show All
Windows Forms Is it possible to set custom Border Colours?
Is it possible to give a SplitContainer a custom border colour, using VB Here is a previous post describing how to set the border color: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=209835&SiteID=1 ...Show All
Game Technologies: DirectX, XNA, XACT, etc. When will the next beta of GSE be released?
When will the next beta of GSE be released I agree with Exal. The next release can't actually be version 1.0 as the content pipeline has not been tested by those expected to use it. It would make sense to release beta2 with content pipeline and let us have a play with that, find bugs in it etc. etc. before even thinking of having a version 1 release. ...Show All
.NET Development Email Method does not send from port 25???
I was wondering why my e-mail method does not work, I am trying to send an e-mail from someadrees@yahoo.com to someaddress@hotmail.com the code works but no e-mail arrives do i need to specifiy passwords for both of these accounts using the NetworCredentials class or what any help with this issue Public Sub EmailHomeFile( ByVal fileName As String ) Dim mailMessage As New System.Net.Mail.MailMessage( "blocklif@yahoo.com" , "leewayz@hotmail.com" , "HomeManageMentFile" , " Do Not Replay To This Email" ) Try Dim client As New SmtpClient() client.Host = "DestinyDSP" client.Port = 25 client.Credentials = CredentialCac ...Show All
SQL Server Help SQL CE Query - LOW Performance
Hi! Sorry for bad english, I'm from Brazil. In microsoft.public.sqlserver.ce haven't found a way to improve performance of this query. Thanks for any help or reply! This used to take almost 6 min !!! With index on E.Produto now takes about 30 sec... 1,909 row table Ipaq 1950 - Samsung 300 Mhz - 32 MB RAM - Windows Mobile 5.0 - SQL CE 2.0 PK (all multiple columns) - tables: Lotes - pk(Empresa, Lote, Contagem, Produto) Contagem - pk(Empresa, Lote, Contagem, Produto) Produtos - pk(Codigo) // this field also is FK <=> Produto in all other tables Estoque - pk(Empresa, Ordem, Produto) Part of my VB.NET code with SQL: sql_grd_inv = "SELECT L.Empresa, L.Lote, L.Contagem, L.Produto" _ &nb ...Show All
Visual Studio 2008 (Pre-release) Any idea on the final WinFX runtime installer size?
It may be too early to say for sure, but I'm wondering what the filesize for the final runtime installer is projected to be. A lot of my WinXP beta testers have been whining about the large winfxrc.exe download simply to use an application that is itself less than 1MB, and I can't honestly blame them...the runtime package is large enough to make an impact on a high-speed connection, and it's a practical impossibility over dialup (and like it or not, US broadband isn't everywhere it needs to be). Also, is the final installer expected to seperate WPF, WCF, WWF, WTF, or whatever other WinFX facets there may be Installing only the necessary components for a given application will make some users a lot happier. ...Show All
Windows Forms reorder listview based on Tag
how can reorder the listview items based on its tag Jassim Rahma wrote: how can reorder the listview items based on its tag See the ListView.ListViewItemSorter property. In the example, you could try simply changing "Text" to "Tag" in the ListViewItemComparer.Compare method... ...Show All
