|
i need to develop a system configuration GUI function.
Thanks for guidance.
|
|
|
|
|
And?
You really need to narrow this question down to something we can answer without guessing at what your having a problem with.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have some code that I am experimenting with and need to know if it is possible to speed up. I already have working routines which encode SNMP querys into the proper RFC datastream and via Winsock send SNMP GET requests to remote devices via UDP port 161. After the GET query is sent, eventually the Winsock _DataReceive is called (or times out) when the device responds (or doesn't). I then decode the response data block and log the queried info into a spreadsheet.
This is fine until I have a long list of devices to process. This can take hours, especially over a moderatly slow connection. I would like to see if there is a better approach to this task than the method I am using, single threaded send a query and wait for response.
My first elementary idea to enhance this very slow single-threaded process was to just iterate through the IP addresses to be queried, sending GET requests to one device after another , and hoping that Winsock would "catch up" on the responses via some buffer and "keep up" with the sending. I have found that even though I have 2 "DoEvents" in the send loop, still the _DataReceive seems to only be called and receiving data for the very last request in the iteration loop of sends.
Should this be working? If not, what I am doing wrong (in beginner to VB API programming terms). From what I have seen of the UDP Winsock topics of VB Programming examples, there is no way or no need to use the Index function if using UDP. Thanks in advance!!!
|
|
|
|
|
Don, MultiThread It....
You've almost come up with your own answer from your question:
"I am using, single threaded send a query and wait for response."
"This can take hours, especially over a moderatly slow connection."
There is literaly ton's of VB example Code & controls out there about udp MultiThreading & pooling in VB.
(I'm assuming your working in VB 5 or 6 and Not the .Net framework.)
The doEvents() inside of the do loops... bad idea.. I haven't see your code but it would not be a
big surprise, to find it is only recieving the last request.
A lot of the documentation on multithreading is geared toward it's "use" with winsock, have a look thru the MSDN Library CD's that came with the version of VB your using. and MSDN on the net still has a few bit's and pieces on multitheading....in the older versions of VB.(but getting harder to find)
"Google is your best friend:"
http://www.google.com/search?hl=en&q=vb6+udp+MultiThreading[^]
(If you are working in the .Net Framework check out the Threading Class
.NET Framework Developer's Guide
Threading
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconthreading.asp?frame=true
.NET Framework Developer's Guide
Managed Threading Best Practices
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconmanagedthreadingbestpractices.asp?frame=true
.NET Framework Developer's Guide
Thread Pooling
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconThreadPooling.asp
Hope this helps
|
|
|
|
|
Tricky question for you all ....
Added a "Windows Picture and fax viewer"-objekt to my toolbox. (added shimgvw.dll/PREVIEWLib)....
This seems to be a valid objekt. I used the function .ShowFile(strPath)to view a picture and it worked.
Now I want to save that picture. The function SaveAs(strPath) exists in interface IPreview3 ... How do I access that method? Can I apply this interface to my object in any way? The method is there so I hope I can call it.
What do you say professionals? Please help ...
//Maw
|
|
|
|
|
|
And you don't know how to use other interfaces?
//Maw
|
|
|
|
|
No I don't, Like I said in the last message, I haven't used the shimgvw.dll
It looks like a lot of folks are looking for Info on it, when I seached on google, but the functions are undocumented so without a lot of work it may be quite difficult to decode all that it can do. Just playing with it, I got VS to generate a wrapper, but it doesn't wrap the IPreview3 functions.
I did come across a microsoft post about it, on how to use it under the shell but it's not much:
'-------------------------------------
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
'Process.Start("c:\windows\explorer.exe", "C:\drums.jpg")
Process.Start("c:\windows\system32\rundll32.exe",
"C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen c:\drums.jpg")
End Sub
Please Apply My Suggestion Above And Let Me Know If It Helps Resolve Your
Problem.
Best regards,
Peter Huang
Microsoft Online Partner Support
'----------------------------------------------------------
and came across this reference for it, But absolutly no documentation what-so-ever.
'------------------------------------------------------------
PREVIEWLib reference for C# and VB.NET
Methods marked * are get/set properties.
PREVIEWLib Classes:
DPreviewEvents
Void OnActualSizePress
Void OnBestFitPress
Void OnClose
Void OnError
Void OnPreviewReady
DPreviewEvents_Event
Void add_OnActualSizePress
Void add_OnBestFitPress
Void add_OnClose
Void add_OnError
Void add_OnPreviewReady
Void remove_OnActualSizePress
Void remove_OnBestFitPress
Void remove_OnClose
Void remove_OnError
Void remove_OnPreviewReady
DPreviewEvents_EventProvider
Void add_OnActualSizePress
Void add_OnBestFitPress
Void add_OnClose
Void add_OnError
Void add_OnPreviewReady
Void Dispose
Void Finalize
Void remove_OnActualSizePress
Void remove_OnBestFitPress
Void remove_OnClose
Void remove_OnError
Void remove_OnPreviewReady
DPreviewEvents_SinkHelper
Void OnActualSizePress
Void OnBestFitPress
Void OnClose
Void OnError
Void OnPreviewReady
IImgCmdTarget
Void ActualSize
Void BestFit
Void GetMode (pdw)
Void GetPageFlags (pdw)
Void NextPage
Void PreviousPage
Void Rotate (dwAngle)
Void ZoomIn
Void ZoomOut
IPreview
Int32 cxImage *
Int32 cyImage *
Int32 printable *
Void Show (var)
Void ShowFile (bstrFileName,iSelectCount)
IPreview2
Void ActualSize
Void BestFit
Int32 cxImage *
Int32 cyImage *
Int32 printable *
Void Show (var)
Void ShowFile (bstrFileName,iSelectCount)
Void SlideShow
Void Zoom (iSelectCount)
IPreview3
Void ActualSize
Void BestFit
Int32 cxImage *
Int32 cyImage *
Void Rotate (dwAngle)
Void SaveAs (bstrPath)
Void SetWallpaper (bstrPath)
Void Show (var)
Void ShowFile (bstrFileName)
Void SlideShow
Void Zoom (iSelectCount)
PreviewClass
Void ActualSize
Void add_OnActualSizePress
Void add_OnBestFitPress
Void add_OnClose
Void add_OnError
Void add_OnPreviewReady
Void BestFit
Int32 cxImage *
Int32 cyImage *
Int32 printable *
Void remove_OnActualSizePress
Void remove_OnBestFitPress
Void remove_OnClose
Void remove_OnError
Void remove_OnPreviewReady
Void Show (var)
Void ShowFile (bstrFileName,iSelectCount)
Void SlideShow
Void Zoom (iSelectCount)
PREVIEWLib enumerated types:
DPreviewEvents_OnActualSizePressEventHandler
DPreviewEvents_OnBestFitPressEventHandler
DPreviewEvents_OnCloseEventHandler
DPreviewEvents_OnErrorEventHandler
DPreviewEvents_OnPreviewReadyEventHandler
'-----------------------------------------------------
Sorry I can't help you out more, But I'm in the middle of a large project now, when I have time, I'll try to check out some more of the functions.
In the meantime if you come across any documentation that would be of interest drop me a note.
progload
|
|
|
|
|
I thought you were talking about the Kodak controls,
so disregard what I said there.
I have not tryed to use the shimgvw.dll/PREVIEWLib yet.
Sorry.
|
|
|
|
|
I think I posted this before, but I have searched and not found the post. I want to extract a bitmap from a mpg, avi, etc.
Any ideas?
TIA
|
|
|
|
|
|
Hi Group,
I need an Urgent Help.
I have been connecting my application to a remote mysql database(For development it is in lan only).
I fail to retrieve data from database
I have used this:
<br />
if rs.eof then<br />
rs.movefirst ' have also used rs.movelast<br />
else<br />
rs.movelast<br />
endif<br />
but it does not help.......
Tell me how to rectify it....
Thanks
Amit
amit mishra
|
|
|
|
|
you also need to check for rs.bof. If the recordset is empty (no rows returned) BOTH eof and bof will be true, and movefirst, movelast, movenext, moveprevious and move(bmk) will all return an error, sice there is no record to move to.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Can anyone tell me the code to select a datagrid row. Getting mixed up and any help would be greatly appreciated.
Example
Have the following rows in a datagrid.
EmpID Employee Department
1 Jones Accounts
2 Smith Sales
3 Green Sales
4 Ross Accounts
I want to select say emp ID 2.
What properties do I have to use to display
2, Smith and Sales onto 3 seperate variables.
I think it is something to do with the datagrid click but cannot work out how to assign the column values to a variable.
|
|
|
|
|
Worked it out. It is as follows
datagrid.Item(datagrid.CurrentRowIndex, 0)
|
|
|
|
|
datagrid1.tables(0).rows(2)
amanpreetsingh
|
|
|
|
|
Use the Select method of the DataGrid.
|
|
|
|
|
i need help with vb.net code for forward and back navigational buttons for a picturebox.the picturebox loads images and their associated text(the text files contain titles and refence nos.for the images) from a folder.their are actually two pairs.One forward and back pair of buttons is for navigating previously selected(loaded) images.the other pair of forward and back is for navigating the filed images startin from the currently selected image.
Also need code for searching for the images using their reference numbers or title.
|
|
|
|
|
Nzyimi wrote:
i need help with vb.net code for forward and back navigational buttons for a picturebox.
I take it you haven't written any code for this yet? Break the problem down into simpler parts. You have to maintain two lists of images for navigation. One list will be the "previously loaded" list. The other, the list of files in a particular directory. This is easy using an ArrayList. The buttons for forward and backward would just increment and decrement an index value pointing at the currently in-use indexes into those two arrays.
Nzyimi wrote:
Also need code for searching for the images using their reference numbers or title.
You must be mistaking us for RentACoder. We don't get paid to write code for other people here. We will help you with your code, not write it for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
sory 4 that cant rent a coder nywayz coz its skool project n live in Kenya,Africa.thanx 4 tip. do u have site i can get docs that might help.....in coding in VB.net
|
|
|
|
|
Nzyimi wrote:
its skool project
That's why we always say we will help with YOUR code.
Nzyimi wrote:
do u have site i can get docs that might help.....in coding in VB.net
MSDN - Visual Basic and Visual C#[^] The best place to look right now is in your books. Everything you need has been covered up to this point.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
besides pics my proj loads text(title and ref. no.)from textfiles in the folder containing the pics.the proj is supposed to search for pics using the title and ref no.i can only get it to search title(first line in the text file).any tips on how u can search for the ref no.
|
|
|
|
|
Maybe you should post your some sample code and a sample of the text file you are working with. Otherwise, it defeats the purpose of asking for help here.
|
|
|
|
|
this is the code for the open button(for opening the images and text files in the folder).
Imports System.IO
Public Class Form3
Inherits System.Windows.Forms.Form
Dim y As Integer = 0
Dim z As Integer = 0
Dim w As Integer = 0
Dim c As Integer = 0
Structure Imagefile
Public image As Bitmap
Public title As String
Dim text As String
End Structure
Dim x(16) As Imagefile
Private Sub MnuFileOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
With OpenFileDialog1
With OpenFileDialog1
.Title = "choose a picture to display"
.ShowDialog()
PictureBox1.Image = Image.FromFile(.FileName)
End With
End With
Dim textfilename As String
textfilename = OpenFileDialog1.FileName
textfilename = StrReverse(textfilename)
textfilename = textfilename.Remove(0, 4)
If textfilename.StartsWith(".") Then
textfilename = textfilename.Remove(0, 1)
End If
textfilename = StrReverse(textfilename)
textfilename = textfilename & ".txt"
Dim fs As StreamReader
fs = File.OpenText(textfilename)
Richtextbox1.Text = fs.ReadToEnd
With x(c)
.image = PictureBox1.Image
End With
With x(y)
.text = Richtextbox1.Text
End With
c += 1
y += 1
End Sub
the part for back and forward buttons which navigate from the current file and move back and forward according to the filed images in the folder has defeated me.as in the back forward navigate according to the way they are arranged in the folder..some help
|
|
|
|
|
I'm having a problem understanding how to register Windows Shell extensions, specifically for PropertySheet extensions and their handlers.
I am not too happy with the way it's done here -
http://www.codeproject.com/cs/miscctrl/HadiPropertySheet.asp
- "Property Sheet Shell Extension in C#"
I think this can be done with PInvoke, rather than RegAsm.exe. Obviosuly, the batch file for putting the keys and appropriate GUID into the registry can be done in code (and would be less error-prone).
Also, can anyone direct me to an example in VB.NET for the same sort of thing that's described in that article? That is, a property sheet extension example.
Thanks for any help - Ian Thomas
|
|
|
|