|
Well it seems i don't completely understand what copymemory does in this particular function:
This line: CopyMemory(SBVocCut32Buf(0), buffer, length) -
Will everything contained in the buffer variable be copied into SBVocCut32Buf(0)? Or is the length parameter indicating that SBVocCut32Buf will be filled as follows:
SBVocCut32Buf(0) = buffer
SBVocCut32Buf(1) = buffer
SBVocCut32Buf(2) = buffer
...? May you explain that, please? thanks
|
|
|
|
|
I don't know, I provided a link to some documentation, read that.
It sounds like the memcpy() function in C.
Maybe Array.Copy() is the .NET equivalent.
Whatever it is, it will take no more than two lines of code.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
This is what i got so far based on the arcticle... Maybe another person may help me?
Public Sub SBVocalCut32(ByVal handle As Long, ByVal channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long)<br />
Dim SBVocCut32Buf() As Single, SBVocCut32CSample As Long<br />
Dim SBVocCut32DM As Single<br />
ReDim SBVocCut32Buf(length)<br />
<br />
Dim MyGC As GCHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned)<br />
Dim AddofLongValue As IntPtr = MyGC.AddrOfPinnedObject()<br />
<br />
Marshal.Copy(AddofLongValue, SBVocCut32Buf, 0, length)<br />
' Call CopyMemory(SBVocCut32Buf(0), buffer, length / 2)<br />
<br />
For SBVocCut32CSample = 0 To length / 2 - 1 Step 2<br />
SBVocCut32DM = ((0 - SBVocCut32Buf(SBVocCut32CSample)) + SBVocCut32Buf(SBVocCut32CSample + 1)) / 2<br />
SBVocCut32Buf(SBVocCut32CSample) = SBVocCut32DM<br />
SBVocCut32Buf(SBVocCut32CSample + 1) = SBVocCut32DM<br />
Next SBVocCut32CSample<br />
<br />
<br />
Marshal.Copy(SBVocCut32Buf, 0, AddofLongValue, length)<br />
'Call CopyMemory(buffer, SBVocCut32Buf(0), length / 2)<br />
End Sub
|
|
|
|
|
Luc Pattyn wrote: Write your own copy loop and get done with it!
I love it when you are masterful!
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.”
|
|
|
|
|
Henry Minute wrote: I love it when you are masterful!
I thought as much.
No beating around the bush.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
i am having a control on a panel and their properties in the propertygrid .
How to identify the Ctrl + C in this method
Public Function PreFilterMessage(ByRef msg As Message) As Boolean Implements IMessageFilter.PreFilterMessage
Const WM_KEYDOWN As Integer = 256
If msg.Msg = WM_KEYDOWN Then
Dim keyCode As Keys = (CType(CType(msg.WParam, Integer), Keys) And Keys.KeyCode)
If pg.SelectedGridItem.PropertyDescriptor IsNot Nothing Then
If (pg.SelectedGridItem.PropertyDescriptor.DisplayName = "Picture" Or _
pg.SelectedGridItem.PropertyDescriptor.DisplayName = "BackgroundPicture" _
And Not keyCode = Keys.Delete And Not (keyCode = Keys.Control And keyCode = Keys.C) _
And Not (keyCode = Keys.Control And keyCode = Keys.V) _
And Not (keyCode = Keys.Control And keyCode = Keys.X) _
And Not (keyCode = Keys.Control And keyCode = Keys.A) _
And Not (keyCode = Keys.Control And keyCode = Keys.Z) _
And Not (keyCode = Keys.Control And keyCode = Keys.Y)) Then
Return True
End If
End If
End If
Return False
End Function
what i am doing is i am blocking keyboard characters and only Delete button i am allowing in the propertygrid for picture Property .
When Ctrl C , or ctrl v or ctrl x or ctrl y or ctrl z is pressed i have to work on the control to copy ,paste etc if the the propertygrid.selecteditem is picture also how can i achieve this one ??
|
|
|
|
|
|
|
Its a programming language. It comes in two flavours - legacy and normal. Legacy is obsolete, so I won't go into it here. Normal uses the .net framework, documentation for which is available on MSDN. It's easy to read, and is the beginners' language of choice (unless you like the elegant, flowing symbols of C#)
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Computafreak wrote: (unless you like the elegant, flowing symbols of C#)
I think you mean "unless you like trying to figure out where the heck you're missing that curly bracket".
Visual Basic an excellent programming language that is popular with beginners and experts alike because it's easy to understand, and has a very English-like syntax. All while still having the power of the .NET framework at its disposal. Visual Basic is also very good for rapid application development thanks to the very well thought out Visual Studio IDE.
-Ray Phillips
|
|
|
|
|
It's probably a matter of taste (you have none ). I don't like having to write out sentences to tell a computer what to do when I can just use notes (comparatively). Besides, the IDE highlights and indents brackets automatically, so it's not that big a deal
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
Most .net is the same between the two really, the following is shorter in vb
Select Case number
Case 0
'do something
Case 1
'do something
Case 2
'do something
Case 3
'do something
End Select
I prefer the case insensitivity in vb, strSomething and strsomething should NOT be different, it is not obvious enough when your flying through the code that someone else wrote. And obvious errors are the easiest to discover.
See: http://www.joelonsoftware.com/articles/Wrong.html[^]
Proudly drinking the finest Maryland craft beer. Visiting Maryland for business? First round is on me!
|
|
|
|
|
Computafreak wrote: It comes in two flavours - legacy and normal.
So can I infer:
It comes in two flavours - legacy(abnormal) and normal.
जय हिंद
|
|
|
|
|
Yes. I've tried to use VB6 for a few years; it took months to get that influence out of my system. Classes in VB6 - ugh!
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
It's a beer, but not many people drink it.
Seriously, how can this be a serious question ? If you don't know what it is, you obviously are not a programmer, so why ask here ?
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
|
|
|
|
|
Christian Graus wrote: It's a beer,
Where can I get it?
|
|
|
|
|
Here[^] you can get some.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
|
http://www.duclaw.com
Proudly drinking the finest Maryland craft beer. Visiting Maryland for business? First round is on me!
|
|
|
|
|
Some things cannot be described and must be experienced. Set your mind free!
Now, go pound salt!
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
It's a version of Beginnering All Symbolic Instruction Code
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Hi,
I am trying to find the ProcessID in task manager for a Cluster Resource Item. For Example if we have a Cluster Service installed which has a resource item which is Online - Running, then what willbe the processid associated to it.
How ca we figure out using vbscripting?
Thanks
|
|
|
|
|
The processID will change every time the app is run. You can use WMI and it's Win32_Process class to get the ID from its ProcessId property. Documentation and a VBScript example can be found here[^].
|
|
|
|
|
Hello
If there is extra vb.net programmer who want to work for me
on some part of my project please contact me on:
modified on Wednesday, June 17, 2009 5:18 PM
|
|
|
|
|
Wrong place to post this numb skull.
You may want to post more details in the appropriate place like the actual work and what you're willing to pay.
Cheers!
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|