|
Thanks for your response Steve..Havn't tried it yet but definitely share it with you..Regarding the GoTo..well the code is legacy code so can't do much
Thanks
~Varun
|
|
|
|
|
Thanks a ton Steve.. My problem has been solved after a little exploration in the enable conditions.
Regards
Varun
|
|
|
|
|
Buggedforever wrote: DoEvents
Eeekkk
Buggedforever wrote: On Error GoTo ERR_ROUTINE
AAHHHHhhhh
Buggedforever wrote: GoTo SUBEND
AAAHHhhhhhh
Sorry, I was not expecting VB6, I need a shower, ergh.
There is a rule that discourages answerers from being sarcastic and rude but I just can't help it - VB6 make my skin crawl.
|
|
|
|
|
Mycroft Holmes wrote: I was not expecting VB6
Took me a couple of seconds to recoil in horror myself
I don't speak Idiot - please talk slowly and clearly
I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury
Driven to the arms of Heineken by the wife
|
|
|
|
|
hi,
I have a numericupdown control, I want users be able to increase its value by 0.15 (15 minutes)
and when it reaches 60 it becomes 1,
actually it works but only when user increase it, for example if its 1.30 and user decrease it it will be 0.85, I know my code has problem but I dont know how to solve it
can someone help me?
|
|
|
|
|
Shaahinm wrote: can someone help me?
Only if you post your code.
Alan.
|
|
|
|
|
Dim s As Decimal = 0.6
Private Sub nupS_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nupS.ValueChanged
If (nupS.Value Mod s) = 0 Then
nupS.Value = CDec(CInt(nupS.Value))
s += 1
End If
End Sub
|
|
|
|
|
And what is the problem?
if you set the step value to 0.15 it would increment like so:
0.00
0.15
0.30
0.45
0.60 assume this magically changes into 1.00
1.15
1.30
1.45
1.60 magic required ==> 2.0
and decrement like this:
2.30
2.15
2.00
1.85 assume this magically changes into 1.45
1.30
1.15
1.00
0.85 magic required ==> 0.45
0.30
0.15
0.00
So all that is needed is two lines of code, according to these rules:
if fraction==0.60 add +0.40
if fraction==0.85 add -0.40
Put something to that effect inside the valuechanged handler.
Warning: if the control would allow a paste, all kinds of nasty things could happen...
|
|
|
|
|
thank you man,
the problem is that I am not able to find out whether user is increasing the value or decreasing it
Should I store its value and check it when the value changed???
or is it possible to use delegates and events.
|
|
|
|
|
Shaahinm wrote: the problem is that I am not able to find out whether user is increasing the value or decreasing it
did I need that information in the two rules:
if fraction==0.60 add +0.40
if fraction==0.85 add -0.40
???
|
|
|
|
|
Anyone know a good free easy to use tool to created and edit pdf files ???
Thanks
|
|
|
|
|
There are lots of Good and Free Libraries for PDF files. I do not know any easy ones though!
I would suggest that you google for c# free pdf libraries and read their documentation and select the one that you understand the most.
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.”
|
|
|
|
|
This is one of the method but i did in vb.net
here is the link to change the vb code to c code
http://www.google.com.bh/search?hl=en&source=hp&q=code+converter+vb+to+c&btnG=Google+Search&meta=&aq=2&oq=code+convert[^]
public void CrearPDF(DataSet ds, string nombrearchivopdf)
{
StrongTypedReport cr = new StrongTypedReport();
cr.SetDataSource(ds);
Stream input = cr.ExportToStream(
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
FileStream output = new FileStream(nombrearchivopdf,
FileMode.Create);
const int size = 4096;
byte[] bytes = new byte[4096];
int numBytes;
while((numBytes = input.Read(bytes, 0, size)) > 0)
output.Write(bytes, 0, numBytes);
output.Close();
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
That is excellent. I can do the same with some of the software that I have.
But it ain't free is it? This was one of the requirements of the OP.
The link to conversion the software search was a good idea, I don't need it personally, but others might find it useful.
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.”
|
|
|
|
|
Hello everybody,
in a partial task of my project I read from file and displayed a non-GDI picture (10-bit linear-RGB DPX file). In a former approach, this took around 580 ms for a single picture. Hoping to increase the performance, I split the reading of the file and the display of the picture into 2 separate functions - which has been resulting in an immense loss of performance (7500 ms per picture now). I can't understand why and how to avoid that? Maybe someone around here could recognize my blind spot and help me out?
In the newer approach, the file reading is performed by a background worker while the first picture displays. The BGW puts header and image data (as array of UInt) into a special 'dpx' class, a particular number of which are stored in a 'frames' class. This part still seems to work fine. The dpx class reads the file like
Public Function read_Image() As Array
fsh = New FileStream(Me.FileToRead.FullName, FileMode.Open)
brh = New BinaryReader(fsh)
'Set the position to the proper position of the files stream.
fsh.Position = Me.DPXOffset
ReDim DPXPixelArray(((Me.FileToRead.Length - fsh.Position) / 4) - 1)
For i As UInteger = 0 To Me.DPXPixelArray.GetUpperBound(0)
Me.DPXPixelArray(i) = SwapDWORD(brh.ReadUInt32)
Next
fsh.Close()
brh = Nothing
Return DPXPixelArray
End Function
Before, all of this was part of the displaying process: read the file, swap the bytes properly, then get RGB out of the 10-bit-data into a RGB byte array (i.e. convert) and display the bitmap. Now that the DPXPixelArray holds the raw data stored in the class in order to do what ever with it, I expected to have much lesser than 580 ms for the display process, since the class only (?) has to convert the array of UInt to a bitmap. This is done with
Public Sub DisplayImage()
If gch.IsAllocated Then gch.Free()
Dim arrayImage() As Byte = dpx.RGBArrayFromRawArray(dpx.DPXPixelArray)
gch = GCHandle.Alloc(arrayImage, GCHandleType.Pinned)
Dim pBuf As IntPtr = gch.AddrOfPinnedObject
Dim Width As Integer = dpx.DPXWidth
Dim Height As Integer = dpx.DPXHeight
Dim stride As Integer = Width * 3
PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
PictureBox1.Image = New Bitmap(Width, Height, stride, Imaging.PixelFormat.Format24bppRgb, pBuf)
End Sub
Public Function RGBArrayFromRawArray(ByVal RawArray) As Array
Dim j As Integer
Dim RGBArray(CInt(RawArray.Length * 3) - 1) As Byte
For i = 0 To (RawArray.Length - 1)
j = i * 3
Dim buff As UInteger = RawArray(i)
' bit-shifting operation
RGBArray(j) = (buff And &HFFC) >> 4 ' Blue
RGBArray(j + 1) = (buff And &H3FFFFC) >> 14 ' Green
RGBArray(j + 2) = (buff And &HFFFFFFFC) >> 24 ' Red
Next i
Return RGBArray
End Function
Measuring the elapsed time, the RGBArrayFromRawArray function alone takes more than 7 seconds now! What's wrong here? The function seems to be almost identical to what I had before...
Any hints and advice extremely welcome!
Thank
Mick
|
|
|
|
|
I was able to solve the problem myself with the change of just a few lines of code, in particular taking care of proper VB syntax:
Public Function RGBArrayFromRawArray(ByVal RawArray() As UInteger) As Array '<----- change
Dim j As Integer
Dim RGBArray(CInt(RawArray.Length * 3) - 1) As Byte
For i As Integer = 0 To (RawArray.Length - 1)
j = i * 3
Dim buff As UInteger = RawArray(i) '<----- change
' bit-shifting operation
RGBArray(j) = (buff And &HFFC) >> 4 ' Blue
RGBArray(j + 1) = (buff And &H3FFFFC) >> 14 ' Green
RGBArray(j + 2) = (buff And &HFFFFFFFC) >> 24 ' Red
Next i
Return RGBArray
End Function
Each picture displays from the DPXPixelArray within 65 ms now!
Quite a good lesson for me how taking a nap and then remember proper syntax can make a huge difference...
|
|
|
|
|
I need help learning how to use activelock from could someone help me?
please email me at timnboys@gmail.com or email me on this site, to help me with activelock, I am using visual basic 2008 express edition
|
|
|
|
|
If you go to their home page (the address you give in your post), you will see that there is a navigation link to 'Forum'. That is where you should ask your question. They know more about their product than anyone here is likely to.
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.”
|
|
|
|
|
you do realize you've just sent away a new CP customer?
Chris wants you to be much nicer. We're in the middle of a crisis, we can't afford to loose business like that.
|
|
|
|
|
Sorry!
Won't do it again.
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.”
|
|
|
|
|
Actually, it was the correct thing to do. He was being sarcastic.
It's amazing how many people out there think that we know everything about the thousands of libraries out there. Apparently, the manufacturer of a library is the last people you ask when you have questions about it.
|
|
|
|
|
Dave Kreskowiak wrote: Actually, it was the correct thing to do. He was being sarcastic.
I knew that, but that Luc is such a bully. Just cos he has a sea to hide behind, he thinks he's safe. One day though, one day........
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.”
|
|
|
|
|
Hi,
I've got a problem with generating MustOverride Property.
My code looks like this:
Dim p1t1 As New CodeMemberProperty
p1t1.Name = "myProperty"
p1t1.Type = New CodeTypeReference(GetType(Integer))
p1t1.Attributes = MemberAttributes.Abstract Or _
MemberAttributes.Public
What I've got after GenerateCodeFromCompileUnit() is:
Public MustOverride Property myProperty() As Integer
End Property
It's not ok because in VB it should looks like this:
Public MustOverride Property myProperty() As Integer
When I'm doing the same with a method everything is ok.
My code:
Dim m1t1 As New CodeMemberMethod
m1t1.Name = "myMethod"
m1t1.ReturnType = New CodeTypeReference(GetType(System.Void))
m1t1.Attributes = MemberAttributes.Abstract Or _
MemberAttributes.Public
And generated code:
Public MustOverride Sub myMethod()
Of course I'm placing these members in a class declaration, that is
CodeTypeDeclaration object and of course this class declaration has attribute TypeAttributes.Abstract :
Dim t1 As New CodeTypeDeclaration
t1.Name = "Class1"
t1.IsClass = True
t1.TypeAttributes = Reflection.TypeAttributes.Abstract Or _
Reflection.TypeAttributes.Class Or _
Reflection.TypeAttributes.Public
Please help me.
Thanks in advance
|
|
|
|
|
Hi All,
I have developed an application in vb.net to access the system information of network PC. I have used Management Namespace for this. The application is running fine on Srever 2003 OS network but the application is unable to connect to XP machines. Even though i m providing proper password of the machine it is unable to connect to xp machine.
does any one know the reson for this? Do i need to write any spacial code for XP machine connection?
Please help me out?
Thanx in advance
Regards,
Paramhans
|
|
|
|
|
Without knowing the error that it's throwing, there's not a lot anyone can tell you that would be useful.
|
|
|
|