|
Write your own proxy server. Then configure IE to use that server and you'll get every request with all the details you're looking for. Since the proxy is the "man in the middle" making the requests for IE, you have complete control over which requests get filled and which don't.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am developing an app in VS2005. I need to put in a reference to an existing dll. The issue is, that dll may or may not exist on the machines that the app gets installed on. The app will have branching code depending on if the machine uses the dll or not, but I am unsure if this will work. I have read that the CLR will not invoke the dll unless it is called. So if I have the dll on my dev machine, have it referenced in the project, have a Try / Catch block around the call to NEW of the dll, but have the dll dimensioned in the class, install the app on another machine without the dll, will it blow up on me? Or will the Try / Catch block stop it from blowing up?
Simple code Example:
Public Class myClass
Private dll as dllMayNotExist
Public Function Execute()
Try
dll = New dllMayNotExist
Catch
'do nothing here, if dll does not exist, it is not needed
End Try
End Function
|
|
|
|
|
That won't work. The .DLL has to be there otherwise your app will fail when the JIT compiler goes to compile the METHOD that tried to call that library. Using a Try/Catch block will have no effect because that method that contains it will never run. All external references are resolved upon JIT compile, not at execution of a class' constructor.
You'll have to check for the existance of the .DLL at the start of your code and set a flag as to whether or not it's there. Then, you'll need to write a wrapper around your two methods, one that uses the .DLL and one that doesn't, plus a dispatcher method to choose between the two methods. The Dispatcher will be the function that your outside call actually calls. The dispatcher will check this flag to see if the .DLL exists, then pass the parameters to the version that's appropriate and pass any return values back to the caller.
Caller
^ |
| |
| v
.DLL flag------>Dispatcher
^ | ^ |
| | | |
| v | v
Method Method
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
So the dll will not be declared in one function, and declared in the other?
|
|
|
|
|
Yes.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how to use scanners utility in VB
|
|
|
|
|
That's nowhere near enough information to tell you anything useful.
What are you trying to do? What scanner utility? Are you talking about a flatbed scanner? Fingerprinter scanner? Document scanner??? What?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
USING VB 6.0
I have several comboboxes named cboField(1),cboField(2),cboField(3) etc. in other words they have been created this way (indexed) for the purpose of using loops whenever necessary.
Now when I use
Private Sub cboField_keyPress(Index as Integer, Key ascii As Integer)
to produce some action on the comboboxes I only get a global action (not individual to each combobox) How can I get this as I would like to produce different actions on different comboxes on keypress on the respective fields
I tried...
Private Sub cboField(2)_keyPress(Index as Integer, Key ascii As Integer) for example gives me an EXPECTED IDENTIFIER error
Thanks for your help
Augusto
Augusto
|
|
|
|
|
It's been about 6 years since I've touched VB6... but what's that Index parameter in your function header for? I'm will to bet that's the index of the control that fired the event.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Dave,
I guess you mean this..
Private Sub cboField_KeyPress(Index As Integer, KeyAscii As Integer)
End Sub
That parameter I did not choose. VB puts it by default when I choose cboField and keypress from the menu. And it works fine only that it is not specific to any combobox but to all of them...
As I said I tried substituting cboField_KeyPress by
Private Sub cboField(1)_KeyPress(Index As Integer, KeyAscii As Integer)
Private Sub cboField(2)_KeyPress(Index As Integer, KeyAscii As Integer)
Private Sub cboField(3_)_KeyPress(Index As Integer, KeyAscii As Integer)
etc.
but then I get the said compilation error
Please suggest something..
Thanks
Augusto
|
|
|
|
|
OK, let's try this again... HAVE YOU LOOKED AT THE VALUE OF THE INDEX PARAMETER WHEN A KEY IS PRESSED??? This should tell you which ComboBox raised the event.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave, I think you have not understood my problem... If I writte;
Private Sub cboField_KeyPress(Index As Integer, KeyAscii As Integer)<br />
MsgBox ("Please use the drop down buttons and select an item from the list")<br />
End sub
everything functions and I get the message poped up as soon as I press a key IN ANY OF THE COMBOBOXES i.e cboField(1),cboField(2),cboField(3),cboField(4) etc.
My problem is that I want to have a specific message for each one of this combo SEPARATELY
How do I do that???
Augusto
|
|
|
|
|
And I think your missing the purpose of that Index parameter.
Private Sub cboField_KeyPress(Index As Integer, KeyAscii As Integer)
Select Case Index
Case 1:
' The first combobox fired KeyPress
MsgBox "Hi from ComboBox 1!"
Case 2:
' The second combobox
MsgBox "Hi from ComboBox 2!"
Case 3:
MsgBox "Hi from ComboBox 3!"
End Select
All you had to do was check the value of Index...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Wow, it works !!!!!!!!!
you are a Genius Dave! Thanks a million and have a nice weekend
Best regards,
Augusto
|
|
|
|
|
I use ColouredDataGridTextboxColumn for my Datagrid.I override its Paint Method and apply colur to entire row depending upon a column value.
It works Fine till this Point.
The Problem Is:when i Click on the Datagrid Header to sort the colmn(this grid has default sorting enabled)the rows chage but the colour does not change according to new values.
Will be very Thankful to anyone who can provide solution for this
|
|
|
|
|
Hi,
I also used a prepaint routine in a project. The following routine will pre paint a cell either red or blue depending on if it's positive or negative.
I'm sure you could use something like this to fix your problem, if you refresh the grid the colours will be repainted again in the correct location.
See below......
Private Sub grdAdjustments_RowPrePaint(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowPrePaintEventArgs) Handles grdAdjustments.RowPrePaint
Dim tmpCellPos As New DataGridViewCellStyle()
Dim tmpCellNeg As New DataGridViewCellStyle()
tmpCellPos.BackColor = Color.FromArgb(30, 124, 230)
tmpCellNeg.BackColor = Color.FromArgb(253, 92, 65)
Try
If Me.grdAdjustments.Rows(e.RowIndex).Cells(2).Value > 0 Then
grdAdjustments.Rows(e.RowIndex).Cells(2).Style = tmpCellPos
Else
grdAdjustments.Rows(e.RowIndex).Cells(2).Style = tmpCellNeg
End If
Catch ex As Exception
ErrorCodeLog(ex.Message, ex.InnerException, gstrACTIVEFORM)
End Try
End Sub
Hope this helps
John
|
|
|
|
|
hi members,
Can somebody guide me that how to print the contents of webbrowser. I achieve this is vb 6.0 through but execwb not available in .net.
Thanks
Regards
|
|
|
|
|
Hi all,
I'm new in visual studio2005 and software development for PPC, but I use to make lot of microcontrolled harwares so I'm not an absolutelly newbyte for different Basic programing languages.
Now I would like to communicate with a serial device using my PDA with Windos mobile 2003.
Could somebody send me a short sample project vritten in VB how to enumerate PPC's serial ports in a listbox or so, selecting serial port, setting the baudrate, opening and closing the serial port, sending and receiving some text or any kind of data from and into a textbox.
Many thanks in advance for any help!
|
|
|
|
|
You'd probably get a better answer in the Mobile Development[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Members,
I need some info regarding simple printing a file in .net.
Regards
|
|
|
|
|
Ali 110 wrote: I need some info
And that would be ....?
Print what file? A text file? A PDF file? Word document? What? Do you want your application doing the printing or are you trying to get the application that wrote the file to do the printing? What part of the printing process are you having a problem with?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for reply
I need to print html & text files
I want to print these files in .net without using complications of PrintPage event.
Regards
|
|
|
|
|
Well, you can cheat and do it. Drop a WebBrowser control on your form, load the document you want to print into it, then call the WebBrowser's Print method.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi buddies,
how to convert date in dd/mm/yy format in vb.net.
I am using dateadd function to change my months to one month back.
dateadd("m","-1",datetime.today).
It gives me date as 10 13 2006.
I want it in 13/10/2006 format
Thanks in advance
Satishk
|
|
|
|
|
You van use ToString
dateVar.ToString("dd/MM/yy")
|
|
|
|