|
At a guess, I would say that ModemTests is not being initialized properly as an array. The String class has a default property such that MyString(x) returns the xth character; if MyString has no characters, you will get his error.
Added
I ran these two tests:
Dim s As String() = {}
Debug.WriteLine(s(0))
Dim s As String = ""
Debug.WriteLine(s(0))
Both returned IndexOutOfRangeException , which seems to blow my theory. The only other thing I can think of is that the problem is with the value of e.ReceivedData . You might want to stick in some diagnostic code to check the value before doing the assignment.
modified on Thursday, April 2, 2009 4:04 PM
|
|
|
|
|
I have this on form load, everything should be fine in the array.
For i As Integer = 0 To 4
ModemTests(i).ModemInfo = ""
ModemTests(i).Ping1Info = ""
ModemTests(i).Ping2Info = ""
ModemTests(i).SMTInfo = ""
ModemTests(i).ModemRunning = False
ModemTests(i).Ping1Running = False
ModemTests(i).Ping2Running = False
ModemTests(i).SMTRunning = False
Next
The thing is, it works fine with the test site. If i just change the site it crashes. I just don't know what the error wants from me. I've even tried passed just some text instead of a variable to the Invoke and it still gives the error.
|
|
|
|
|
Ok, i think i found the problem. The errors are occurring the ShowModem sub but for some reason are showing up as occurring at the Invoke statement.
Is there any way to disable the Threading check so you don't need all that Invoke code? I don't ever remember having to do that when using threads but last time i used VB.NET was a few years ago.
|
|
|
|
|
I thought the problem was with ModemTests(0).ModemInfo += e.RecievedData . My bad.
The only think I can see that might be wrong then is that ModemTests(0).ModemInfo should hold a reference to the method ShowModem . But to be honest, I've never used delegates like this, and I am completely unfamiliar with modem handling.
|
|
|
|
|
thanks in advance
modified on Friday, April 3, 2009 7:41 AM
modified 28-Nov-12 4:43am.
|
|
|
|
|
Seems awefully familiar to this thread you started [^]a short while back, check with the posts there. No need to repost everything.
|
|
|
|
|
|
See my post here. The exact same advice applies here.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hi,
I have a html page where i have a link and 2 radio buttons and when i click the link i need to run cmd (with selected radio button as parameter to cmd) in the background ...
Please help regarding the same...(i need to use vbscript..)
|
|
|
|
|
By Using JavaScript you can Run Command as per your requirement.
or you can use BAT file for executing Command.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
Set wShell = WScript.CreateObject("WScript.Shell")
wShell.Run "c:\windows\system32\calc.exe" Google is your friend, my friend
I are troll
|
|
|
|
|
|
patricemburu wrote: anyone with vb 6.0 code for netmeeting or knows where i can get it?
Nobody is just going to give you code.
I don't know what you mean by 'netmeeting' but if its a program, other developers worked hard on it to create it so by just requesting there work (code) your requesting to steal from them.
patricemburu wrote: pls
you have a full keyboard, use it.
patricemburu wrote: patricemburu@yahoo.com
NEVER a good idea to put your email into a forum post.
There is an email button (just as there is a reply button).
patricemburu wrote: vb 6.0
It's dead and unsupported, so why on earth would you still use it.
|
|
|
|
|
Right
- NetMeeting was not written in VB 6.0. If anything, it would have been written in C, C++ or assembler
- There is no comparison between those languages
- Stealing code is considered unethical or illegal
- Capitalisation is rather useful
- Your keyboard is not locked into the phrase 'pls'
- Posting your email is unwise for the following reasons:
- Spambots
- If you get the code, no-one else can learn from your question
|
|
|
|
|
VB6 is obsolete and unsupported. Why are you still using it ( or, that is, still trying to rip off code written in it ) ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hi,
I program in lots of languages but a few days ago I have had a go at programming in VB.net 2008 (express edition for now).
I have got an application up and running but there is an odd difference between the "debug" and 'release" version.
Both work but when I activate the "OpenFileDialog" in the "Debug" version I get a nice size "open file" window that can easily be resized.
When I do the same in the "release" version I get an equally functional "open file" window but it is always "full screen" and cannot be resized at all.
I am new to "VB.NET" and I have looked in lots of places on the internet for a tip on this but have not found anything. Can anyone point me in the right direction ?
Any help much appreciated
|
|
|
|
|
Filip Dossche wrote: but it is always "full screen" and cannot be resized at all
Wow - never seen that and I can't see any settings that would control it. Are you using a dialog dropped on the form or creating it in code?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
It is just an "Openfile" dialog that was integrated in the "designer" page and is activated by clicking a button.
It is actually derived from the 'CommonDialogs' example that came with the VB2008.Net express installation. I have not changed anything to that except for adding some extra decoding and modifying the final file content after the file has been selected and opened.
A colleague told me it could have something to do with certain settings being preset by the VB.NET developers studio when you are running the debug version and those settings being different when the application runs on its own.
As you say though I have not found anything about "OpenFile" dialog size settings or similar.
Ah well, maybe somebody will make it "glaringly obvious once pointed out" .
|
|
|
|
|
hai all,
i am using dotnet 2005 and sql server2000.i have 2 table as follow
table name as bill
cutomercode billno capacity unitmodel rate
act 101 1 ton elite plus 10
act 122 1.5 ton vertix 32
tablename as unit
cutomercode billno capacity unitmodel indoorunit outdoorunit
act 101 1 ton elite plus 232 146
act 101 1 ton elite plus 258 231
act 122 1.5 ton vertix 465 521
act 122 1.5 ton vertix 112 101
act 122 1.5 ton vertix 178 104
here cutomercode,billno,capacity,unitmodel,indoorunit,outdoorunit,rate are columns.
i wrote a command in database expert in crystal report.i passed the parameter values of customercode and billno.
i have coming as follow in crystal report print page.
SLNO capacity unitmodel
1 1 ton elite plus
indoorunit:232
outdoorunit:146
2 1 ton elite plus
indoorunit:258
outdoorunit:231
3 1.5 ton vertix
indoorunit:465
outdoorunit:521
4 1.5 ton vertix
indoorunit:112
outdoorunit:101
5 1.5 ton vertix
indoorunit:178
outdoorunit:104
the above print is wrong.mistake is repeated datas.my client expect print like 1,2,3,4 for each data as follow.i want to display as follow in crystal report print page.
SLNO capacity unitmodel
1 1 ton elite plus
indoorunit:232,258
outdoorunit:146,231
2 1.5 ton vertix
indoorunit:465,112,178
outdoorunit:521,101,104
how to print these datas in crystal report.
|
|
|
|
|
Hi,
You can use a blank table in your Database.After executing a command you can save result of data in this table.After that easily u can access table from crystal report.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
I am trying to convert a VB6 code to VB.net using VS2008. The program interfaces with excel and other programs and I have managed to get them to work ok, but get stuck when trying to call a dll I need. Have tried to follow examples without success. The dll is called NSGA2.dll and the function I want to use is called Initialize, it works fine with VB6 but not working with VB.net?
The VB6 code;
Option Explicit
Private Declare Function Initialize Lib "C:\Documents and Settings\My Documents\NSGA2.dll" (Ret1() As Double, Ret2() As Double)
Private Sub Command1_Click()
Dim Inputarrays(14) As Double
Dim DVArray() As Double
For i = 0 To 13
Inputarrays(i) = Text1(i).Text 'Takes the values from the form where there are 14 inputs
Next i
ReDim DVArray(Inputarrays(4) - 1, Inputarrays(0) - 1)
Call Initialize(Inputarrays, DVArray)
End Sub
The VB.net code;
Public Class Form1
Private Declare Function Initialize Lib "C:\Documents and Settings\My Documents\NSGA2.dll" (ByVal Ret1() As Double, ByVal Ret2(,) As Double)
Private Sub btnRun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRun.Click
Dim InputArray(13) As Double
Dim i As Integer
Dim FileName As String
Dim DVArray(,) As Double
Call GetInput(InputArray) 'Calls a Sub which takes the values from the form where there are 14 inputs
ReDim DVArray(InputArray(4) - 1, InputArray(0) + InputArray(1) - 1)
Call Initialize(InputArray, DVArray)
End Sub
Any suggestions would be grateful.
|
|
|
|
|
Do you have the source for the NSGA2.dll? If so, you could debug the VB6 version while running .Net and attempt to see where the error is occurring.
Do the bounds on DVArray match the VB6 version prior to calling Initialize?
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I do have the original source code for the NSGA2.dll, however it was compiled in VC++6, which I don't have.
The bounds for DVArray for the VB6 version and the .net version are the same.
I'm not sure how I can debug the original source code from .net. The error I get from the .net debugger is "PInvoke restriction:cannot return variants." which occurs at the Call Initialize (InputArray, DVArray) step. It doesn't allow me to procede and therefore I can't actually go into the C++ code at all.
|
|
|
|
|
I've never tried passing a variant from VS6 to .Net. Its probably an interop problem with the variant return type. It doesn't look like your using the return value so could this be made a sub or return a simple data type instead? Of course this would recompiling the source, so you'd have to get a copy of VC++6.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Hi All,
I am trying to read text from ListView of other application.
I have created a demo application which is working fine for all listview (FolderView/ Winzip Listview control and listview of some application), but it is not working for a particular Listview.
I am able to get the RowCounts/ Column Counts but I am not able to read text.
Below is my code which I am executing to get ListItem.
<pre>Private Const LVM_FIRST = &H1000
Private Const LVM_GETITEMCOUNT = (LVM_FIRST + 4)
Private Const LVM_GETITEM = (LVM_FIRST + 5)
Private Const LVM_GETSTRINGWIDTH = (LVM_FIRST + 17)
Private Const LVM_GETCOLUMN = (LVM_FIRST + 25)
Private Const LVM_GETITEMTEXT = (LVM_FIRST + 45)
strLength = SendMessage(hWindow, LVM_GETITEMTEXT, iItem, ByVal pMyItemMemory)</pre>
Above code is working fine for other listview, and strLength is returning currect length of text of the List item.
I tried to debug, and understand nature of window (Listview Window) and I observed that all other listview where it is working fine having Windows Proc as Unicode and for list where it is not working having Windows Proc as ANSI (I got this information using Windows Spy++ utility).
My understanding is to get listview item for ANSI strings there would be different message needs to pass.
I appreciate your time and thanking you for any help or direction.
Regards
Rushi
|
|
|
|