Davidxin's Q&A profile
Visual Basic how to Run application as admin
Hi... How do I run a app. with admin priviliges I’m a noob in this, so maybe its simple... I have tryed this... but got some errors with the password, how does it works Dim p As New ProcessStartInfo( "IEXPLORE.EXE" ) p.UseShellExecute = False p.Domain = "domain" p.UserName = "administrator" p.Password = "password" p.Arguments = ( www.homepage.com ) Process.Start(p) It seems to work but I get a new error. What parameter do I need/ have I missed System.ComponentModel.Win32Exception was unhandled ErrorCode=-2147467259 Message="The parameter is incorrect" Source="System" StackTrace: at System.Diagnostics.Process.Start ...Show All
.NET Development Binary serialization to NetworkStream doesn't work from remote computer
Hello, My problem is that the following code works fine when the client and server application are on the same computer, but fails, if they are on separate ones. The thing seems going well until the 'Deserialize()' call. During debugging I see the client's IPEndPoint is correct, the NetStream's members look ok. Than at 'formatter.Deserialize(netStream);' call it simply dies. Not throwing exceptions, not exiting the application (especially this message-receiving is running in a separate thread, it can be that this thread exits only, but no error message at all...), but if I put a breakpoint on the next row, it never reaches it. So here comes the code: Socket connectedSock = null; connectedSock = recSock.Accept(); IPEndPoint client = (IPEnd ...Show All
SQL Server drop user
Hi, I have a user in my SQL server 2005 database sys.sysusers table with following values. I am unable to delete this user and unable to create a user with this same user name. Please tell some one what is status=16 and issqluser=0 status 16 ame \CMSXXCMSTESTER roles NULL altuid 5 hasdbaccess 0 islogin 1 isntname 0 isntgroup 0 isntuser   ...Show All
SQL Server Select GetDate() Just the month or year
I wonder if someone can help me with getting JUST the month and year from SQL DB. Using the Select Getdate() Statement. If I need to use another one that would work that would be appretiated as well. Thanks! There are several ways to accomplish your task. In Books Online, look up [Functions], then [Date and Time Functions]. To retreive the current month as a number, use: SELECT month( getdate() ) SELECT datepart( month, getdate() ) To retreive the current month as a name, use: SELECT datename( month, getdate() ) And to retreive the current year, use: SELECT year( getdate() ) SELECT datepart( year, getdate() ) ...Show All
Visual C++ Update Single Item In ListBox
Hi All, I have an owner-drawn a list box.I'm drawing the things I required properly. But the problem is I have a timer and I need to update some specific items in the list box. Is there anyway to refresh or invalidate an item in the list box I'm thinking in the way of re-setting the item's text, so it will re-draw no But I think it's a weird logic. Could you please help me in this regard ok let me explain each things step by step 1. I have a listbox class which do some owner-draw stuffs. 2. A timer placed in the class. Which is used to show a clock in an item of the list box. 3. Invalidate is there for help me, but it will redraw the entire content and it's very costly :(. Giving a specific rectagle to redraw in the Invalida ...Show All
Visual Basic Continuously adding buttons during runtime and a Happy New Year to you. :-)
Hi. I want to build a program which can add its own buttons. However, I only ended up adding one button, and I don't know why. Here's the code: Dim i As Integer Dim ButtonMade As New Button Private Sub Button1_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click i += 1 ButtonMade.Text = i.ToString ButtonMade.Left += 100 AddHandler ButtonMade.Click, New System.EventHandler(AddressOf ButtonMade_Click) Me.Controls.Add(ButtonMade) End Sub Private Sub ButtonMade_Click(ByVal sender As Object, ByVal e As System.EventArgs) MessageBox.Show("Hello") End Sub I couldn't figure out why it just keeps on adding just one button, and when I try to add another one, it just transports the previously made ...Show All
Internet Explorer Development Powerbuilder IE7 embedded webbrowser control
Our Sybase Powerbuilder application contains an embedded Microsoft Web Browser control, accessing web pages on a local webserver. After installing IE7, dropdown controls within embedded web pages are no longer selectable. The options appear, but none are clickable. I have stripped the html code to a bare minimum, so it does not appear to be related to this. I have also tried noddy apps in various versions of Powerbuilder with the same results. On a machine with IE6 however, all is fine. Our customers have recently installed IE7 with the same result in the deployed application, and have had to revert to IE6 to resolve the problem. I have seen various issues with the IE7 install affecting VB6 apps, relating to shdocvw.dll a ...Show All
Visual Studio SandCastle RTM?
Hi, Just wondering if there is a planned date for the RTM of SandCastle Thanks Andy Andy, Thanks for using Sandcastle. We have a planned CTP release this week. Originally I wanted December release to be our RTW (Release to Web) 1.0. We have fixed around 20 plus bugs and added few features. I will post a seperate blog about December CTP release at http://blogs.msdn.com/sandcastle . However to get RTW 1.0 release out there are several items I need to finish: Work with our legal to get a new license Code Sign the binaries Get detailed help documentation for Sandcastle in English and 8 other localized languages we support for Visual Studio Additional examples or scripts Whitepaper ...Show All
Visual C++ What is Visual C++ equivalence to C#'s "is" operator?
I'm trying to convert some C# code over to C++ but cannot figure out what's the C++ "is" operator. C# code: Control m_control; if (m_control is Control) { ... } I've searched and found this article but it's outdated and does not work with Visual C++ 2005: http://msdn.microsoft.com/msdnmag/issues/02/02/managedc/ In which the author defines the following template: template <typename T1, typename T2> inline bool istypeof ( T2* t ) { return (dynamic_cast<T1*>(t) != 0); } bool isanInt = istypeof<int __box>(someBoxedInt); I've tried all following with no luck: if ((Ojbect^)m_control == (Object^)Control) if(m_control.Equals(Control)) Any help would be appreciated. Thanks ...Show All
Visual Studio 2008 (Pre-release) Subscribing to a PageFunction's Return event from another Window
I have a series of PageFunctions and two Windows. One window is the main window for my application, and the other is a window that just contains a Frame. From the main window, I launch the second window, and pass a PageFunction to it that it navigates to. Before creating the window I subscribe to the PageFunction's Return event. The PageFunctions work and allow me to navigate through each one. When I reach the end I call OnReturn(), and it calls OnReturn for each PageFunction along the way recursively, exactly like the sample code. However, the Return event that I subscribed to from the Main Window is not called - I cannot comprehend why. Am I right in assuming the Return event has something to do with a NavigationService that my Mai ...Show All
Visual Basic how to call fun in console
hi we are declaring and creating function in windows application in vb.net how to call that funcation in console applicaiton If they are in the same solution: WindowsApp1... Class Class1 Public Function1() Return True End Function End CLass now from the sub main of ConsoleApp: Public Sub Main Dim c as New WindowsApp1.Class1 If c.Function1 then dosomething end if if they are not in the same solution the same prinicple applies you just have to make a project level reference to the windows application...(Project menu "Add reference") ...Show All
Windows Forms User-Drawn Custom Control and Property Window / Designer-Time
Hi. I am trying to get the property window to work with my knob control I am creating. First, I am trying to get my property window in VS2k5 to respond to my knob control. I added the public rotate property, but nothing's showing in my property window. The property window doesn't respond when I am working with editing Windows Forms application; overwise, when I remove the knob control, everything goes back to normal. What can I code to get the property window to work with my control Second, I wanted to prevent a user from resizing a knob, as it doesn't seem to make sense if I have my knob set to be at fixed size. Here's my code: using System; using System.Collections.Generic; using System.Drawing; using System.Drawing ...Show All
Windows Forms Draw PNG-image on the form
I'm using VB.net (.Net 2.0). How to draw a png image file on the form by clicking a button I would like to set the cordinates (x, y) but the image size should be the original of the file. I would like to view the png files as transparent (as they originally are). When clicking the button set a global boolean to true (i.e LoadImage), then call Me.Refresh(). On your form event called Paint do the following Private Sub frmMaint_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint if (LoadImage = True) then e.Graphics.DrawImage("C:\myimage.png", New Point(100, 200)) end if End Sub Untested, should work. Regards, Luc Pettett ...Show All
.NET Development IPermission.Union help
Can someone help me understand what actually happens behind the scenes in the Union method on an IPermission implementation Here's my basic scenario: I have an custom CAS atrribute that requires up to three values to be evaluated together to know if the demand will pass or not. This became difficult to manage when trying to determine how to union two instances of the IPermission implementation together. So, in the Union call, I evaluate Demand on the current instance and on the target. Those resolve to a "Yes/No" answer that are passed as two bool values to another IPermission implementation - UnionPermission. The demand on this permission just evaluates the two passed in bool values. However, ...Show All
Audio and Video Development Any method for MF PVP application fail gracefully if video driver is not PVP signed?
I am working on an application that runs protected playback with Media Foundation. I've encountered a problem that with some graphics cards, an error dialog box pops up from another process saying " Bad Image: X is either not designed to run on Windows or it contains an error". After repeatedly pressing OK for the same dialog poping up many times, I can see the application hits a debug assertion saying that ESP is not properly restored. I've read about the following previous thread in this forum and know that this symptom happens because video driver is unsigned and mfpmp.exe failed. "MF_ProtectedPlayback Sample doesn't work for Video on Vista Beta 2: Thread Start ...Show All
