R Parry's Q&A profile
Windows Forms Position of context menu
Hi, How can I get the position of context menu Thank's Alexei Normally, the context menu will be shown at the center of the control when the keyboard is used to invoke the context menu of a control (Shift+F10, for example). You can customize the location as follows. Override WndProc in the grid and check if the Message.Msg is WM_CONTEXTMENU (0x007b) If so, check if the Message.LParam is -1, which means this was due to a keyboard message as opposed to the user right-clicking the mouse. Now, call the associated ContextMenu's Show method explicity at the selected row position. Make sure NOT to call the base class after show ...Show All
.NET Development Keeping Unmanaged DLL Used by P/Invoke in Memory
I use a 3rd party DLL, written in C++, that I call via P/Invoke (C#.NET 1.1). Problem is this DLL takes about 3 times as long to call the first time it initializes that it does subsequent times. Calling it via P/Invoke seems to cause it to load everytime. How do I keep it in memory so I do not get the initialization overhead everytime I call it. dimkaz wrote: Oh, and you might want to add SuppressUnmanagedCodeSecurityAttribute to your pinvoke signature to avoid security checks on every invoke. Of course, you'll only want to do that if you do not expose your P/Invoke signature publicly, and you ensure that you've ...Show All
Visual Basic Loading Data Using ProgressBar as Indicator
Here we go again folks, hope you help me out on this one...I had a form(frmAccount) wherein it has a datagridview(dgvAccount) that bounded to a certain table of my db.Because of too many records(about 20000), it takes such time(about 8seconds almost) to load all of the data...I had no idea how can I possibly decrease this loading time so I just put a progressbar(pBar) as an indicator of the process.This progressbar was attached in the main form(frmMain)...What I really want to do is, once I clicked the button on the frmMain, pBar would automatically increment to its maximum with respect to the loading of frmAccount...Simply put, unt ...Show All
Visual Studio Stepping through the debugger takes a life time.
Hi all, I have just gone through the process of upgrading to VS 2005 from VS 2003 and have noticed that when I debug my application stepping through it takes an absolute age now. It takes around 12-15 seconds for each step - making my debugging life hell :( Are there any ways I can look in to actually speeding this up Thanks Tryst Are you running into this http://blogs.msdn.com/greggm/archive/2005/11/18/494648.aspx ...Show All
Visual Studio Team System Need some help with Unit testing some code, please.
Hi folks, i'm trying to do some negative unit tests, that is, unit tests for bad scenarios, not just the good ones/happy path. so, i've got this constructor /// <summary> /// Default Constructor. /// </summary> /// <param name="username"> string: WebSerivce Authentication: Username. </param> /// <param name="password"> string: WebSerivce Authentication: Password. </param> /// <exception cref="ArgumentException"> Thrown if the username or password argument are null or empty. </exception> public MessageNetMms( string username, string password) : base () { ...Show All
.NET Development Remoting between 1.1 and 2.0 - Index outside bounds of array!
Hi We have a system written in .net v1.1. We have converted the ASP.NET interface to 2.0 ( not beta 2 , but the version that was released with the release candidate of Visual Studios 2005) The Data Access Layer is a .net v1.1 project containing a number of MarshallByObjectRef classes running as a Windows Service. Now when the ASP.NET interface attempts to invoke a method in one of these classes we get the following error, (though we can successfully create an instance of these objects): System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMess ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Can't Compile DirectX Samples with Visual C++ Beta2 (DXSDK October 2005)
Hi, when i try to compile DirectX Samples with VC++ 2005 Beta 2, the program can't include Windows.h, why How to Solve this http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=141449&SiteID=1 Also, the final release is out. Please upgrade to that. Beta 2 is no longer supported. ...Show All
Visual Studio Tools for Office A newbie question: how to control word directly?
VSTO provides a document-centric way, but sometimes I just want to control the Word directly and do some simple task, e.g. launch the word, ask it to open a .doc file, insert some text into that doc file, and save that doc file into some location on my disk. I don't want to generate some class object in my program, just want to direct the word to do something. Can I do this in VSTO Thanks! Hi, With VSTO 2005 you can only create document based solutions. With VSTO v3 you will be able to create VSTO application level add-ins with Office 2007. But for now you must create a standard COM add-in using Visual Studio. Paul Stubbs ...Show All
Windows Forms How to provide client-specific app.config for no-touch deployment
Hi, everyone: here is my issue. I want to make use of no touch deployment for my .net appliation. However, the user wants the flexibility to setup his own config. For example, this application will create some temporary files. The user may setup their own folder to save these files. Actually, these files are really huge and we don't want to save t ...Show All
Game Technologies: DirectX, XNA, XACT, etc. XNA needs visual studio 2005?
I am working with Dark Basic Professional and want to check out XNA. I have visual studio.net I can't find if XNA will work with VS.NET or if I will be forced to upgrade to VS 2005. Knowing Microsoft they will use XNA to drive sales of every new version of visual studio that gets released. So will XNA work with visual studio.net Sorry if I sound bitter about all the new version of visual C. I don't have a lot of money and I keep hitting roadblocks. Are you speaking of XNA Build or the framework XNA Build will install the Visual Studio IDE so you don't need to purchase any Visual Studio product for it to work. We don't have any pl ...Show All
Windows Forms Grid column-styles widths not applied (see style code)
I have a not-strongly-typed VB. NET 2003 dataset and one table displayed in a datagrid using a dataview. The display is entirely proper prior to applying a style. Applying a style (code below) results in very small column widths, with everything scrunched to the left. Expanding the columns using the cursor shows that all other style directives have been applied; just column widths have not been applied. Here’s the style code: Private Sub gridstyle() ' Set the styles of the columns of the grid. Dim dgY1 As New DataGridTableStyle dgY1.GridLineColor = System.Drawing.Color.Green ...Show All
Windows Forms Text box text format checking
I have some text box which allow the user to key in integer and decimal. How do i do a checking on the text enter in the text box that it is integer ot decimal E.g. Throw a error msg to the user when the user enter letters in the text box where the user is suppose to enter integer or decimal. As soon as ...Show All
SQL Server Unable to install SQL Server 2005 x64 on a cluster
I am trying to install SQL Server 2005 on a clustered Windows 2003 Server. When installing I get a generic error “Microsoft SQL Server 2005 was unable to install on you computer.” The log file contains the following error: Loaded DLL:C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\sqlsval.dll Version:2005.90.1399.0 Error: Action "InvokeSqlSetupDllAction" threw an exception during execution. Exception record 0 Exception Code 0xc0000005 Exception Flags 0 Exception Address 0x000007FF7B1D2060 Number of parameters 2 Parameter 0: 0x0 Parameter 1: 0x222000 Any ideas ...Show All
Smart Device Development SD Card Question- URGENT!!! New Question
When using a SD card for data storage does .net cache the data and write it later or does it write as used I am losing data and have no reason for this to happen. It is as though the user never wrote to the SD card. I had a user bring in his device. I looked at the screen that displayed his orders. They were there...clear as day..., orders 1-4. This meant that the user had saved 4 orders. As each order is saved, there is a file that contains a single record. This record is the order number and it is updated each time an order is saved. This would have been order number 4 in that file. ...Show All
.NET Development inserting into access database
Hello, I am trying to create a form to insert a new person into by access database. I have italisized the part where i am having the error. "Caracter not valid" is the error which i am getting for using " " and its the same when i use "@". I need to insert lastname , firstname and teamid into the access databse through form and i am using oledb connection can anyone please help me sort this issue. i am copying the entire code here <% @ Import Namespace = "system.data" %> <% @ Import Namespace = "system.data.oledb" %> < script ...Show All
