|
|
|
I have a part of my ini file
[temperature]
total=5
My code:
x=OSGetPrivateProfileString(" temperature","total","5",, sBuff, Len(sBuff), sIni)
byteTotal= Val(Left(sBuff, x))
Will the code give me byteTotal =5? What if there no those part( [temperature]) in my ini file? will it finally give me byteTotal =5?
Thanks
|
|
|
|
|
dec82 wrote: Will the code give me byteTotal =5?
Probably. What happened when you executed the code? No errors?
dec82 wrote: What if there no those part( [temperature]) in my ini file?
GetPrivateProfileString asks for a default value. It will return this value if the section or the named value doesn't exist
I are troll
|
|
|
|
|
hi all
i have bind a listbox to dataset with mulitpleselection property of listbox.
on a button click i want to reterive all the selected value by user.
please help
if possible paste the code
thanks
jagwinder
Er. Jagwinder Singh
|
|
|
|
|
Nonu Walia wrote: if possible paste the code
I refuse to paste any code by moral conviction
Take a look at the property called "SelectedItems". That's a collection of all the items that are selected by the user, being a subset of all available items.
You can use a foreach to loop through them.
I are troll
modified on Friday, February 27, 2009 5:02 AM
|
|
|
|
|
i did like this
For each Item in listbox1.selecteditems
next
cud u tell me what will the Item data type???
and how i will get the selectedvalue??
Er. Jagwinder Singh
|
|
|
|
|
Dim idx as Integer
For Each idx in myListBox.SelectedIndices
' Do something interesting here
Next
I are troll
|
|
|
|
|
Hi Guys,
I need to convert rows to columns,
I have a table shown below
ColA....ColB
X XX
X YY
X ZZ
do you know how to query this table to get a result set like
this below
ColA...ColB...ColC...ColD
X XX YY ZZ
I have tried to use a pivot query but fail to get the desired output,
please help,
thanks in advance
Anoop
|
|
|
|
|
Hi all,
I'am developing a desktop application using vb.net. I've a form with infragistics ultragrid control which populates data from database and three graphs using mschart controls. I want to have a print preview and take a print of the form (including data table and 3 graphs). can anybody provide me with sample code for print preview and print.
Thanks in advance
|
|
|
|
|
here's some code I did for print and print preview using ultragrid(grdgridmaster is the name of my grid).
You will have to code individually for each grid you want to print.
Also drag the UltraPrintPreviewDialog object onto the form.
Private Sub PrintToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintToolStripMenuItem.Click
Dim printdocument1 As New System.Drawing.Printing.PrintDocument
Dim printdialogue1 As New System.Windows.Forms.PrintDialog
Try
printdialogue1.Document = printdocument1
If printdialogue1.ShowDialog() = Windows.Forms.DialogResult.OK Then
grdGridMaster.Print(grdGridMaster.DisplayLayout, printdocument1)
End If
Catch ex As Exception
MessageBox.Show("An error occurred - " + ex.Message)
End Try
End Sub
Private Sub PrintPreviewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintPreviewToolStripMenuItem.Click
Dim UltraGridPrintDocument1 As New Infragistics.Win.UltraWinGrid.UltraGridPrintDocument
UltraPrintPreviewDialog1.Document = UltraGridPrintDocument1
UltraGridPrintDocument1.Grid = grdGridMaster
'maximize the window
Me.UltraPrintPreviewDialog1.WindowState = FormWindowState.Maximized
UltraPrintPreviewDialog1.ShowDialog()
End Sub
|
|
|
|
|
Hi,
I am new to this vb.net, my problem is i have build the windows service in vb.net c#. I deployed it in my system when i am trying to start that service it showing the error as
Error:1053 could not start the service on Local system
The service didnot respond to the start ro control request in a timely fashion
I cleared Applicaton event log also. I checked in system log. It shows the message as follows
1.Information: The Windows Installer service was successfully sent a start control.
2.Information: The Windows Installer service entered the running state.
3.Information: The Windows Installer service entered the stopped state.
4.Error: Timeout (30000 milliseconds) waiting for the windows service to connect.
5.Error: The Samplepolaris service failed to start due to the following error:
The service did not respond to the start or control request in a timely fashion.
I have tried to resolve it, but i could not... Please help me to solve this problem.
Thanks in advance.
With Regards,
Samson
|
|
|
|
|
Always tough to educated guess without seeing some of the startup code but this could be a permission issue. Perhaps your service logon does not have the necessary privileges on the service computer? If you haven't tried debugging the service yet it is really not difficult and I am sure you can google for info on how to debug a windows service.
|
|
|
|
|
From the description, it sounds like you put all of your work code into the OnStart method, never letting it return. This is why the Service Controller threw up the timeout error.
When a service starts, it's expected to setup a seperate thread that does the actual work. Once the thread is setup and started, your OnStart code can return control back to the Service Controller by just getting to the End Sub statement.
|
|
|
|
|
I am using a small vb.net program to download software update files from an internal web site (security is not an issue). The program runs periodically on the users' machines and checks for, downloads and installs new updates that have been placed on the server.
I would like the same program to upload the user name, workstation name, date, etc. to the website and have the website store this information in a text or xml file on the server so I can review it to see who is downloading the updates. It would need to handle the case where multiple people may be downloading simultaneously.
|
|
|
|
|
I would write a web service that can be called to insert the data in to the DB.
|
|
|
|
|
Thanks for the response. I do not do any web development so I need something really specific. We are not supposed to use access databases because they crash the server. I think I am limited to javascript, vbscript (I am familiar with that). I am the site author but I can't install any software to run on the server.
|
|
|
|
|
Your only other option, given your restrictions, is to construct a web page that the client can use to submit the required data. Since you've said that you can't use a database, you're only other option for storing the data is in some kind of flat file, be it text or XML, or whatever...
|
|
|
|
|
So you are saying I cannot automate the process, as in sending a web request to a specially formatted hidden web page via a vb.net standalone EXE from the client computer?
And the only way to accomplish this is to have the user physically enter the data and click a button. Is that correct?
|
|
|
|
|
GTVic wrote: So you are saying I cannot automate the process, as in sending a web request to a specially formatted hidden web page via a vb.net standalone EXE from the client computer?
No, I'm saying you CAN do this. It's not the best solution though. A better one would be a Web Service. Either way, you have to write code that runs on the web server to do the database work.
GTVic wrote: And the only way to accomplish this is to have the user physically enter the data and click a button. Is that correct?
Nope.
|
|
|
|
|
Hey everyone. I'm trying to write some automation to help me test a shell extension witten in c++(not by me).. I'm using VB, and I would like to open windows explorer to a certain folder, then create a folder structure containing files.(I've managed to get this far).. Now I would like to simulate a right click on the folder just created and select one of the options in the menu.. Can anyone suggest how to do this.. I'm not even sure what to search for online, or what I'm trying to do is called..
thanks in advance
|
|
|
|
|
This is going to be much harder than you think. This requires in-depth knowledge of how windows and mouse messages work as well as the internals of Explorer.
There are tools on the market that do exactly this, like IBM's Rational Functional Tester[^], or Mercury TestDirector[^].
|
|
|
|
|
Yah, I realize that, I actually have Rational Functional Tester available, but enjoy the challenge.. I really wanted to work with VB through VS2008 to come up with something.. I guess it isn't as simple as adding a library reference to user32.dll and call in the appropriate methods to get me were I want to go..
|
|
|
|
|
LFlindall wrote: I guess it isn't as simple as adding a library reference to user32.dll and call in the appropriate methods to get me were I want to go..
Oh no. FAR from it!
|
|
|
|
|
Hi,
I have read all items from one listview and I have stored this in another listview. However I want to use one item as group name in 2nd listview. I am able to show all items in 2nd listview but no group headers. I wonder why groups doesn't show up in 2nd listview. Where do I make mistake? All the items are getting listed under default group header.
Thanks.
Private Sub BasketOnCounter()
Dim LCounter As Int32 = 0
Dim Found As Boolean = False
ListView1.BeginUpdate()
'Here we create groups with Artist names
For Each BasketItem As ListViewItem In Form1.ListView6.Items
Found = False
If ListView1.Groups.Count > 0 Then
For Each ArtistItem As ListViewGroup In ListView1.Groups
If ArtistItem.Header = BasketItem.SubItems(0).Text Then
Found = True
Exit For
End If
Next
End If
If Found = False Then
Dim SetGroupName As New ListViewGroup
SetGroupName.Header = BasketItem.SubItems(0).Text
SetGroupName.HeaderAlignment = HorizontalAlignment.Left
ListView1.Groups.Add(SetGroupName)
LCounter += 1
End If
Next
'Here we add items in listview
LCounter = 0
For Each BasketItem As ListViewItem In Form1.ListView6.Items
Try
ListView1.Items.Add(BasketItem.SubItems(1).Text)
ListView1.Items(LCounter).SubItems.Add(BasketItem.SubItems(3).Text)
ListView1.Items(LCounter).SubItems.Add(BasketItem.SubItems(2).Text)
ListView1.Items(LCounter).Group = ListView1.Groups(BasketItem.SubItems(0).Text)
'When I enable the following line the VS2008 is crashing.
ListView1.Groups(BasketItem.SubItems(0).Text).Items.Add(ListView1.Items(LCounter)) here
Catch ex As Exception
MsgBox(ex.ToString & " " & BasketItem.SubItems(0).Text)
End Try
LCounter += 1
Next
ListView1.EndUpdate()
End Sub
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|