GusBraga's Q&A profile
Visual Studio Express Editions stand by exe
how do i make a simple exe that when i run it, ti puts windows in to stand by and what would be the same for restart, shut down, and log off Hi, look at SetSuspendState and ExitWindowsEx. To use them from vb.net you will need these declares. Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As Int32, ByVal dwReserved As Int32) As Int32 Declare Function SetSuspendState Lib "powrprof.dll" (ByVal Hibernate As Boolean, ByVal ForceCritical As Boolean, ByVal DisableWakeEvent As Boolean) As Int32 -- SvenC ...Show All
SQL Server SQL 2005 Reporting Services SP2 integration with MOSS 2007 SSL error
Hi, I have just installed RS and SP2 on a server running a MOSS 2007 (with SSL using an internal certificate) and configured RS to work on Sharepoint Integrated Mode. Then I went to Sharepoint to configure RS options, but when I tried to set up the Set Servers Defaults I receive the following error: An unexpected error occurred while connecting to the report server. Verify that the report server is available and configured for SharePoint integrated mode. --> Server was unable to process request. ---> The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> The remote certificate is invalid according to the validation procedure. Also, when I try to deploy a report ...Show All
Windows Forms ClickOnce file share icon?
This is probably a really basic (maybe stupid) question, but I have done several searches and haven't found an answer Here's one version of the documentation I'm referring to: Install from the Web or a Network Share Using this strategy, your application is deployed to a Web server or a network file share. When an end user wants to install the application, he or she clicks an icon on a Web page or double-clicks an icon on the file share. The application is then downloaded, installed, and started on the end user's computer. Items are added to the Start menu and the Add/Remove Programs group in the Control Panel . Where is the icon they are referring to in the statement: double-clicks an icon on the file share When I pub ...Show All
.NET Development .NET 1.1 vs .NET 2.0 behaviour with Image fields
In not .NET 1.1 and 2.0 the System.Type mapping for a SqlDbType of Image is byte[]. If you use this type to create a SqlParameter (with a value of DBNull.Value) and then use this in a SQL statement of the form "Update table Set ImageField = @parm where ......" Then in .NET 1.1 it works, but in 2.0 you get an Exception "nvarchar is incompatible with image" How can you determine the correct System.Type to use for Image fields, and why is the behaviour now different The application code is generic and not tied to specific database designs. Thanks Tony im not entirely sure about that one to be honest. I'm actually a bit confused on what you are trying to do - ...Show All
.NET Development How to unregister a COM wrapped .NET assembly?
Hi All, I created a COM exposed .NET 2.0 dll and registered with my Windows 2000 operating system using 'regasm' and 'gacutil' Then I tried to call this component from my classic ASP page. It worked fine. But, I need to change the functionality of my assembly. I unregistered it again using 'regasm' and 'gacutil' utilities and copied my new .NET DLL and registered again. But for some reason, i still have a pointer to my old assembly and new calls to the DLL from ASP page are not working. Any Ideas I appreciate any help. Thanks A common issue is that people don't explicitly assemblyversion. Then what happens is that every build produces a differ ...Show All
Visual Basic Button_Click Events
How does one going about Knowing when a event has happened from another method ie button_click event... basicly im trying to create a login form that will go to the main form if the values from user and pass are correct. Though I also have another method that is an event for the form disposing to close the program. I hope the code below explains what i mean... basicly need an if statement to know if im disposing the main form or not depending on a button click from the logon button. This is only a test program for me to learn VB.net, so basicly i could be going way out here. Seprate question to main question I've come accross so many logical problems so far and i'll have plenty more, if i get this basic program working to a stan ...Show All
SQL Server Troubleshoot Distributed Service Broker App
Hi There Ok i have done the following on my target instance i have created an endpoint, xml schema, message types, contact, activation sp , queue and service. On the initiator i have created an endpoint, a route to the target service, same xml schema, same message types, same contact, queue and service. When i try test this by doing the following: SET @msg = CAST ( @body AS XML ) BEGIN DIALOG CONVERSATION @dialogHandle FROM SERVICE [http://ewx.co.za/DemoInitiatorService] TO SERVICE 'http://ewx.co.za/DemoService' ON CONTRACT [http://ewx.co.za/DemoContract] ; SEND ON CONVERSATION @dialogHandle MESSAGE TYPE [http://ewx.co.za/DemoMessage] ( @msg ); END CONV ...Show All
Visual Studio 2008 (Pre-release) Making a custom menu like Vista's Photo Gallery
I like the way that Photo Gallery, Media Player and Movie Maker have a black bar at the top with drop down buttons, and I have managed to emulate the bar itself, but not the buttons... I am hoping someone here can tell me how this is meant to be done Do I just create a rectangle and make it act like a button - OR - is there a preset way to do this I've almost completed it. I have the bar (looks identicle) and the button style is pretty-much finished. I just need to set the button as a resource... not as easy as I thought it was. Email me sometime and I'll give you the code. (my nick + @ hotmail . com) ...Show All
SQL Server The fastest way to stop SQL Server 2000 without admin permissions... (Bug)
Do You want to stop the SQL Server service without admin permissions Use this Code : CREATE TABLE [dbo].[stop_service] ( [NUMBER] [int] NULL , ) ON [PRIMARY] GO INSERT [dbo].[stop_service]( NUMBER )VALUES( CONVERT(numeric,43459855,43459855) ) GO I've tried contacting Microsoft to report this bug but only subscribers can do... Don't run the code above in a production environment !! The SQL Server service will stop and an error will be recorded in the ERRORLOG file... Does anybody know how to submit this error Thanks for Your help Umachandar, I don't have control over all statements executed in our servers and I'm sure that there are unnecessary conversions. The main problem here is that b ...Show All
Software Development for Windows Vista socket bind fails under vista
ive got a program im trying to get working under vista, which works fine under XP. In particular its part of the enet network library heres the code snippet: ENetSocket enet_socket_create (ENetSocketType type, const ENetAddress * address) { ENetSocket newSocket = socket (PF_INET, type == ENET_SOCKET_TYPE_DATAGRAM SOCK_DGRAM : SOCK_STREAM, 0); int nonBlocking = 1, receiveBufferSize = ENET_HOST_RECEIVE_BUFFER_SIZE; struct sockaddr_in sin; int bindResult = 0; memset(&sin, 0, sizeof(struct sockaddr_in)); if (newSocket == ENET_SOCKET_NULL) return ENET_SOCKET_NULL; if (type == ENET_SOCKET_TYPE_DATAGRAM) { ioctlsocket (newSocket, FIONBIO, & nonBlocking); setsockopt (newSocket, SOL_SOCKET, SO_RCVBUF, (char *) ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Question: How do I access the GraphicsDevice from inside a Component?
I watched the Components Demo, and I wanted to write my own Grid component, until I bumped into a problem... How do I access the GraphicsDevice from inside the component I can't find anything in the documentation, and I can't draw anything. I could use a property or something like that, but from what I've seen in the video, this access is done internally ( i.e. I couldn't figure out how the components in the demo do this). Is there an official way to do this Zima Catalin You can do this using the IGraphicsDeviceService interface: IGraphicsDeviceService service = (IGraphicsDeviceService)Game.GameComponents.GetService(typeof(IGraphicsDeviceService)); GraphicsDevice device ...Show All
Visual Studio Express Editions most efficient way to turn on and off visibility for multiple usercontrols
i have multiple usercontrols. when i click a button i have a usercontrol display and hide all others. i have a button for every usercontrol which do the same thing. see sample code below. is there a better way to do this. this is a sample for just 2 usercontrols,but real program might have 20 usercontrols. currently the program seems to redraw slow. Private Sub panel1buttons_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn1.Click, Btn2.Click selectedcontrol = sender.name Me.SuspendLayout() If selectedcontrol = "Btn1" Then UserControlwindow1.Visible = True Me.ToolStripActiveControlLabel.Text = "first window " Else UserControlwindow1.Visib ...Show All
Visual Studio 2008 (Pre-release) cliext::unary_delegate<A,R> can't be adapted to void-function
# this issue was already submitted to 'feedback' void print(String^ x) { Console::WriteLine(x); } ... // print all strings in vector<String^> v cliext::for_each(v.begin(), v.end(), gcnew cliext::unary_delegate<String^,void>(&print) ); // error! As void(System::Void) is not allowed as generic-argument, cliext::unary_delegate<Arg,Result> can't be used for void-function. I know that System::Action<Arg> can be used. however, for fancy looking, I'd like you to introduce delegate-for-void-function such as cliext::unary_action<Arg> and cliext::binary_action<Arg1,Arg2> Since the issue has been already submitted to the product feedback. Please just reply back with the lin ...Show All
.NET Development web server connection
hello i can able to connect to web server.... And the connection is established eith the web server .. So, i want to download one html page from web server thru my client program.. How it is possible in c# Pls can any boody help me.. How come you miss this Post Read this: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=863049&SiteID=1 Best Regards, ...Show All
Visual Studio Run time Exceptions
When I run the migrated project from 2003 to 2005 (C#) I'm getting the following exceptions...Any clues why I am gettting these System.OutOfMemoryException was unhandled Message="Exception of type 'System.OutOfMemoryException' was thrown." System.AccessViolationException was unhandled Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Thanks, paani ...Show All
