|
You are looking at a Bill of Materials.
Each Top Level Item Has a Collection of Children, who have themselves a collection of children. That should give you a clue.
Class SomeProduct
Public _components As List(of Component)
...
End Class
Class Component
Public bom As List(Of things)
End Class
Class Components
Inherits List(Of Component)
...
End Class
...
Use something like this and populate from the data to build the report? Very easy to do with a "real" database.
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Hi,
I have developed an email program to send emails to users at end of the daily based on the data I have in database. I want to schedule this program in a PC. When I did a test run from that PC I could not get mails from my program. But it is working fine on another computer. Could anyone let me know what are the system requirements for my email program to work correctly. To my uunderstanding we should have SMTP server. How to install/configure SMTP server on the PC.
my email code is as follows
Dim iMsg As New CDO.Message
Const cdoSendUsingPort = 2
' Apply the settings to the message.
With iMsg
.To = Recipient
.From = Sender
.Subject = Subject ' "This is a test CDOSYS message (Sent via Port 25)"
.HTMLBody = strHTML
.Send
End With
Regards,
Uma
|
|
|
|
|
That depends on the user account your app is running under. For example, if you're using Exchange, you need to setup an Exchange account for the user account that your app is running under.
|
|
|
|
|
We are using exchange server. thank you for your response.
Regards,
Uma
|
|
|
|
|
It's not usual to find the answer within the question:
Uma Kameswari wrote: .Subject = Subject ' "This is a test CDOSYS message (Sent via Port 25)"
So, prerrequisite for this code: port 25 must be opened.
But port 25 is not usually opened. Some ISP's close it to avoid spam so I guess you should try another port, and maybe SSL, to make sure your emals will be sent. There are several articles here at Code Project that might help you. Search "SMTPClient" and have a look.
|
|
|
|
|
Hello to everybody!
I managed to write a VB6 application an context sensitive help.
I am able to call and open the correct page inside the CHM file.
I am using the code found at http://support.microsoft.com/kb/315988[^].
When I open directly the CHM file from explorer, it will work, and in the search tab I can enter text and get results.
Now to the problem: when opening the same CHM from the application (F1), the search tab is there, but no text can be entered.
I have also a page inside the CHM with some java script and an form with input type="text". This works fine opening the CHM directly, but when called from the VB6 application, I can press form button it will execute the onclick event, but I can't enter a value in the textbox (in other words: java script itself is not blocked).
MJsDiag reports no problem. I tried also http://www.ec-software.com/products_hhreg.html[^]
So I think the problem is not the CHM but somewhere else.
Any Ideas?
Edit: sometimes, starting from the VB6 application, if I open the CHM, close it and open it again the search start working.
I did not found how exactly reproduce this systematically...
I am calling the CHM from a DLL, I have a helper class where in the Class_Initialize() I initialize the help system like this:
App.HelpFile = App.Path & "\help_file.chm"
Call HTMLHelp(objForm.hWnd, App.HelpFile, HH_INITIALIZE, ByVal "starting_page.htm")
It seems that if I start the application and just use the mouse and hit F1 it's not working, but if I type before something and then hit F1 it works????
Can, Could this be?
Edit2:
Added this code to the form load routine: now search in help works....
Me.Visible = True
txtBox.SetFocus
Strange world, can someone give me an explanation of this behavior?
modified on Friday, January 14, 2011 11:48 AM
|
|
|
|
|
Hi, I have Win XP Pro SP3, and one of the command line programs I regularly run has an initial message which requires the user to press a key to get past it; and it doesn’t accept keyboard redirection, i.e. something like “program.exe < cr.txt” at the command prompt doesn’t get past the message.
In VBscript I have found that the following usually works:
Set oShell = WScript.CreateObject("WScript.Shell")
oShell.Run "program.exe arguments & pause"
WScript.Sleep(3000)
oShell.Sendkeys"{ENTER}"
(despite a VBSCRIPT book I have saying that Sendkeys can’t be used to send keystrokes to a non-Windows application).
However once in a while the program generates a whole lot more initial messages and takes more than 3 seconds to get to the point when you can press a key, and if possible I want to expand the script to run the program a second (and third, and …) time, after the first run finishes.
Hence, is there some way for the script to be able to “read” the text in the command prompt window generated by the “oShell.Run” statement and search for “press any key to continue” (or similar), before issuing the sendkeys method (and similarly, search for an “end of program” type message before running it again)?
I also have VB6, so if there is some way to do this in VB6 but not VBscript, I could change to using VB6.
|
|
|
|
|
You can use WScript.Exec to launch your command window, which will return a WshScriptExec[^] object and give you access to its StdOut and StdIn streams. StdOut is the stream of output from your launched program and StdIn is the keyboard that your code uses to type in the console. You don't need SendKeys at all.
|
|
|
|
|
Thanks for the suggestion about WScript.Exec. I have been trying it out over the last couple of days, initially with not much success, partly due to the fact that I have been unable to find any reasonable documentation on StdOut and StdIn – I could basically only find example bits of code in places like script56.chm and Microsoft Technet, which didn’t work with my application. However after much trial and error, I have basically got it working.
But I couldn’t get StdIn to work at all – it wouldn’t pass keystrokes to my command line program. Hence I have continued to use SendKeys to pass keystrokes to the program, after reading StdOut to determine when to issue the keystrokes. And I have found that I had to introduce a slight delay (Wscript.sleep 100) before issuing the keystrokes – if I didn’t, sometimes it worked and sometimes it didn’t. A disadvantage of Exec compared to Run is that with Exec, the output of the command line program wasn’t displayed in the command window (it is with Run), so I have copied it from StdOut to the window with Wscript.Echo.
Hence I think I have now got the basis for something that should work as I want, although it needs more work. Thanks for your help.
|
|
|
|
|
What is the best way to check for a particulair file in a folder?
e.g. I want to count the number of files that start with say "temp" and have an extension of txt.
In this example
Folder = Temp
Files = temp01.txt, report.txt, temp02.txt.
In this example we would return a count of 2
|
|
|
|
|
Central_IT wrote: What is the best way to ...
Depends on your definition of best.
The easiest way would be based on the Directory.GetFiles(String, String) method, taking the Count of the array being returned. This however is not the least expensive one in terms of system load, as it is building an array of strings, which potentially could be huge and take long.
The cheapest way would probably be based on calling the Win32 functions GetFirstFile() and GetNextFile() , which requires P/Invoke and a bit more code.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
modified on Friday, January 14, 2011 6:27 AM
|
|
|
|
|
Hi All,
I would like to know, how can I detect whether an application is already launched?
I need to enable some function according to this checking, can some people help?
thanks so much.
|
|
|
|
|
The preliminary question is: how do you identify your app?
You could use Process.GetProcessesByName() to check for a specific process name; process names normally get derived from the EXE's file name (which can easily be modified!).
A more reliable approach, if you are the author of the app, is by using a system resource (e.g. a Mutex) with a chosen system-wide name; you then check for the existence of that Mutex. This is how "single instance applications" normally do it. You may want to read this: A Pure .NET Single Instance Application Solution[^] or some similar article.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks for your infomation, Luc.
I'm using your approach, and it works fine.
I just got another question, if the PC is a remote server that different user may login to the server and launching the same application. May I use the same function to detect what specific user is launing the application ?
thanks
|
|
|
|
|
application event:
Private Sub MyApplication_StartupNextInstance(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs) Handles Me.StartupNextInstance
End Sub
can that help?
|
|
|
|
|
I have a listview with values
Salary Name Department
2000 Peter Accounts
1000 Anne Sales
If I want the salary, I have the following code that works
MsgBox(lvwListView.SelectedItems(0).Text)
This gives me a value of 2000.
What is the code if I want to display their Name or the Department instead of salary
|
|
|
|
|
Use the SubItems collection of the ListViewItem[^].
I must get a clever new signature for 2011.
|
|
|
|
|
Try changing the selected items to 2
ie
MsgBox(lvwListView.SelectedItems(2).Text)
You should also be able to refer to the name of the field ie
MsgBox(lvwListView.SelectedItems("Department").Text)
Cheers
Ants
|
|
|
|
|
Hi,
I am working Access 2007. I am using subforms as datasheet view. I am embeding this subform to another main form. In main form this subform displays like Gridview, behind this i have some text box control on the main form.
when i am selecting the records from the subform, the respective records will be bounded to the textbox boxes which is on the same form(Main),
The problem is clicking on the cells is perfectly working, but when i click the left side column (default) as soon as i click any cells its not working, the respective record will be the bounded
to the textbox boxes but the respective selected row from the subform is not highlighting instead of highting the same row .
private sub Form_current()
Form_frmFundGroup.Filter = "Id = " & Me![Id]
Form_frmFundGroup.FilterOn = True
end sub
the above code is for subform to bound the data as per the selection on the subform(gridvew)
how to resolve this can u anyone give me suggestion plz...
kannak
|
|
|
|
|
|
Hi,
Is there a VBA technique to search for existence of a range of cells containing certain values and if such range(s) exists severally in a worksheet return an array of these ranges or at least their coordinates?
Regards,
Cyril
|
|
|
|
|
Excel Ranges - Stackoverflow[^]
As barmey as a sack of badgers
Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
|
|
|
|
|
I'm not clear on what you want to search and for what, so perhaps you could clarify. Do you want to search
- a range of cells for a value that fits in one cell and return all the cells containing the value?
- a range of cells for a value that may occur across cells?
- a spreadsheet for a specific sequence of cell vales?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Or maybe a rectangular range of cells, sized A by B, containing each and every value of another rectangular range of cells, sized C by D, where A*B equals C*D and the order of the matching cells doesn't matter.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
... contains the equivalent words, if translated to Dutch?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|