|
hi. Thanks for previous replies.
I have registered control under Administrator privileges on window xp OS. My application use that control and it works fine.
I use check if ocx control registered on machine then run otherwise show appropriate message.
Now I have guest account (limited privileges) and I am unable to read/write registry values. So my application found no control registered and loads nothing.
I want my application to show ocx control because it is already registered by administrator.
Please tell me how can I access registered controls.
Also tell can I use COM components in this regard?
|
|
|
|
|
I already told you, the only way to can find out if the control is registered is to NOT use the designer to drop the control on the form. You can only see if the control is registered if you use CreateObject to try and create an instance of the control. You can catch the error by running the CreateObject code right after an On Error Resume Next line and checking for the value of Err.Number.
|
|
|
|
|
Respected replier.
I am using RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) to open registry key and check whether control is registered or not.
Problem is that when I open registry from guest account I always get 5 return code instead of SUCCESS 0.
Thank you.
|
|
|
|
|
I already told you, in your other post, that the Guest account has no rights to anything. The only part of the registry it can read in under CURRENT_USER, which won't have the component registration info.
|
|
|
|
|
Ditto to Dave, quit asking the same question every day. If you need additional help, reply to your previous post.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
I have function 'startthread' that points to the thread 'thread1' which is started when I click on button1.
When i click on button2,it is supposed to stop the thread.I want to restart the thread1 but when i click on button 2 again it gives ThreadStateException saying 'Thread is running or terminated; it cannot restart'
What am i doing wrong here?
''To Start the thread
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ds1 As New DataSet
Dim i As Integer = 0
ds1 = clsDB.getData("Select * from Readers_test")
Dim s As String = ds1.Tables(0).Rows(0)("Reader_Name").ToString + ":" + ds1.Tables(0).Rows(0)("IP_Address").ToString + ":" + ds1.Tables(0).Rows(0)("Port_No").ToString
'thread1.IsBackground = True
thread1.Start(s) ''I get exceptio here when I try to restart the thread
End Sub
''To Stop the thread
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
api.TcpCloseConnect()
If thread1.IsAlive Then
thread1.Abort()
End If
setValue(Me.TextBox3, "Stopped")
End Sub
Private Sub startthread(ByVal state As Object)
Dim timer1 As New System.Timers.Timer
AddHandler timer1.Elapsed, AddressOf scan
Dim st As String = state
Dim status As Integer = 2
Dim param_arr() As String = st.Split(":")
Dim Location As String = param_arr(0)
Dim ReaderIP As String = param_arr(1)
Dim Port As String = param_arr(2)
Dim ReaderPort As Integer = Integer.Parse(param_arr(2))
status = api.TcpConnectReader(ReaderIP, ReaderPort)
If status = 0 Then
setValue(Me.TextBox1, "Connected")
api.ClearIdBuf()
timer1.Interval = 1000
loc = Location
clearbuf = 0
timer1.Start()
Else
setValue(Me.TextBox1, "Not Connected")
End If
End Sub
Public Sub scan(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs)
Dim status As Integer = 2
Dim i As Integer, j As Integer
Dim IsoBuf As Byte(,) = New Byte(99, 13) {}
Dim tag_cnt As Byte = 0
Dim s As String = ""
Dim s1 As String = ""
Dim antno As Integer = 5
Dim tagstatus As String = ""
Dim tag_flag As Byte = 0
Dim membank, wordptr, wordcnt As Integer
membank = 1
wordptr = 2
wordcnt = 6
'Dim value As Byte() = New Byte(15) {}
Try
status = api.EpcMultiTagIdentify(IsoBuf, tag_cnt, tag_flag)
'If status1 = 0 Then
If tag_cnt > 0 Then
For i = 0 To tag_cnt - 1
s1 = String.Format("", TagCnt)
For j = 2 To 13
s = String.Format("{0:X2}", IsoBuf(i, j))
s1 += s
Next
'Next
antno = IsoBuf(i, 1)
clearbuf = clearbuf + 1
setValue(Me.TextBox2, s1)
If clearbuf = 1 Then
api.ClearIdBuf()
clearbuf = 0
End If
Next
End If
TagCnt += 1
Catch ex As Exception
'MessageBox.Show(ex.ToString)
End Try
End Sub
|
|
|
|
|
If you want to pause and then continue a thread use YourThread.Suspend and YourThread.Resume
My advice is free, and you may get what you paid for.
|
|
|
|
|
You could also create a new instance of the thread just before starting it.
Hope that helps,
-Ray
|
|
|
|
|
Hi,
I have an VB .NET application in which I set an databasepath in the project/properties/settings. It's scope is "application" and it's value is c:\test
I am reading this settings in the form load event like this:
datapath = my.settings.default.databasepath
When I install the application with the installer I change this value to something user selects usually
to "c:\Documents and settings\[user name]\data" I put the application.exe.config file to the same directory as exe file is. And when I check it out the value that used to be c:\test is now the one user selects.
But When I read this value in my application and show it in the textbox it still says "c:\test"
Does anyone has any idea what is this all about, what am I doing wrong?
Thanks for any help.
Greg
|
|
|
|
|
Are you changing the value in the project .config file, or are you changing the value by hand on the .config file in the bin\Release or bin\Debug folder, then you running your app?? If you're doing it by hand, every time you run your app from the debugger, it's copying the project .config file over the top of the one thats in the bin\Release or bin\Debug folder, overwriting the previous values.
|
|
|
|
|
no, I know that it is created every time you run debug or rebuild it. In the settings in the project I have some default database value. And when I install (I am using advanced installer) I change the value in the [app name].exe.config file to something user selected during installation process. So when application is run at some computer (different than my developing) the value that application reads and shows in the textbox is still the default one, although if I look into the .config file that is in the same directory as exe the value is no longer default one, but the new one?!
I can't figure it out.
Thanks for help Dave
Regards,
Greg
|
|
|
|
|
Then there is something else going on in your code. The config files are always stored in the same directory as the .EXE, nowhere else.
|
|
|
|
|
yup there is... I went trough once more, and deleted the config file (i changed the name of the variable in the settings, previously it was the same as the variable inside my code (databasepath), and I don't know if this was the problem but it is working now.
I can also now access the settings property like this: "databasepath = my.settings.datapath" but before I had to do it like this: "databasepath = my.settings.default.databasepath".
Is it possible that this was the problem, both my dim variable and a settings property had the same name?
Thanks,
anyhow its working now.
Regards,
Greg
|
|
|
|
|
Hello everybody,
I'm trying to bring a dpx-format (bitmap spec http://www.fileformat.info/format/dpx/egff.htm) file into a picture box. Knowing its structure, I figured that I could use a MemoryStream starting at the offset where the genuine picture data start.
Here's what I try:
Private abyt() As Byte
Private fo As New OpenFileDialog
'Reading a picture and put it in a bytearray
If fo.ShowDialog = DialogResult.OK Then
Dim fs As New IO.FileStream(fo.FileName, IO.FileMode.Open)
Dim br As New IO.BinaryReader(fs, System.Text.UnicodeEncoding.BigEndianUnicode)
Dim offset As Integer = 8192
abyt = br.ReadBytes(CInt(fs.Length))
br.Close()
'Creating the memory stream for the picture box
Dim ms As New IO.MemoryStream(abyt, offset, abyt.Length - offset)
Me.PictureBox1.Image = Image.FromStream(ms)
End If
The last command throws an argument excecption "invalid parameter".
Could anyone more experienced please help?
Thank you,
Michael
|
|
|
|
|
Yoy are going to have to do the conversion yourself.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Ok you caused panic, chaos and destruction But to be serious: How would I do the conversion??? Do you probably have any sources about the basics?
Michael
|
|
|
|
|
Okay you know the input format; I don't. I would have an external conversion routine that can create a new bitmap.
Is it feasable to convert the images up front that you want to use? There will probably be a 3rd party conversion on the web.
[added]
Isn't .dpx a movie format? That would mean you wish to ewither convert to say .avi or to convert frame by frame.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
You're right, it's a movie format. The Windows-viewable pic I "only" nead for reference in a form where header details of each frame (i.e. frame by frame usage) are listed.
Just now I found an "ImageMagickObject", which knows the format and seems to do a good job on conversion. I guess that's the better way instead of trying to write my own converter (btw in my initial post I set a link to the dpx specification) without having any idea about the issue. The object seems to be a bit tricky to use in vb.net, so I'm struggling how to implement it.
Wish me luck and in case you have some hints for me I'd appreciate any...
Thanks
Michael
|
|
|
|
|
Hi All,
I am tracking Visited URL's Name by using FindFirstUrlCacheGroup or etc function. But it Track only Internet Explorer.
So please give me any solution for tracking Mozila firefox,opera or etc.
Because Proxy server is work like that.
Thanks
If you can think then I Can.
|
|
|
|
|
Proxy servers do NOT work like that. Proxy servers work because the browser tells the proxy which URL to retrieve. Then the proxy goes and gets the page and relays it back to the browser. There is no function you can call on the workstation that will tell you what the URL being retrieved of any browser installed on the workstation. You have to use, or write your own, proxy server to do that.
|
|
|
|
|
I have a combobox on my form called cboLang. When the selectedindexchanged fires I run a routine that goes out to the database and changes the labels to the language requested. Then it loads up the combobox with that language's form of the name of each possible language (i.e., if the user selected French it would put "Anglais" in the combobox instead of "English").
What I'd like to do next is ensure that the language the user selected is the one selected in the combobox. However, whenever I do this it fires the selectedindexchanged event again which starts everything all over and it gets into an infinite loop.
How can I set the selected item without it firing the selectedindexchanged event?
Denise "Hypermommy" Duggan
|
|
|
|
|
2 possible solutions that I see:
0) Don't do the code that changes everything in the 'selectedindexchanged' event.
Do it in a 'Save settings' button or so.
1) Maintain a boolean variable 'ImWorking' (dummy name ) (on form level). While your code is running change this boolean to 'True'. First thing in your 'selectedindexchanged' event is check this boolean. If the boolean is true than exit the event (exit sub)
My choice would be first one.
This allows for the user to misclick without having to wait for the language change to have ran its course.
|
|
|
|
|
You have possibly two ways to do this...
1. use SelectionChangeComitted event (recommended)
2. use some global variable Flag that u set to 'true' once all the comboBox is filled up... before comboBox is completely filled..this flag should remain 'false'... later on in ur code... just check if the flag is set to 'true' before doing what ever u do upon item selection.
Enjoy!
|
|
|
|
|
SelectionChangeCommitted was exactly what I need!! Thanks!!!!! Never even knew that it existed but it's just what I needed.
Denise "Hypermommy" Duggan
|
|
|
|
|
Enjoy!
|
|
|
|