|
Fair enough, I am removing the offending code
|
|
|
|
|
Hi how to convert code in vb6.0 into vb.net
|
|
|
|
|
I believe that there are tools available that will convert a lot of the code automatically(whether it does it cleanly though is another question), a quick Google search should help you there. But, due to the fully object oriented nature of VB.NET, if possible, you should think about re-designing your application to take full advantage of this.
|
|
|
|
|
All you have to do is open the old project file (.vbp) in VB.NET and it'll launch the conversion wizard. Warning! You'll, more than likely, end up re-writing code to get it to work because there is no tool that can do a perfect conversion.
I highly suggest just rewriting the project from scratch.
|
|
|
|
|
VB6: I have a picture on form and I currently have code that will allow the mousewheel scroll the picture up and down, but I am not sure how to set a limit or how to prevent the picture from scrolling out of view. Below is my code, any suggestions:
Option Explicit
Private Const PM_REMOVE = &H1
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Type Msg
hWnd As Long
Message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Private Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (lpMsg As Msg, ByVal hWnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long, ByVal wRemoveMsg As Long) As Long
Private Declare Function WaitMessage Lib "user32" () As Long
Private bCancel As Boolean
Private Const WM_MOUSEWHEEL = 522
'**************************************
Private Sub ProcessMessages()
Dim Message As Msg
Do While Not bCancel
WaitMessage
If PeekMessage(Message, Me.hWnd, WM_MOUSEWHEEL, WM_MOUSEWHEEL, PM_REMOVE) Then
If Message.wParam < 0 Then
Picture1.Top = Picture1.Top + 240
Else
Picture1.Top = Picture1.Top - 240
End If
End If
DoEvents
Loop
End Sub
'**************************************
Private Sub Form_Load()
Picture1.AutoRedraw = True
Picture1.Print "Please use mouse wheel To move this Picture."
Me.Show
ProcessMessages
End Sub
Private Sub Form_Unload(Cancel As Integer)
bCancel = True
End Sub
YOYO
|
|
|
|
|
I need souce code about steganografi with VB 6,
anybody help me?please
|
|
|
|
|
|
hello sir, can u sent to my email explanation about steganografi and source code in VB 6?
please!
my email is adhe_pol@yahoo.com
|
|
|
|
|
No, because I haven't used VB6 in about 7 years now. It's a dead language, unsupported by Microsoft, and it's runtime will not longer be supported by the next version of Windows.
I already gave you everything you're going to get in that link in my previous reply. This is where you start researching the subject on your own.
|
|
|
|
|
Why are you using VB6 ? It's been a dead language for a long time now.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Is is possible to create a class wide conditional breakpoint in VB 2005? I have a variable value being changed somewhere within a pretty large class, but I can't it narrow down to a specific method (I've done searches where the variable is being set and placed breakpoints with no success).
In VB6 you could add a watch with a condition and set the procedures and modules to ALL. Is there similar functionality in VB .NET (something more global than "function" level)? I'm realize I'm probably missing something simple here....
Edit - I figured out my problem, but am still curious on a module/class level conditional break point.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
modified on Thursday, December 18, 2008 1:42 PM
|
|
|
|
|
It's not possible to do the way you're thinking. But, you can wrap the suspected variable in a Property, then the rest of your code can change that value through the property's Set code. Your can set you're breakpoint on that set code to get the result you want.
|
|
|
|
|
Dave Kreskowiak wrote: It's not possible to do the way you're thinking.
Grumble, grumble. Another thing I hate about .Net then! I also hate the fact that if you copy and paste code into the immediate window (todo a debug print) that is either split on multiple lines or within a "With" statement, that you must retype the full name and remove the carriage returns. VB6 just prints out the values.
Dave Kreskowiak wrote: But, you can wrap the suspected variable in a Property, then the rest of your code can change that value through the property's Set code. Your can set you're breakpoint on that set code to get the result you want.
Great idea Dave.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Normally, the only thing in a class that should be modifying the private backing variables for a property IS the property code. Yes, you can, and really should, have private properties inside classes. You can then use Trace Breakpoints on those properties. A Trace Breakpoint gives you the option of logging a message, variable values, call stack, whatever..., and then continuing execution of the code, without stopping. It's excellent for logging all changes to a variable from everywhere.
|
|
|
|
|
I previously haven't used a private property for class level variables, but I can see the proper use and benefit now with your explanation. Thanks for the pointers with private properties and tracing.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
No problem!
|
|
|
|
|
How to check System DSN name is already configured or not before creating a new DSN using VB.net2005
Saseendran Kombath
|
|
|
|
|
System DSN's (why would even need one in this day and age?) are stored in the Registry under
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ . All you have to do is check there. I suggest opening up Regedit and looking around before you start writing code.
|
|
|
|
|
Check name(as String value) is present under following registry key or not?
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC DATA Sources.
For Example:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC DATA Sources(Key) "OrcInfoCtr"(String value) "Oracle in OraClient11g_home1"(Data Value)
ashish
|
|
|
|
|
You obviously found the registry key in regedit. Isn't what you see there pretty obivous??
The DSN name would be a value under "ODBC Data Sources", then it's settings are in a folder of that name under ODBC.INI.
Honestly, how hard is it to see what's going on in there? And why are you replying to a message that's two and half years old??
|
|
|
|
|
I'm using this class Rs232 to call phone number as it happen in the commnication >> hyper terminal .. in XP-PC
I'm using the name of Modem instead of the number of port,the same way in the hyper terminal.. so is this possible and will it succees with?
Dim rs As New RS232.Rs232<br />
rs.Port.ToString("Softv92faxmodem")<br />
rs.Open()
|
|
|
|
|
I would have thought it would have been quicker to try it than post the question.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
The ony;l way to tell is to try it. Though, I seriously doubt it'll work this way.
You're best source of information and support is the people who wrote the library you're using.
|
|
|
|
|
i treid this but it didn't usccees, it didn't opem the connect.
Imports RS232.Rs232
Dim rs As New RS232.Rs232
With rs
.Port.ToString("SoftV92FaxModem")
.BaudRate = 2400
.DataBit = 8
.StopBit = RS232.Rs232.DataStopBit.StopBit_1
.Parity = RS232.Rs232.DataParity.Parity_None
.Timeout = 500
End With
rs.Open()
rs.Write(Me.TextBox1.Text)
|
|
|
|
|
I really hate repeating myself. First, the best source of support for any library you use is the people who wrote that library. Second, Port is usually going to be "COM1", "COM2", "COM3", ... or whatever the library supports. It LOOKS like this one only understands the COM designations, so:
Dim rs as New RS232.Rs232
With rs
.Port = "COM3"
.BaudRate = 2400
.DataBit = 8
.StopBit = RS232.Rs232.DataStopBit.StopBit_1
.Parity = RS232.Rs232.DataParity.Parity_None
.Timeout = 500
End With
rs.Open()
rs.Write(Me.TextBox1.Text)
Also, the communication parameters MUST be correct, otherwise, you'll either get nothing on the receiving device or you'll get garbage. Double-check with the device to verify what parameters you are supposed to use.
|
|
|
|