Answer Questions
Laughing John SetWindowsHookEx Always returns Zero
I am using VS 2005 8.0 I do not know why the following code is always returning zero for the SetWindowsHookEx. I have unchecked the "Enable the visual studio hosting process" in the projects debug properties but it always passes the If _mouseHook.Equals(0) condition and the Hook is not initiated. Can anyone tell me why Below is all the code on the form. Thanks. Imports System.Runtime.InteropServices Public Class Form1 Inherits System.Windows.Forms.Form Private _mouseHook As Int32 = 0 Private _mouseHookProc As CallBack Private _appThreadID As Int32 Private Const WH_MOUSE As Int32 = 7 Private Delegate Function CallBack( ByVal nCode As Int32, ByVal wParam As ...Show All
Pam B Application - Object Browser interface.
Alright, I must admit that I am an object browser addict. Is it a Dll that an be called by another application you can write your own Object Browser using reflection. here is a tutorial http://www.programmersheaven.com/2/Dot-Net-Reflection-Part-1 Jack thank you so much for the reference! I'm good but I don't think I'll be able to write anything that nice - this year. :) Does the object Browser use reflection It is slow and reflection is slow. It has to be looking at classes etc. And it has a lot of text so isn't it doing more than just reflection It could be that the Object Browser uses the native metadata interfaces instead of .NET reflection. Not only that probably this is faster but it also avoids ...Show All
cpf Recordcount is -1
Have just looked at the post from TheDogger about getting -1 for a recordcount when using ADO recordsets in VB6 - I found the same behavior in VB.NET. The only cursor I found that allows the recordcount property is ADODB.CursorTypeEnum.adOpenStatic So, to get this and related properties to work: 1. Add either COM or .NET ADO reference to your project. 2. Create a connection string (I put mine in application settings) 3. Dim Conn As ADODB.Connection Dim RS As ADODB.Recordset RS = New ADODB.Recordset Conn = New ADODB.Connection Conn.ConnectionString = My .Settings.connSQL 'or your connection string Conn.Open() RS.ActiveConnection = Conn stRS = "Select * from Customers" 'use your own select statement ...Show All
MaggieChan Newbi Question..
As much as I don't care for that word, newbi.... In my IDE when writing code, I have green squckly lines under some of the code. the tool tip says "Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. But my code still runs without error. What does this mean Brian It is only a warning saying that you are using an instance of an object to use a shared method...for example Dim myfile As System . IO . File myfile . Copy ( "Source" , "Dest" ) will produce the same warning because MyFIle is an instance of System.IO.File and all that is needed in the code is System . IO . F ...Show All
Mr Switch I can not edit code while debuggind and in break mode
When I am in break mode, I cannot update code. I receive message "Cannot currently modify this text in the editor. It is read only." Can anyone explain why I get this message All the Best, Charlie I tried running the VB 6 IDE, and it works fine. I wrote a simple program with only a few statements in it, and the debug/edit works on VB6, but not on Visual Studio. Charlie thanx to all for giving these valuable information. In VisualStudio 2005, Edit & Continue is back, so in many cases you are able to edit the source code. Things that may cause this to happen include: - You attached to the process (didn't start it from within Visual Studio) - You have disabled Edit & Continue (Tools->Options-> ...Show All
sfibich Print Preview: PrintableArea and MarginBounds
Hi - Can anyone explain simply what causes the difference between the PrintDocument.DefaultPageSettings.PrintableArea rectangle and the MarginBounds rectangle of the graphics passed to PrintPage And how to calculate the latter from the former Thanks v much, PrintableArea is the area that the printer can print to and is calculated from the Bounds minus the HardMarginX/Y. It doesn't account for the Landscape mode. MarginBounds is the PageBounds minus the Margins and does account for Landscape mode. Thus PaperSize => PrintableArea + HardMargins for PageSettings PageSettings.PaperSize => PageBounds* => MarginBounds* + PageSettings.Margins for PrintPageEventArgs where "*" marks prope ...Show All
Duncan Smith 1974 how to do this???
A. Application: Control Structures Procedures Arrays B. Program Specification: Project Name: countletters Project Type: Windows Application C. Requirement Description: Write a windows application that accepts a string as input and determines the number of occurences of each character in the string. Implement this using a form with a TextBox, a Button, and a ListBox. Please refer to the graphic file(s) associated with this Machine Problem. Use the TextBox as the data entry for the string, the Button for invoking the count process, and the ListBox for the output. Assume that the user may enter any number of printable character available in the ASCII table. Ignore the spaces and the character case if alphabetic(i.e. 'A' an ...Show All
Wabnuts Weird DataGridView Adding Data Error
I'm having a weird problem while using a DataGridView. I'm using a DataGridView to display some information in an list of something called a Flag. Most of the information are String, one column per Data Property. In my program, I've got a button I press to add an element to this list. So it adds a new flag and refreshes the DataGrid and the new Flag appears. Now, here's the problem. If a Flag is added to the list before the DataGrid is first shown, it works fine. BUT, if the list is empty when the DataGrid is shown and I then press the button to add a new flag, I get an IndexOutOfBoundsError when I click on any cell in the DataGrid. It's the most bizarre thing; if I start with a flag in the list before showing the Grid, I can a ...Show All
RandomTiger JScript to VB
im converting a website from no asp.net abiltys to asp.net 2.0. origanaly the site used jscript to do interactivity now i want to use VB. some of the code i dont understand so i cant convert it. any help would be great. the code is (its very long): var document_gregorian_year = "1998" , //Curent english year document_gregorian_month = new Array( "January" , "Febuary" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December" ), //English months document_gregorian_month_index = 0 //Curent english month document_gregorian_wday ...Show All
Rajesh batchu Difference between SyncLock and Monitor's Enter/Exit?
It seems to me that the SyncLock(OBJ) End SyncLock And the Monitor methods Enter and Exit essentially do the samething to obtain exclusive locks on objects while multithreading. Is there any difference between the two in terms of performance or function The SyncLock syntax is simply the short hand method you use in code. The compiler adds all the monitor interaction and exception handling for you. Best to use SyncLock, at least then your code is succinct and you know the compiler will optimise the blocking for you. Richard Daticus, In MSDN, when you search the Monitor class in the following link page, http://msdn2.microsoft.com/en-US/library/system.threading.monitor.aspx . ...Show All
aschaeffer How to Copy Controls in Code???
Visual Studio 2005... Casual Programmer... My apologies for this simple question but I continue to be stumped with this issue... 1. Create a Windows Application; add a GroupBox control named GroupBoxTemplate to the Form. 2. Add some graphics to this control. 3. How do I create copies of this GroupBoxTemplate including the graphics in code 4. The following code does not produce separate copies since the three controls all point to the same object on the heap. How do I modify the code to generate independent copies of the GroupBoxTemplate Dim GroupBoxCopy1 As System.Windows.Forms.GroupBox Dim GroupBoxCopy2 As System.Windows.Forms.GroupBox GroupBoxCopy1 = New System.Windows.Forms.GroupBox GroupBoxCopy2 = New ...Show All
theblackhat two question??
Whats the difference between CType() and DirectCast() also what is the difference between Dim val As Integer and Dim val as Int32 To quote MSDN on the subject of CType() vs DirectCast(): DirectCast does not use the Visual Basic run-time helper routines for conversion, so it can provide somewhat better performance than CType when converting to and from data type Object. As for Integer vs Int32... Integer is nothing but a language keyword that acts as a shortcut to Int32 which is used completely behind the scenes. While it may seem redundant to define two different names for the same value, this enabled a programmer to use legacy code and keywords without having to learn all of the newness of .NET all at once. ...Show All
krishna_aloha WebBrowser Control in visual basic 2005
hi, i used web browser control using which i can browser all the url. what i want is while clicking the links by pressing the swift key, i want to open my broswer instead of default browser with that link which i clicked. second is how to increase the size of the font in that webcontrol thanks in advance kamal Hi Kamal, The Windows Forms General forum is probably the best place to ask this quesiton. Please see: http://forums.microsoft.com/MSDN/ShowForum.aspx ForumID=8&SiteID=1 ...Show All
TannerH VS2005 "View in Browser" auto save option setting
Hi, in VS2005 while after editing an HTML file and then selecting "view in browser" a prompt box always comes up stating "The website contains open documents with unsaved changes. Do you want to save your changes before previewing this file " Is there a setting to always save rather than prompting I tried various setting in the options... but nothing worked ! Thanks. Moving to VS forum Tim <MSFT> ...Show All
domochan encryption
I have been looking on the internet for some kind of a way to encrypt a string in VB ( i am encrypting passwords then saving them to my database) How would i do this, I just want to have it in a modual so i can just call a function. you can create a hash (MD5) and use this to compare with your input hashed value. This is a one way hash meaning you can't decrypt the hash value and only computes the hash value. you could also use RSA/Rijndael algorithms too you can create a method which does this in some public class which you can expose the methods to do the job for you. http://msdn2.microsoft.com/en-us/library/system.security.cryptography.md5.aspx http://msdn2.microsoft.com/en-us/library/syst ...Show All
