|
Actually, it's not the string that get's converted to a number. It's the other way around - the (2 ^ AdvBinCnt) is an integer that gets converted to a string. I have no idea why this code was written this way. It's simple math - you don't need the strings.
The expression (strvar And 2 ^ AdvBinCnt), where strvar is "32", won't return the value 32 until AdvBinCnt is 5.
|
|
|
|
|
Ah - well, that's even worse, it ends up being a string comparison. See why I hate VB ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I hate the implied stuff too. I always turn on all of the Strict stuff to eliminate most of it.
OT: I'm not going to make it to the MVP Summit. My wife will be 8 months pregnant by then!
|
|
|
|
|
Hi All
I am using a WebBrowser control to navigate to sites in my VB.Net application. After navigating I want to Navigate to some of the links in it depending on some conditions. Can anybody advise how can I collect the links contained in the WebBrowser Document and how can I Raise a click event for a collected link so that it automatically navigates to the link.
I have written the code as bellow :
Dim link1 As mshtml.HTMLLinkElement
link1 = WebBrowser1.Document.Links(10)
Now How can I click the link link1 to navigate to the link.
Please Help. Thanks in advance.
Sekhar
|
|
|
|
|
Did you try using WebBrowser1.Navigate ?
"Legacy code" often differs from its suggested alternative by actually working and scaling.
—Bjarne Stroustrup
|
|
|
|
|
Hi Nilesh
I had already used that before I get this problem. I am able to navigate to url addresses using
WebBrowser1.Url = New System.Uri(txtURL.Text)
and after navigating to the site in the txtURL i found there are several links and several buttons. I want to know how I can click on a link or a button on the page so that I can actually simulate the process of someone sitting and clicking on the links.
Thanks for your response.
If anybody can help me out in finding a solution to this problem then it will help me a lot.
Thanks in advance.
Sekhar
|
|
|
|
|
Hi All
I am using a WebBrowser control to navigate to sites in my VB.Net application. After navigating I want to Navigate to some of the links in it depending on some conditions. Can anybody advise how can I collect the links contained in the WebBrowser Document and how can I Raise a click event for a collected link so that it automatically navigates to the link.
I have written the code as bellow :
Dim link1 As mshtml.HTMLLinkElement
link1 = WebBrowser1.Document.Links(10)
Now How can I click the link link1 to navigate to the link.
Please Help. Thanks in advance.
|
|
|
|
|
Hi,
On the Webrowser's click event try
link1.Navigate(URLstring).
Hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Thanks Adams for your response.
My problem is when I assign the link in the line
link1 = WebBrowser1.Document.link(10)
it doesn't produce any output and the immediate line after this line also doen't gets executed. I think some errors occur in this line and the compiler is not able to track it. for which the focus goes to the exe after this line gets executed. If you can help me out in solving the problem, it will be a great help.
Thanks in advance.
Sekhar
|
|
|
|
|
Hi All,
I have Process ID(PID).
Consider, Iam opening Word Document(a1.doc), It has a PID called 2010.
Then, when i open another file (b1.doc) using the same window again, it shows same pid for both.
How can i get differentiate both the files using the PID?.
Thanks & Regards
Kumaran
|
|
|
|
|
You can't. They're using the same process. A single instance of Word can open multiple documents at the same time, so there's only going to be one process ID.
|
|
|
|
|
I am new to the code project. Can anybody help me in the code for making our application to run before explorer.exe (in Windows XP)? I didn't mean a startup edit..
Please reply..
Help mee
|
|
|
|
|
The only thing that runs before windows starts is the gina.dll, AFAIK.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Help!
Does anyone have a simple (and I mean simple) example of VB calling a C++ DLL with a floating point array parameter where C++ will modify the contents of the parameter? (I'd say "pass by reference" but this is ambiguous when discussing a call from VB.)
I've done this with strings and although it's a little finicky, it definitely works. The online examples either don't compile for truly insidious reasons (thank you MS), or are down level and don't understand SAFEARRAYS etc.
To be clear (hopefully), The idea is: VB program w/array of floating point calls C++ (or C) program that modifies the array. On return to VB, the array is modified.
Thanks.
|
|
|
|
|
I am accessing an oracle table and displaying the table in a datagrid. I am able to add rows to the table and update the database, send queries to the table and retrieve the data and display it in the datagrid. I can not figure out how to delete rows from the datagrid
I want to be able to select a row on the datagrid and click Delete and "poof" the row is gone. In a seperate procedure I will be updating the database table.
I have tried many different ways with no success.
Any one have an idea that would help?
Erica
|
|
|
|
|
Set the rowstate of the offending row to deleted
use a dataview to populated the datagrid
set the dataview filter on the rowstate
|
|
|
|
|
I get an error >
Line 1: Incorrect syntax near 'Username'
When i run the code below
hdstr = "SELECT Password FROM LogIn WHERE Username='" & UsernameTextBox.Text & "'"
hdcmd = New SqlCommand(hdstr, hdcon)
hdcmd.Parameters.Add(New SqlParameter("Username", UsernameTextBox.Text))
Dim usr As String = hdcmd.ExecuteScalar()
Please help.
JESA
|
|
|
|
|
hdstr = "SELECT Password FROM LogIn WHERE Username= @UserName"
hdcmd = New SqlCommand(hdstr, hdcon)
hdcmd.Parameters.Add(New SqlParameter("@Username", UsernameTextBox.Text))
Dim usr As String = hdcmd.ExecuteScalar()
|
|
|
|
|
Thank You.
It worked.
JESA
|
|
|
|
|
I'm having problems understanding why a loop is needed to read from a deflated stream. i've replaced the read all bytes in stream method with the following line, however the data in the output buffer is 1 byte smaller than it was before the data was compressed:
Return stream.Read(buffer, 0, buffer.Length)
used to be:
Dim offset As Integer = 0<br />
Dim totalCount As Integer = 0<br />
While True<br />
Dim bytesRead As Integer = stream.Read(buffer, offset, 100)<br />
If bytesRead = 0 Then<br />
Exit While<br />
End If<br />
offset += bytesRead<br />
totalCount += bytesRead<br />
End While<br />
Return totalCount
the full code for this is taken from http://msdn2.microsoft.com/en-us/library/system.io.compression.deflatestream(VS.80).aspx[^]
|
|
|
|
|
The Read method doesn't have to read all data that you request. It returns the number of bytes actually read, so you have to loop until you have filled the buffer or until the method returns zero.
Dim offset As Integer = 0
Dim bytesRead As Integer
Do
bytesRead = stream.Read(buffer, offset, buffer.Length - offset)
offset += bytesRead
Loop Until bytesRead = 0 Or offset = buffer.Length
Return offset
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi
This is Rajesh. I developed a vb 6.0 application. In that i want to access my database server table via web service in vb.net 2005.
I tried some methods for last two weeks.Please someone assist me
Thank you
c.Rajesh B.E
|
|
|
|
|
Google results for "vb6 calling a web service[^]". Since VB6 doesn't natively support this, you have to use other libraries and coerce a solution into working.
Some these involve using the native web service support built into the .NET Framework and writing a component in VB.NET that is exposed to COM, and writing the VB6 code to use that component. Other's depend on using various SOAP libraries to do this.
No, I don't have any examples. I stopped using VB6 the day I got my hands on the .NET Framework 1.0 Beta 1, some 6-7 years ago.
|
|
|
|
|
I've used the MSXML3.DLL libraries with no problem at all.
Just download the file. You can also get the SDK version. Once you have the file, set a reference to it. View its methods in the object browser and you can read the docs online.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
I have a VB 6.0 exe. It reads data from an excel spreadsheet and writes to it as well. So, the excel spreasheet is like a database for it. Presently, the spreadsheet resides in a LAN.
Now I want to "INJECT" the excel spreadsheet into the executable, so that the excel spreadsheet is not a separate entity anymore, and is a part if the executable itself. Basically, how can I turn it into an intrinsic application resource?
Can someone please shed some light on how I can do this?
Thanks.
ASP - AJAX is SEXY. PERIOD.
|
|
|
|