|
Agreed in that there should be some way to store the info so that both apps can access it.
Is it possible to relaunch app2? If so, you could restart app2 and pass in command line args to have it process whatever needs to be done.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
My goal is to get the RGB colors of a pixel when I click in a picturebox. Every piece of code I've been able to try or find doesn't work. The bit below uses the GDI GetPixel function and should work but returns an Overflow error. I'm using VB 2008 Express.
Dim p As Point = picbox.PointToClient(MousePosition)
Dim g As Graphics = picbox.CreateGraphics()
Dim pbdc As IntPtr = g.GetHdc()
Dim c As Color = ColorTranslator.FromWin32(GetPixel(pbdc, p.X, p.Y))
g.ReleaseHdc(pbdc)
|
|
|
|
|
You seem to be trying to get a pixel from picBox's display context. Is this what you want? If so, then you can simple use (picBox.Image as Bitmap).GetPixel(p.X, p.Y) instead. However, that's just the basic idea. You'll probably want to split it up into separate lines, and add a null-check from picBox.Image. If that's true, you'd probably just want to return a color with 0 transparency
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Thanks Computafreak, that did the trick. It's always the simplest answer that's the right one.
|
|
|
|
|
Public Function DecryptString128Bit(ByVal vstrStringToBeDecrypted As String, ByVal vstrDecryptionKey As String) As String
Dim bytDataToBeDecrypted() As Byte
Dim bytTemp() As Byte
Dim bytIV() As Byte = {121, 241, 10, 1, 132, 74, 11, 39, 255, 91, 45, 78, 14, 211, 22, 62}
Dim objRijndaelManaged As New RijndaelManaged()
Dim objMemoryStream As MemoryStream
Dim objCryptoStream As CryptoStream
Dim bytDecryptionKey() As Byte
Dim intLength As Integer
Dim intRemaining As Integer
Dim intCtr As Integer
Dim strReturnString As String = String.Empty
Dim achrCharacterArray() As Char
Dim intIndex As Integer
bytDataToBeDecrypted = Convert.FromBase64String(vstrStringToBeD...
intLength = Len(vstrDecryptionKey)
If intLength >= 32 Then
vstrDecryptionKey = Strings.Left(vstrDecryptionKey, 32)
Else
intLength = Len(vstrDecryptionKey)
intRemaining = 32 - intLength
vstrDecryptionKey = vstrDecryptionKey & Strings.StrDup(intRemaining, "X")
End If
bytDecryptionKey = Encoding.ASCII.GetBytes(vstrDecryptionKe...
ReDim bytTemp(bytDataToBeDecrypted.Length)
objMemoryStream = New MemoryStream(bytDataToBeDecrypted)
Try
objCryptoStream = New CryptoStream(objMemoryStream, objRijndaelManaged.CreateDecryptor(bytDe... bytIV), CryptoStreamMode.Read)
objCryptoStream.Read(bytTemp, 0, bytTemp.Length)
objCryptoStream.FlushFinalBlock()
objMemoryStream.Close()
objCryptoStream.Close()
Catch
End Try
Return (Encoding.ASCII.GetString(bytTemp))
End Function
i have got this cod to encrypt a string i want it to be written in perl
Is it possible
can anyone help me out with this please
help me iam shaking my head for about a weak to do tyhis
|
|
|
|
|
1. Where's the formatting?
2. What exactly are you asking? If its encrypting/decrypting a string, what's the problem?
3. Your grammar is horrendous.
Other than that, everything looks fine.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
The question was at the bottom of the code....
harieshkumar.n wrote: i have got this cod to encrypt a string i want it to be written in perl
Is it possible
The answer is probably yes.
However, I suspect you are after someone to write the code in perl for you?
If not.. show us what you've written so far in perl and we'll see if we can spot what you've done wrong
|
|
|
|
|
Jon_Boy wrote: Your grammar is horrendous.
Why, what did she do ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Jon_Boy wrote: 3. Your grammar is horrendous.
The grammar seems ok to me. The spelling is not hot but then I am assuming English is not his first language. I was was woundering how many languages (other than English) you can speak and write perfectly, and thus give you the right to be rude to someone else that is making the effort to communicate in a second language?
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Duly noted Steve + Christian. I was overly harsh.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
It takes a big man to admit he was wrong.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Noone here is going to write your code for you. Go to www.rentacoder.com[^] if you want someone to do your work for you.
|
|
|
|
|
harieshkumar.n wrote: iam shaking my head for about a weak to do tyhis
And I thought, Perl != HeavyMetal .Rentacoder is what you need.
|
|
|
|
|
hi,i am trying to design a property grid that consisits of multiple drop downs of user defined and move those values selected to a variable in back end vb.net code and perform some matha matical calculations.
But i am not able to create multiple dropdowns in single group can any one help?
My main problem is i am creating multiple drop downs using class for each dropdown.i created one drop down but i can not able to create multiple.
Getting error called base class have multiple definetions. code i am trying for drope down is:
Imports System.ComponentModel
Public Class MotoList1 : Inherits System.ComponentModel.StringConverter
'''
'''
Private _Title As String
Private _Show As Boolean
Private _Number As Short
'''
<CategoryAttribute("Other Inputs"), _
Browsable(True), _
[ReadOnly](False), _
BindableAttribute(False), _
DefaultValueAttribute(""), _
DesignOnly(False), _
DescriptionAttribute("Enter Title for the application")> _
Public Property Title() As String
Get
Return _Title
End Get
Set(ByVal Value As String)
_Title = Value
End Set
End Property
'''
<CategoryAttribute("Other Inputs"), _
Browsable(True), _
[ReadOnly](False), _
BindableAttribute(False), _
DefaultValueAttribute("True"), _
DesignOnly(False), _
DescriptionAttribute("Show option")> _
Public Property Show() As Boolean
Get
Return _Show
End Get
Set(ByVal Value As Boolean)
_Show = Value
End Set
End Property
'''
<CategoryAttribute("Other Inputs"), _
Browsable(True), _
[ReadOnly](False), _
BindableAttribute(False), _
DefaultValueAttribute("0"), _
DesignOnly(False), _
DescriptionAttribute("Enter a number")> _
Public Property Number() As Short
Get
Return _Number
End Get
Set(ByVal Value As Short)
_Number = Value
End Set
End Property
Dim _Motor1in As String() = New String() {"400", "500"}
Public Overloads Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection
Return New StandardValuesCollection(_Motor1in)
End Function
'''
Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
Return True
End Function
'''
Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
Return True
End Function
'''
End Class
here while am trying to create another drop down --GetStandardValues-- i got error as function can not be over ride
that is the my problem
|
|
|
|
|
You've posted a whole lot of crap here, I'm not even going to wade through it.
bhargava2409 wrote: i got error as function can not be over ride
Sounds like your problem is a lack of programming knowledge in general. It's hard to say in all of this if it's clear why you get this error, but it's obvious you're doing something wrong, on a very basic level.
bhargava2409 wrote: Getting error called base class have multiple definetions
A .NET class can only have on base class. Again, it's hard to see what you're doing based on what you posted, but you posted a lot of boiler plate stuff. Perhaps if you distill this down to the code that matters and post the actual error message. If you can't work out what code relates to the message, that's another indicator that you're out of your depth.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Yesturday you asked me to post the whole detailes of the question with program in detailed then i posted this one to u.
|
|
|
|
|
Your code looks fairly standard as far as property grids go.
My suggestion:
Create a new project with a property grid that contains just one combobox setting. Get that to work and then expand the other settings from there. Start small and get a working grid, then go crazy.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Your problem is important to you, it does not matter to most of us. Therefore you have to make it easy for us to help you.
Use <pre> tags around your code, so that it can be formatted properly, you know, with indentation and so on. Only post the parts that are obviously connected to the problem. Post the exact error message, if there is one and indicate which line causes the error.
The easiest way to format your code is to move the cursor to a blank line in the 'reply text box' and click the 'code block' widget (look below the reply box), this will put the <pre> tags in place for you. Then copy your code in your editor and paste it between the tags, all the formatting will be preserved.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
There's no need to repost the same question over and over. In fact, yesterday's still shows on the first page (w/ 50 items displayed).
If there's no replies, then we probably don't know or the question was completely clear, in which fact, you should reply to add info to the orig post. Not repost the same info again in a new thread.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
thanks every one for u r replays.I got solution for that.
|
|
|
|
|
hi all
i am working on a multi threaded app
now in app, 5 or more threads have to write thousands of lines in a text file simultanously
i know this kills the cpu but no prob there
i have the lines to be written in an static array (I think static makes the process faster.is it true?)
my code:
For co% = 0 To (strarray.length - 1)
writer.WriteLine(strarray(co))
Next
where writer is StreamWriter
i do the flush close etc
my prob is that all files are not being written
if array has 25000 elements then
sometimes only 10000 or sometimes 15000 are written
should i try a timer instead of loop?
if not kindly suggest someother means.
TheMrProgrammer
|
|
|
|
|
TheMrProgrammer wrote: i know this kills the cpu but no prob there
No, it kills the file if multiple threads try to write to it.
TheMrProgrammer wrote: (I think static makes the process faster.is it true?)
No. Seems like you have no idea what you're doing.
TheMrProgrammer wrote: sometimes only 10000 or sometimes 15000 are written
Because your different threads are going to clash. Try using one thread, given that your array is static, the data is always the same, so having 5 threads trying to write the same file, is kind of retarded, right ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
LOL - so blunt.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
sorry
i forgot to mention that all the threads write to separate files.
now suggest some means
TheMrProgrammer
|
|
|
|
|
Your data source is static. I presume your problem is still that you have threads writing files as the data is being filled. Overall, it sounds insane to me.
If you're saying that some of the data in the middle does not get written, then I assume this means that your problem is still one of concurrency. Why do you have 5 threads all writing at once ? do they write to the same HDD ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|