|
Hi friends,
i want to download winpadlock activex control for vb as free.
where i get that?.
i already try in the following website but it not works properly.
www.winPadlock.co.nr
www.winPadlock.uni.cc
[^]
other websites are give that freely by they ask to join member with some payment.
i want free download of that, where i get that?
plz help.
thanks
Vasanth.A
|
|
|
|
|
If it's not free, then you need to pay for it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
It's amazing what you can find when you type "winpadlock" into Google.
|
|
|
|
|
I try to fix the small problems that my calculator has
For example, if I type 78/3=26 (all this from keyboard)
This is what I want the program to work.. If I type 78 from keyboard with "/" (divide) and 3.. when I hit "ENTER" from keyboard. I should get 26...
my current calculator doesn't accept "/" (divide) and ENTER to give result
if found this code online, can someone try to fix or tell me how to make the code below work for my problem
code:
Private Sub txt_KeyPress(ByVal KeyAscii As Integer)
If Not IsNumeric(Chr(KeyAscii)) And KeyAscii <> 13 _
And KeyAscii <> 45 And KeyAscii <> 8 Then
KeyAscii = 109
End If
End Sub
My second problem on my calculator:
I want to check if the number enter to textbox is the at end of textbox, then
it give me a beep sound...and do not accept any more numeratic number (1-9)...and the beep sound when the user try to press any number 1-9.
my current code doesn't work...please help me and see my code below. how to fix the code below that will work for me?
If TxtDisplay.MaxLength = "27" Then '27 means the only max number 'can enter in textbox
TxtDisplay.Enabled
End If
I appreciated all the great help you can provide!!!!
This code is done in VB 2008
|
|
|
|
|
You are utterly lost.
1 - you have code to only accept numbers. The code is crap, but it will work. You need to add code to accept the /, etc, as well as writing code to parse what is entered. Your best bet is to store numbers as you detect a modifier, then work on them from there.
2 - Again, you are lost. You can set the max length property, but it's not going to be a string, surely ? Either way, setting the max length is all you need to do, unless your code from question 1 actually stops accepting numbers after a certain length.
Overall, it looks like you're grabbing code off the web and guessing. If you're doing a class, read your book. If you're teaching yourself, buy a book.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I am new to VB and try to learn new language. Please be patient with me. you can read all the books, but you don't get real hand on practice in programming in VB. practice in VB is the way to go.(learn programming). i learn to programming in VB with doing it not watching the code.
I saw the code online..and try to modify that work to my need...i stuck and found the sample online.....to fix for my need...
can someone give me the sample code that will work to the problem that i describe on the original forum?
-Andy
Thanks
|
|
|
|
|
vblearner09 wrote: . you can read all the books, but you don't get real hand on practice in programming in VB.
No. But, by trying to write code when you have no idea, you learn nothing, either. You should read a book and do the exercises in the book, so you learn by applying things you know, not by copying and pasting code off the web, and asking us to fix it because you have no idea what it does.
vblearner09 wrote: can someone give me the sample code that will work to the problem that i describe on the original forum?
I'm sorry, I thought you said you wanted to learn ? You don't want to read a book, what would make me think you would read the code, rather than copy and paste it ?
There is no substitute for knowledge. Knowledge is different to guessing. Please buy a book and work through it,
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
What good book you recommend to buy in VB that has a lot of example? Since you seem to know about programming in VB, what book would you recommend?
my calculator program works on most the part...
-Andy
|
|
|
|
|
I don't know, it's been so long since I learned ( and I learned C# ). I would look at Amazon for a book that has a lot of good reviews. I'd tend towards a 'teach yourself in 24 hours' type book, so you start with the basics.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
can someone explain what e.Handled = True
does?
-Andy
|
|
|
|
|
If you bought a book, it would explain it. If you googled it, that would work to.
Some event handlers pass an event args with a 'handled' property. If you set it to true, the event is marked as handled and no further processes occur.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
I have a loop at the moment that creates a number loop that is 5 deep, each number in a sequence can only be used once...for example
12345
12354
12435
54321 etc...
Here is what i have for the code creating this sequencing...
SortOrder = New List(Of Integer())
Dim iTemp(PanelDepth) As Integer, iCount As Integer = 0
For a As Integer = 0 To PanelDepth - 1
For b As Integer = 0 To PanelDepth - 1
If b <> a Then
For c As Integer = 0 To PanelDepth - 1
If c <> b And c <> a Then
For d As Integer = 0 To PanelDepth - 1
If d <> c And d <> b And d <> a Then
For e As Integer = 0 To PanelDepth - 1
If e <> d And e <> c And e <> b And e <> a Then
ReDim iTemp(PanelDepth)
iTemp(0) = a
iTemp(1) = b
iTemp(2) = c
iTemp(3) = d
iTemp(4) = e
SortOrder.Add(iTemp)
End If
Next
End If
Next
End If
Next
End If
Next
Next
my dilemma is that i need it to be variable on the depth of the sequencing, so for example i might need it to calculate 9 deep, so 123456789, or even more 10/11 sometimes, but i am having trouble coming up with a way to do this, anyone got some ideas that i could try to get it to loop through and still create individual number sets for a n deep sequence?
ta.
|
|
|
|
|
I would start with a list of numbers, from 1 -> x, then I'd write code to pull numbers from that sequence to create a number using every possible combination.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i understand the theory, but trying to get my head around the coding of that theory is what i am after assistance with :P
|
|
|
|
|
Just solved it, i used a subroutine, and called that sub inside itself for each depth and it then looped inside that and called itself again and again...works a treat
|
|
|
|
|
Yes, recursion is the right technique here. If you do it right, you get all the results in a predictable order (e.g. numeric ascending if your original data was numeric ascending).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
There are some interesting approaches to generating permutations that you may want to check out. Google will be your friend.
In your case, a lexicographic ordered permutation algorithm may be the right one. You can find an example here[^].
There are many permutation generation algorithms on Knuth's The Art Of Computer Programming and other similar books, if you want to dig more into it.
However, you should be aware that the time complexity for generating permutations is of order O(n!), whatever algorithm you use, so you may bump on the time barrier if you raise your "n" too much. It's still an improvement over the naive nested for loops algorithm you tried as first solution, which has time complexity O(n^n).
Enjoy!
2+2=5 for very large amounts of 2
(always loved that one hehe!)
|
|
|
|
|
Good evening everybody,
in a viewer application I display images read from a non-GDI-compatible format through an RGB array:
Dim arrayImage() As Byte = MakeRGBArray(Me.DPXFile, ImageOffset, Width)
Dim gch As GCHandle = GCHandle.Alloc(arrayImage, GCHandleType.Pinned)
Dim pBuf As IntPtr = gch.AddrOfPinnedObject
PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
PictureBox1.Image = New Bitmap(Width, Height, 3 * Width, Imaging.PixelFormat.Format24bppRgb, pBuf)
gch.Free()
This basically works, but from time to time I run into trouble (i.e. the program crashes) when resizing or refreshing the form or the picture box. The AccessViolationException reports an attempt to read from protected memory, so I figure the GCHandle might not be freed before unloading the picture
I'm not experienced regarding the memory details, but it seems to work to leave the last line away and free the handle just before the next picture is loaded with If gch.IsAllocated Then gch.Free() . Could anybody please tell me if I'm on the right track with that or running into the next trouble? More questions arise from that, like: Would the handle be freed automatically when the form is closed?
Thanks for advice
Mick
|
|
|
|
|
Is it possible that the issue is that you are freeing an object which is still in use, because the bitmap is using it ? That seems likely to me, and it explans what's happening ( an intermittent crash, when the memory is reused )
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
that is what documentation is for. MSDN on the Bitmap constructor that takes an IntPtr says: "The caller is responsible for allocating and freeing the block of memory specified by the scan0 parameter, however, the memory should not be released until the related Bitmap is released."
Hence you can't unpin the data as long as the bitmap is alive.
One solution could be to create a second image from the first one, like so (not tested, and C# syntax):
Bitmap bm1 = new Bitmap(Width, Height, 3 * Width, Imaging.PixelFormat.Format24bppRgb, pBuf);
Bitmap bm2 = new Bitmap(bm1);
bm1.Dispose();
gch.Free();
PictureBox1.Image=bm2;
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
@ Christian
I guess you're right. I had thought the new bitmap represents a separate instance after its construction and freed the memory too early, obviously.
@ Luc
Thank you for the workaround idea that makes sense. For the moment, I figure, I can leave the current solution of just freeing GCHandle later...
|
|
|
|
|
I would like to be able to pass arguments that may include system variables to File.Copy as part of a console app for updating my applications.
the console app is passed items from the main program that are read from an xml file
Private Function DownloadNetworkFile(ByVal UpdatePath As String, ByVal ProgramPath As String, ByVal FileName As String) As Boolean
If File.Exists(UpdatePath & "\" & FileName) = True Then
Try
If Not Directory.Exists(ProgramPath) Then
Directory.CreateDirectory(ProgramPath)
End If
File.Copy(UpdatePath & "\" & FileName, ProgramPath & "\" & FileName, True)
Console.WriteLine("Copy File " & FileName & "OK?= TRUE")
myUpdateLog.AppendLine("Copy File " & FileName & "OK?= TRUE")
Return False
Catch ex As Exception
Console.WriteLine("Copy File " & FileName & " OK?= " & ex.Message)
myUpdateLog.AppendLine("Copy File " & FileName & " OK?= " & ex.Message)
Console.WriteLine("Press Enter to continue")
myUpdateLog.AppendLine("Press Enter to continue")
Console.ReadKey()
Return True
End Try
Else
Console.WriteLine("Copy File " & FileName & "OK?= DOES NOT EXIST AT " & UpdatePath & "\" & FileName)
myUpdateLog.AppendLine("Copy File " & FileName & "OK?= DOES NOT EXIST AT " & UpdatePath & "\" & FileName)
Return True
End If
End Function>
when i do send %windir% file.copy does not fail but then it also does not seem to copy the file to the correct location.
for example
DownloadNetworkFile("c:","%windir%","test.bat")
in the console app i get Copy File test.bat OK?= TRUE
but when i go to the Windows Directory it is not there.
is there something i'm missing?
Thank you
|
|
|
|
|
This will get the Windows install directory
dim SystemRoot as string = System.Environment.GetEnvironmentVariable("SYSTEMROOT")
and two more ways to get the system32 directory:
dim sys32_1 as string = System.Environment.GetFolderPath(System.Environment.SpecialFolder.System)
dim sys32_2 as string = System.Environment.SystemDirectory
then you can do as you please with the path.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|
|
You might try checking your ProgramPath parameter for %windir% first, and replace it with the value of your variable:
if ProgramPath = "%windir%" then ProgramPath = System.Environment.GetEnvironmentVariable("windir") Hope it helps.
Regards
Mick
|
|
|
|