|
Thanks for your reply, but i am not familier with C++/COM, I just need the VB decleration of the two functions AssertGPIO and DeassertGPIO to be able to call these two function of the DLL file.
|
|
|
|
|
Alex_73 wrote: but i am not familier with C++/COM,
I guess you're stuck then
Alex_73 wrote: I just need the VB decleration
But, you see, C is a powerful language, Vb6 is a beginner language. There is no guarentee that such a declaration exists, and there IS a guarentee that C can do things that VB6 plain can't. I believe this is one of them.
VB6 is also completely out of date and unsupported. Why are you stuck with having to use a dead language ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks anyways, I had to do it in VB as its part of awhole project done before in VB, maybe we need to change the project at the earliest to something like C++ or Java...
I solved this problem by writing a new simple c++ DLL includes the .h file and the some of the .cpp code, this new DLL exports the functions to be used in VB6.
|
|
|
|
|
Hey guys,
Got a little problem...I created the program ConvertXBatch. (A batch utility for ConvertXtoDVD as it doesnt have its own batch functions.) Anyway, when you are converting a movie, it will display something like this in the title bar of ConvertXtoDVD.
"ConvertXtoDVD - 1.5%
Now I have written this stuff below, which is supposed to loop through all the processes till it finds the ConvertXtoDVD one..so..
1. Loop through processes searching for ConvertXtoDVD in the title..
2. When found store the ProcessID, set found to True.
3. Then parse the title so all I have left is the digit before the decimal point.
4. Update the progress bar.
Now, this is currently set at every 5 seconds because it uses alot of CPU every time it cycles through that loop. Now the only problem is when Found gets set to true, when a new instance starts of ConvertXtoDVD, it might (most likely) get a different processID, which then returns an ArgumentOutofRange Exception.
I did have the Found variable in the declaration part so that it only looped once on the first round...but that caused problems too..
Does anyone have any suggestions?
Public Sub getPercent()
Dim found As Boolean
Dim id As Integer
Dim temp As String = ""
Dim percent As String = ""
Dim proc2 As Process
Dim progPercent As String = ""
While Not found
For Each proc2 In Process.GetProcesses
If proc2.MainWindowTitle.Contains("ConvertXtoDVD") Then
found = True
id = proc2.Id
End If
Next
End While
If found Then
proc2 = Process.GetProcessById(id)
temp = ""
temp = proc2.MainWindowTitle.Remove(0, 16)
percent = temp.Remove(temp.Length - 1, 1)
progPercent = percent.Remove(percent.Length - 2, 2)
fileProgress.Value = progPercent
Label1.Text = progPercent
End If
End Sub
Basically, I would like it too loop once to find the processID, then next time it gets the percent it doesnt have to loop, it can use the processID.
This is on Windows Vista (UAC turned Off), Visual Studio 2005.
|
|
|
|
|
You can probably speed this up a bit by using GetProcessesbyName instead. This way, you won't have to iterate through every process running on the system, checking it's title bar text, you'll have to just the processes with your ConvertXBatch stuff.
Once you have found them, you'll probably want to create a class to watch that specific process, and only that process. You can write it so it handles the Exited event of the Process object.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
im building a login form using mysql but i cat figure out how to check if the username and password is correct.
this is the code i have
Try
conn.Open()
da = New MySqlDataAdapter("SELECT * FROM tblSysLogin WHERE username='" & TextBox1.Text.ToString & "' and password='" & TextBox2.Text & "'", conn)
myCommand.ExecuteScalar()
If myCommand.ExecuteScalar > 0 Then
MsgBox("success")
Else
MsgBox("error")
conn.Close()
End If
Catch myerror As MySqlException
MessageBox.Show("Error Connecting to Database: " & myerror.Message)
End Try
but dont work....
it say "Connection must be valid and open"
any ideas?
thanks
|
|
|
|
|
What is your connection string? I didn't see anything about that in your sample code...
|
|
|
|
|
Imports MySql.Data.MySqlClient ' this is to import MySQL.NET
Public Class Form1
Dim connString As String = "server=seerver;" _
& "user id=username;" _
& "password=xxxxxxx;" _
& "database=databasename"
Dim conn As New MySqlConnection(connString)
Dim da As MySqlDataAdapter
Dim dst As New DataSet
Dim State As StateEnum
Private Sub Form1_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
conn.Close()
conn.Dispose()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Close()
End Sub
Dim myCommand As New MySqlCommand
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
conn.Open()
da = New MySqlDataAdapter("SELECT * FROM tblSysLogin WHERE username='" & TextBox1.Text.ToString & "' and password='" & TextBox2.Text & "'", conn)
myCommand.ExecuteScalar()
If myCommand.ExecuteScalar > 0 Then
MsgBox("success")
Else
MsgBox("error")
conn.Close()
End If
Catch myerror As MySqlException
MessageBox.Show("Error Connecting to Database: " & myerror.Message)
End Try
End Sub
End Class
this is the complete code i have in the login form
|
|
|
|
|
LegionFX wrote: Dim connString As String = "server=seerver;" _
& "user id=username;" _
& "password=xxxxxxx;" _
& "database=databasename"
Make sure the MySQL service is running on the machine named seerver, or you could try the ip address of seerver. I think you may need to specify the port as well, which is default to 3306...
|
|
|
|
|
The server is running fine. the connection is fine, the only problem i have in the code is finding out how to check if the username and password exist in the database table .
ive searched on google but only find integrated security and msaccess examples (in vb.net).
Cheers...
|
|
|
|
|
LegionFX wrote: da = New MySqlDataAdapter("SELECT * FROM tblSysLogin WHERE username='" & TextBox1.Text.ToString & "' and password='" & TextBox2.Text & "'", conn)
myCommand.ExecuteScalar()
I don't see anything tying da to myCommand . That might be the problem. Also, the query is subjected to injection attacks, so I'd be careful with that. One great article on this site to check out is SQL Injection Attacks and Some Tips How to Prevent Them[^]...
|
|
|
|
|
there is no attachment between da and myCommand,
if you are trying to get the data,
use mysqldatareader with mysqlcommand.
dim dr as mysqldatareader
dr = cmd.executeQuery()
if dr.read() then
msgbox "success"
else
msgbox "incorrect login"
end if
or if you want to use mySQLDataAdapter then use it with mysqldataset
Vilsad P P
MCTS (Windows Applications) .Net 2.0
|
|
|
|
|
.... nope... i dont want to get the data, i just want to read it to check if certain data is present in the database, and give a true or false result (user exists or not in the database)
your code help a bit but whats the declaration for the CMD.executeQuery.
Cheers and thanks
|
|
|
|
|
case closed, finaly its done.
~
Dim sSQL As String
Dim conn As New MySqlConnection("server=xxxxxx;" _
& "user id=xxxxxxx;" _
& "password=xxxxxxxx;" _
& "database=xxxxxxxx")
Dim cmd As MySqlCommand
Dim drData As MySqlDataReader
Try
conn.Open()
sSQL = ("SELECT * FROM tblSysLogin WHERE username='" & TextBox1.Text.ToString & "' and password='" & TextBox2.Text & "'")
cmd = New MySqlCommand(sSQL, conn)
drData = cmd.ExecuteReader()
If drData.Read() Then
MsgBox("success")
Else
MsgBox("incorrect login")
End If
Catch myerror As MySqlException
MessageBox.Show("Error Connecting to Database: " & myerror.Message)
End Try
so simple and so complicated.... lol thanks for all you help guys. Cheers
|
|
|
|
|
LegionFX wrote: thanks for all you help guys
Glad you got it working
|
|
|
|
|
glad you got it working
cheers
Vilsad P P
MCTS (Windows Applications) .Net 2.0
|
|
|
|
|
please i want help from any body here
i want to take mcpd exams
for that i want help from any body here have(test king exams (70-536)
-(70-526) for visual basic2005
any body help me
that first time i enter that site
and i hope the help me
and promise any body here to help all after i finish
i wait in my email sadagc2002@yahoo.com
good times with best site
by
saad badr
|
|
|
|
|
Help with what? Whats on the exams? How to register for them? ...
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
thanks for respond
iam searching about the testking and questions
iwant to training on exam before enter
iam searching about e xam but a not found yet
thanks
saad badr
|
|
|
|
|
There are free ones out there, but you get what you pay for. They suck and they don't give you the same experience your going to get in the testing lab. They simulate what topics are going to be covered on the exam, but they have no idea exactly what questions you're going to see.
The best way to pass is to go into the books and practice the techniques, not the tests...
|
|
|
|
|
This is why exams are a joke. People cram for them on the web, know nothing and still pass.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am using a DGV to display data from a DataTable but I've been unable to figure out how to prevent the user from clicking on a cell and selecting it. I'd use DataGridView.Enabled = False if it also didn't prevent the use of the scroll bar.
I also checked out the DataGridView.SetStyle(Selectable, False) member but that is protected so I can't touch it. Does anyone have any suggestions?
I've disabled all editing abilities (adding, deleting, reordering, etc) for it. Setting DataGridView.ReadOnly = true also doesn't work for me.
---- UPDATE:
This problem can be solved with
Private Sub DataGridView3_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView3.SelectionChanged
DataGridView3.CurrentCell.Selected = False
End Sub
-----
Gr,
Mightor
A paralytic chicken ran away with my sig.
-- modified at 15:03 Saturday 5th May, 2007
|
|
|
|
|
hi,
Can any one help with creating a splash screen for an vb.net 2005 application which after a specified interval diappears and the mdiparent form in shown.
If someone help me it would be great help for me.
Thanks
|
|
|
|
|
You'll need to create a form to act as your splash screen. Once you've done that goto Project > Properties. Make sure the Application tab is selected. At the bottom there should be a combobox which is labeled 'Splash Screen'. Just select the form you'd like to use. That's it! If you'd like to adjust the minimum time it displays (I believe the default is 2 seconds) you can set 'My.Application.MinimumSplashScreenDisplayTime' in the new event of your form.
|
|
|
|
|
VS.NET 2005 (not the Express Editions) already comes with a SplashScreen template form. All you have to do is right-click your project in the Solution Explorer, click Add -> New Item..., then double-click the SplashScreen form. Give the form a name, and after it's added to your project, right click the form in the Solution Explorer and click View Code. The instructions for modifying the form are in the code comments.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|