|
Everything has been taken into consideration before hand so no advice please in how it should be but thanks for the effort.
|
|
|
|
|
I am working on an application where user needs to select a folder. I am using dirListBox and DriveListBox from VB6. Reference's are Microsoft.Visualbasic.Compatibality and Microsoft.VisualBasic.
It's populates the combo box for DriveListBox, but when i try to scroll down to select a drive , application bombs on me giving error
An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.compatibility.dll
"Specified Cast is not Valid"
Any idea why it is doing that? Here is the code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblStatus.Text = "Not Running"
FindAllDrives()
DriveListBox.SelectedIndex = 1
End Sub
Private Sub FindAllDrives()
Dim strDrives() As String
strDrives = Directory.GetLogicalDrives
Dim strDrive As String
For Each strDrive In strDrives
DriveListBox.Items.Add(strDrive)
Next
DriveListBox.SelectedIndex = 1
End Sub
Private Sub DriveListBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DriveListBox.SelectedIndexChanged
' Dim folders() As String
Try
DirListBox.Path = DriveListBox.Text
Catch
MsgBox("Can't access selected drive")
End Try
End Sub
Private Sub DirListBox_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DirListBox.SelectedIndexChanged
lblFolder.Text = DirListBox.Path.ToString
strFolder = lblFolder.Text
End Sub
Please help if you have any idea! Thank you.
Zulfikar Ali
|
|
|
|
|
I figure out the problem. I am using DriveListBox and in the same time using a function to populate the DriveListBox combobox. I eliminated the FinDAllDrives and woolaaa. Thanks.;)
Zulfikar Ali
|
|
|
|
|
I'd like to display exponent in label of VB6.0
For examble : 2^x or x^3
Please show me the way to solve this problem.
Thanks and best regards,
TB.
|
|
|
|
|
Not really sure what the scope of your question is so I will say this:
label1.Caption = "2^x"
This will allow you to display an exponent.
HTH
Nick Parker
The greatest lesson in life is to know that even fools are right sometimes. - Winston Churchill
|
|
|
|
|
Hi,
I want to retrieve text from the mirc channal window or from the private message, I used SendMessage api to get its text lenght and then the text but it always return 0 length, code tried:
Let lngmirc& = FindWindow("mirc", vbNullString)
Let lngmdi& = FindWindowEx(lngmirc&, 0&, "mdiclient", vbNullString)
Let lngchannel& = FindWindowEx(lngmdi&, 0&, "mIRC_Channel", vbNullString)
Let lngedit = FindWindowEx(lngchannel&, 0&, "Static", vbNullString)
I also tried using the EnumChildWindows and get the window handle to get its text but no use. And also used SendMessageByString() api.
Anyone have any idea.
Thanks in advance.
|
|
|
|
|
Here is an unusual question. I am using function points to estimate the size of a program. Since I have an estimate for the number of function points that I have I need to figure out how many source lines of code I need to use. The published conversion factor for Visual Basic 5.0 is about 29 SLOC / Unadusted function point. Does anyone have a conversion factor or a reference for VB.NET?
|
|
|
|
|
How can i merge two PDF files and create a new PDF file in VB. NET? Thank you in advance for your help.
Zulfikar Ali
|
|
|
|
|
I have a large data strucutre that is used in an embedded C application. I have replicated the strucutre in VC++ and put a class wrapper around it. This data structure contains mostly basic data types. However there are a few fields that are fixed length arrays (char []) as string placeholders.
I need to transport this structure to VBA. I have used IDL in order to solve this before. But I was wondering if you guys have any other reccommendations. ?
We are using an excel spread sheet as a tag list for our product. I will use this data to generate a binary file that will be used by our embedded software to configure hardware at run-time.
Could the VB Gurus please tell me how I can transfer this data to the DLL... what is the best way??? Lets say I store the excel data in a vb data strucute (and use an array of these strucutres). can I pass a pointer to that block of memory to my dll. Can I go in reverse as well? I know there might have to be translation. Im a little stuck here, please help..
Ryan Baillargeon
Software Specialist
Fuel Cell Technologies Inc.
|
|
|
|
|
You can pass the actual pointer of your vb structure to the C Dll using the ByRef flag which is declared on your parameters of the Public Function...Lib..Alias...(ByRef mystruct as MYSTRUCT) hook in vb. You can then use the pointer to modify the contents in the dll and vb SHOULD be ok with it. However there are problems with it, especially surrounding MODIFICATION of strings in the dll since vb uses BSTR's (a unicode string that can ignore null terminators) and I bet that your dll uses LPSTR's which are non unicode (which is perfectly acceptable). VB should convert them to BSTR's but I have encountered fiddly problems with it that tested my patience .
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
Hello ,everyone,
I want to simulate an animal's movement on a specified terrain.
According to the terrain's changement,I can also change the
animal's moving direction and velocity.
Besides,the animal behaves in random on the rerrain.
In the first step.we can just take the animal as one point.
Anyone has any good idea or code example for me?
thanks a lot.
wang
|
|
|
|
|
I wounder how null values from a database can be handled in VB 6/ADO. Is it possible to pass a null value from a recordset to a
VB parameter?
When I try to pass a null value from a recordset to a VB parameter, it fails and the function is stopped. The parameter types are integer (mapping between datatypes is correct).
Am I having a wrong (database-) perspective and try to handle null values in a way that you are not supposed to?
Any enlightning response is welcomed!
|
|
|
|
|
The only variable type in VB 6 that can store a null is Variant. But Variant leads to bad programming, usually. You need to put an if before each strongly-typed use of a NULLable database field. That's why some people avoid NULLable fields like hell.
"In an organization, each person rises to the level of his own incompetence." Peter's Principle
|
|
|
|
|
Thank you Daniel, I think I'll stick to "some People" except were it is really necessairy to use nullvalues!
/R
|
|
|
|
|
Rulle wrote:
I wounder how null values from a database can be handled in VB 6/ADO
You can check the value of something being returned from the recordset with isnull(adors("someField")) .
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
After executing datareport , when i add new entries, and then run report, it does not show new entries. how i can refresh them. during running program
|
|
|
|
|
You need to requery the data through the data environment. However, I have found this to be a nightmare (and in general vb), thats why I'm online..trying to find a better approach(besides writing a C dll that does the job cos it would take a while).
Why is Visual Basic so pants?
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
How can specify a discontinuous range in the propery 'Values' in a chart serie.
I've tested with: serie.Values = "=E_1!R1C1:R3:C1;E_1!R5C1:R7:C1" but I obtain an error 1004.
Thanks.
|
|
|
|
|
hi friends,
i am facing problem in calling a crystel report from vb.net having on demand sub
reports.
My main report has 4 params and on demand sub report has 2 params. The code of passing
params is running perfectly without any sort of error but when i assing my reportdocument
object (report) to the crviewer object ( crViewer.ReportSource = rpt) is shows me
parameter input value box. The things work fine with report having no on demand sub report.
following is the code for parameter passing and calling the report
Dim crParameterFields As New ParameterFields()
Dim crParameterField As ParameterField
Dim crParameterDiscreteValue As ParameterDiscreteValue
crViewer.ParameterFieldInfo = Nothing (created at design time)
On Error GoTo eHandle
'rpt.DiscardSavedData()
crParameterDiscreteValue = Nothing
crParameterField = Nothing
crParameterDiscreteValue = New ParameterDiscreteValue()
crParameterField = New ParameterField()
crParameterDiscreteValue.Value = v_sCompanyName
crParameterField.ParameterFieldName = rpt.DataDefinition.ParameterFields(0).Name()
crParameterField.CurrentValues.Add(crParameterDiscreteValue)
crParameterFields.Add(crParameterField)
crViewer.ReportSource = rpt ( shows paramters input box at this line)
i would be helpful if someone could help me out. I have searched on many sites but not much
info is received.
thank you very much
Vaibhav Shah
|
|
|
|
|
Hi. I have been asked to develop my first telephony application. I think I want to do it with Visual C++ or Visual Basic.NET. The application: A program that will let the user dial in to his/her voice mail and access all of the features of the voice mail throught the computer. Does anyone know of existing libraries that might be helpful? Do we need a special modem? Does anyone know if it might be easier to implement in another language? Any help would be greatly appreciated.
|
|
|
|
|
SuperGeek wrote:
A program that will let the user dial in to his/her voice mail and access all of the features of the voice mail throught the computer.
If by this description you mean that the user should be able to pick up his phone and use the computer program to dial VM and interact with it via the DTMF menus that the user would normally press then it is not too difficult. Depending upon the OSs that you need to support, take a look at Tapi (V2 or V3). V3 places a COM wrapper around Tapi making it a bit more VB friendly that V2 was. V2 was/is very difficult to use via VB because of it's extensive use of pointers, variable length structs (requiring much use of memcopy) and callback functions.
If by this description you mean that you want to make messages left in a users mailbox available via some GUI interface, then things can get much prettier or much uglier, depending on the VM system you are working with....
If the VM stores it's messages in a open store (DB or directory structure) and in some format that you can get a coder to play, then it might not be tooooo difficult. These types of systems are called 'Unified Messaging’ (UM), and generally are developed as part of the VM platform itself as a value-added feature (to get more money). You might not be able to get things too tightly coupled if this is your intent unless the VM maker has designed the system to be open and extensible (don’t know many that do).
If low cost UM is what you are after, you might just be better off writing your own from scratch. Trust me when I say this.. I help folks do things like this for a living. It MIGHT just be simpler to start over
|
|
|
|
|
Thanks for advice. I will have to look into the TAPI. I would prefer to work in VB or VB.NET. The application is really supposed to be a GUI that let the operator here voice mail and exercise the options in the voice mail. I do not think we are going to be supporting any sort of database. We are dialing the voice mailbox, sending the tones through the phone line, for example if the option is press 2 for "To Reply to this Message" the user could click a button for reply and the software would send the tone for two. I think we can get by with only supporting windows 2000 or XP.
|
|
|
|
|
|
THANKS! I have never seen that gotdotnet site before, I think I may start spending some time there. I think TAPI is definetly the way to go, (assuming I have a modem that supports TAPI). Does anyone know of any good books or websites that detail the TAPI functions?
|
|
|
|
|
Ok, I am halfway done for implementing my telephony application and I encountered a major problem. I am using a ZOOM USB Modem and was stunned to learn that it is half duplex. When I dial the phone, and the voice mail answers I can set tones and transmit voice, but I cannot hear what is going on at the other end. How do I switch from a send state to listening state?
|
|
|
|