473,327 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

The following Marshal code almost works

The following almost works.
The problem is Marshal.PtrToStringAuto seems to terminate at the first null
so I don't get the full string.

Any suggestions on how to fix this?
Or how to improve the code?

Thanks

PS I added the +1 because as I understand the GetLogicalDriveStrings doc
there will be an uncounted null at the end for Unicode. Agree?

Dim lDrives As String
Dim lLenOflDrives As Integer
Dim lPointerToMemory As IntPtr
lLenOflDrives = Kernel.GetLogicalDriveStrings(0, Nothing)
Dim lDrivesSB As New StringBuilder(lLenOflDrives + 1)
lDrivesSB.Insert(0, ChrW(33), lLenOflDrives + 1)
lPointerToMemory = Marshal.StringToHGlobalAuto(lDrivesSB.ToString)
'Get the list of dirves. Returns a:\<null>c:\<null><null>
If Kernel.GetLogicalDriveStrings(lLenOflDrives, lPointerToMemory) Then
'Would need to use PtrToStringAnsi if GetLogicalDriveStrings were declared
CharSet.Ansi
lDrives = Marshal.PtrToStringAuto(lPointerToMemory, lLenOflDrives + 1) 'Text
to first null, e.g, a:\
Marshal.FreeHGlobal(lPointerToMemory)
'See if aDrive is in the list
DriveExists = InStr(1, lDrives, drive, CompareMethod.Text)
End If
Nov 21 '05 #1
13 2137
Or how to improve the code?

Thanks

PS I added the +1 because as I understand the GetLogicalDriveStrings doc
there will be an uncounted null at the end for Unicode. Agree?

Dim lDrives As String
Dim lLenOflDrives As Integer
Dim lPointerToMemory As IntPtr
lLenOflDrives = Kernel.GetLogicalDriveStrings(0, Nothing)
Dim lDrivesSB As New StringBuilder(lLenOflDrives + 1)
lDrivesSB.Insert(0, ChrW(33), lLenOflDrives + 1)
lPointerToMemory = Marshal.StringToHGlobalAuto(lDrivesSB.ToString)
'Get the list of dirves. Returns a:\<null>c:\<null><null>
If Kernel.GetLogicalDriveStrings(lLenOflDrives, lPointerToMemory) Then


If you change your GetLogicalDriveStrings declaration so that the last
parameter is a Char(), you can simply call it like this

Dim buffer(lLenOflDrives - 1) As Char
If Kernel.GetLogicalDriveStrings(lLenOflDrives, buffer) > 0 Then

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 21 '05 #2
Just Me,

I don't know if you are interested in some managed code to get logical
drives.
However I place it here, when you not, maybe somebody else when he/she is
searching.

set a reference and Imports System.Management
\\\
Dim searcher As New ManagementObjectSearcher _
("SELECT * FROM Win32_LogicalDisk")
Dim ManObjOp As ManagementObject
If searcher.Get.Count > 1 Then
For Each ManObjOp In searcher.Get
Dim win32 As String = "Win32_LogicalDisk='" &
ManObjOp("Name").ToString & "'"
Dim ManObjLogD As New ManagementObject(win32)
For Each diskProperty As PropertyData In
ManObjLogD.Properties
If Not diskProperty.Value Is Nothing Then
Console.WriteLine _
("{0} = {1}", diskProperty.Name, diskProperty.Value)
End If
Next
Next
End If
///
Cor
Nov 21 '05 #3
Just Me,
First I would "improve it" via using Environment.GetLogicalDrives instead.

Is there a reason you are not using Environment.GetLogicalDrives?
According to Adam's book Marshal.PtrToStringAuto(IntPtr, Integer) should
*NOT* terminate at the first null character, where as the
Marshal.PtrToStringAuto(IntPtr) does. Are you certain its getting truncated
& not simply the Debugger stops displaying after the null char? Remember the
Debugger treats the null char as a string terminator!

If I actually needed to call Kernel32.GetLogicalDriveStrings I would use
Marshal.AllocHGlobal instead of Marshal.StringToHGlobalAuto, as
Marshal.StringToHGlobalAuto is more for when you need to pass a string into
Win32, not return a string from Win32...

Something like:
Dim lDrives As String
Dim lLenOflDrives As Integer = Kernel.GetLogicalDriveStrings(0,
IntPtr.Zero)
Dim lPointerToMemory As IntPtr = Marshal.AllocHGlobal(lLenOflDrives
* 2)
Dim rc As Integer = Kernel.GetLogicalDriveStrings(lLenOflDrives,
lPointerToMemory)
If rc <> 0 Then
lDrives = Marshal.PtrToStringAuto(lPointerToMemory,
lLenOflDrives) 'Text to first null, e.g, a:\
Marshal.FreeHGlobal(lPointerToMemory)
Dim drives() As String = lDrives.Split(ControlChars.NullChar)
End If

For information on P/Invoke I normally reference Adam Nathan's book ".NET
and COM - The Complete Interoperability Guide" from SAMS Press.

Hope this helps
Jay
" Just Me" <gr****@a-znet.com> wrote in message
news:eI*************@TK2MSFTNGP09.phx.gbl...
The following almost works.
The problem is Marshal.PtrToStringAuto seems to terminate at the first
null so I don't get the full string.

Any suggestions on how to fix this?
Or how to improve the code?

Thanks

PS I added the +1 because as I understand the GetLogicalDriveStrings doc
there will be an uncounted null at the end for Unicode. Agree?

Dim lDrives As String
Dim lLenOflDrives As Integer
Dim lPointerToMemory As IntPtr
lLenOflDrives = Kernel.GetLogicalDriveStrings(0, Nothing)
Dim lDrivesSB As New StringBuilder(lLenOflDrives + 1)
lDrivesSB.Insert(0, ChrW(33), lLenOflDrives + 1)
lPointerToMemory = Marshal.StringToHGlobalAuto(lDrivesSB.ToString)
'Get the list of dirves. Returns a:\<null>c:\<null><null>
If Kernel.GetLogicalDriveStrings(lLenOflDrives, lPointerToMemory) Then
'Would need to use PtrToStringAnsi if GetLogicalDriveStrings were declared
CharSet.Ansi
lDrives = Marshal.PtrToStringAuto(lPointerToMemory, lLenOflDrives + 1)
'Text to first null, e.g, a:\
Marshal.FreeHGlobal(lPointerToMemory)
'See if aDrive is in the list
DriveExists = InStr(1, lDrives, drive, CompareMethod.Text)
End If

Nov 21 '05 #4
Mattias,
If you change your GetLogicalDriveStrings declaration so that the last
parameter is a Char(), you can simply call it like this I like that idea!

Thanks for reminding me...

Jay

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Or how to improve the code?

Thanks

PS I added the +1 because as I understand the GetLogicalDriveStrings doc
there will be an uncounted null at the end for Unicode. Agree?

Dim lDrives As String
Dim lLenOflDrives As Integer
Dim lPointerToMemory As IntPtr
lLenOflDrives = Kernel.GetLogicalDriveStrings(0, Nothing)
Dim lDrivesSB As New StringBuilder(lLenOflDrives + 1)
lDrivesSB.Insert(0, ChrW(33), lLenOflDrives + 1)
lPointerToMemory = Marshal.StringToHGlobalAuto(lDrivesSB.ToString)
'Get the list of dirves. Returns a:\<null>c:\<null><null>
If Kernel.GetLogicalDriveStrings(lLenOflDrives, lPointerToMemory) Then


If you change your GetLogicalDriveStrings declaration so that the last
parameter is a Char(), you can simply call it like this

Dim buffer(lLenOflDrives - 1) As Char
If Kernel.GetLogicalDriveStrings(lLenOflDrives, buffer) > 0 Then

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 21 '05 #5
Works great.

Some comments/questions:

From Help

GetLogicalDriveStrings

lpBuffer
[out] Pointer to a buffer that receives a series of null-terminated strings,
one for each valid drive in the system, that end with a second null
character. The following example shows the buffer contents with <null>
representing the terminating null character.
c:\<null>d:\<null><null>
In my run I got for drives()
A:\
C:\
D:\
""
""
I think the above adds up to 14 chars (counting nulls)

lLengthOfDrives is 13
Which make sense A:\<null>C:\<null>D:\<null><null>
I'm confused about where the extra "" came from, unless DOTNET adds a null
to the buffer, in which case the buffer is too small!

Thanks
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Just Me,
First I would "improve it" via using Environment.GetLogicalDrives instead.

Is there a reason you are not using Environment.GetLogicalDrives?
According to Adam's book Marshal.PtrToStringAuto(IntPtr, Integer) should
*NOT* terminate at the first null character, where as the
Marshal.PtrToStringAuto(IntPtr) does. Are you certain its getting
truncated & not simply the Debugger stops displaying after the null char?
Remember the Debugger treats the null char as a string terminator!

If I actually needed to call Kernel32.GetLogicalDriveStrings I would use
Marshal.AllocHGlobal instead of Marshal.StringToHGlobalAuto, as
Marshal.StringToHGlobalAuto is more for when you need to pass a string
into Win32, not return a string from Win32...

Something like:
Dim lDrives As String
Dim lLenOflDrives As Integer = Kernel.GetLogicalDriveStrings(0,
IntPtr.Zero)
Dim lPointerToMemory As IntPtr = Marshal.AllocHGlobal(lLenOflDrives
* 2)
Dim rc As Integer = Kernel.GetLogicalDriveStrings(lLenOflDrives,
lPointerToMemory)
If rc <> 0 Then
lDrives = Marshal.PtrToStringAuto(lPointerToMemory,
lLenOflDrives) 'Text to first null, e.g, a:\
Marshal.FreeHGlobal(lPointerToMemory)
Dim drives() As String = lDrives.Split(ControlChars.NullChar)
End If

For information on P/Invoke I normally reference Adam Nathan's book ".NET
and COM - The Complete Interoperability Guide" from SAMS Press.

Hope this helps
Jay
" Just Me" <gr****@a-znet.com> wrote in message
news:eI*************@TK2MSFTNGP09.phx.gbl...
The following almost works.
The problem is Marshal.PtrToStringAuto seems to terminate at the first
null so I don't get the full string.

Any suggestions on how to fix this?
Or how to improve the code?

Thanks

PS I added the +1 because as I understand the GetLogicalDriveStrings doc
there will be an uncounted null at the end for Unicode. Agree?

Dim lDrives As String
Dim lLenOflDrives As Integer
Dim lPointerToMemory As IntPtr
lLenOflDrives = Kernel.GetLogicalDriveStrings(0, Nothing)
Dim lDrivesSB As New StringBuilder(lLenOflDrives + 1)
lDrivesSB.Insert(0, ChrW(33), lLenOflDrives + 1)
lPointerToMemory = Marshal.StringToHGlobalAuto(lDrivesSB.ToString)
'Get the list of dirves. Returns a:\<null>c:\<null><null>
If Kernel.GetLogicalDriveStrings(lLenOflDrives, lPointerToMemory) Then
'Would need to use PtrToStringAnsi if GetLogicalDriveStrings were
declared CharSet.Ansi
lDrives = Marshal.PtrToStringAuto(lPointerToMemory, lLenOflDrives + 1)
'Text to first null, e.g, a:\
Marshal.FreeHGlobal(lPointerToMemory)
'See if aDrive is in the list
DriveExists = InStr(1, lDrives, drive, CompareMethod.Text)
End If


Nov 21 '05 #6
Lots of stuff that's new to me - need to study it

Thanks
"Cor Ligthert" <no************@planet.nl> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
Just Me,

I don't know if you are interested in some managed code to get logical
drives.
However I place it here, when you not, maybe somebody else when he/she is
searching.

set a reference and Imports System.Management
\\\
Dim searcher As New ManagementObjectSearcher _
("SELECT * FROM Win32_LogicalDisk")
Dim ManObjOp As ManagementObject
If searcher.Get.Count > 1 Then
For Each ManObjOp In searcher.Get
Dim win32 As String = "Win32_LogicalDisk='" &
ManObjOp("Name").ToString & "'"
Dim ManObjLogD As New ManagementObject(win32)
For Each diskProperty As PropertyData In
ManObjLogD.Properties
If Not diskProperty.Value Is Nothing Then
Console.WriteLine _
("{0} = {1}", diskProperty.Name,
diskProperty.Value)
End If
Next
Next
End If
///
Cor

Nov 21 '05 #7
Doesn't get much simpler then that.

Thanks

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
Or how to improve the code?

Thanks

PS I added the +1 because as I understand the GetLogicalDriveStrings doc
there will be an uncounted null at the end for Unicode. Agree?

Dim lDrives As String
Dim lLenOflDrives As Integer
Dim lPointerToMemory As IntPtr
lLenOflDrives = Kernel.GetLogicalDriveStrings(0, Nothing)
Dim lDrivesSB As New StringBuilder(lLenOflDrives + 1)
lDrivesSB.Insert(0, ChrW(33), lLenOflDrives + 1)
lPointerToMemory = Marshal.StringToHGlobalAuto(lDrivesSB.ToString)
'Get the list of dirves. Returns a:\<null>c:\<null><null>
If Kernel.GetLogicalDriveStrings(lLenOflDrives, lPointerToMemory) Then


If you change your GetLogicalDriveStrings declaration so that the last
parameter is a Char(), you can simply call it like this

Dim buffer(lLenOflDrives - 1) As Char
If Kernel.GetLogicalDriveStrings(lLenOflDrives, buffer) > 0 Then

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 21 '05 #8

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Just Me,
First I would "improve it" via using Environment.GetLogicalDrives instead.

Is there a reason you are not using Environment.GetLogicalDrives?


Didn't know about it - but I want to play with Marshaling anyway
Nov 21 '05 #9
> According to Adam's book Marshal.PtrToStringAuto(IntPtr, Integer) should
*NOT* terminate at the first null character, where as the
Marshal.PtrToStringAuto(IntPtr) does. Are you certain its getting
truncated & not simply the Debugger stops displaying after the null char?
Remember the Debugger treats the null char as a string terminator!


Just checked this - your right - routine was working OK but the Debugger
fooled me.
Now I can't trust anything. CheckedDebug.Writeline and Console.writeline -
they also stop at the null.

Thanks
Nov 21 '05 #10
Just Me,
Thinking about it the two blank strings are expected. String.Split returns
every thing between the null chars.

Your string is:

Const null As Char = ControlChars.NullChar

Dim ldrives As String = "A:\" & null & "C:\" & null & "D:\" & null &
null

Notice there is an empty string between the last two null's & an empty
string between the last null & the end of the string.

You could simply trim off the null chars on the end before you split it:

Dim drives() As String =
ldrives.TrimEnd(ControlChars.NullChar).Split(Contr olChars.NullChar)

Or simply not include them when you create the string:

lDrives = Marshal.PtrToStringAuto(lPointerToMemory,
lLenOflDrives - 2)

Again I would probably simply use Environment.GetLogicalDrives, however this
is a good exercise in how Interop works...

Hope this helps
Jay

" Just Me" <gr****@a-znet.com> wrote in message
news:OH*************@TK2MSFTNGP12.phx.gbl...
Works great.

Some comments/questions:

From Help

GetLogicalDriveStrings

lpBuffer
[out] Pointer to a buffer that receives a series of null-terminated
strings, one for each valid drive in the system, that end with a second
null character. The following example shows the buffer contents with
<null> representing the terminating null character.
c:\<null>d:\<null><null>
In my run I got for drives()
A:\
C:\
D:\
""
""
I think the above adds up to 14 chars (counting nulls)

lLengthOfDrives is 13
Which make sense A:\<null>C:\<null>D:\<null><null>
I'm confused about where the extra "" came from, unless DOTNET adds a null
to the buffer, in which case the buffer is too small!

Thanks
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:OQ**************@TK2MSFTNGP10.phx.gbl...
Just Me,
First I would "improve it" via using Environment.GetLogicalDrives
instead.

Is there a reason you are not using Environment.GetLogicalDrives?
According to Adam's book Marshal.PtrToStringAuto(IntPtr, Integer) should
*NOT* terminate at the first null character, where as the
Marshal.PtrToStringAuto(IntPtr) does. Are you certain its getting
truncated & not simply the Debugger stops displaying after the null char?
Remember the Debugger treats the null char as a string terminator!

If I actually needed to call Kernel32.GetLogicalDriveStrings I would use
Marshal.AllocHGlobal instead of Marshal.StringToHGlobalAuto, as
Marshal.StringToHGlobalAuto is more for when you need to pass a string
into Win32, not return a string from Win32...

Something like:
Dim lDrives As String
Dim lLenOflDrives As Integer = Kernel.GetLogicalDriveStrings(0,
IntPtr.Zero)
Dim lPointerToMemory As IntPtr =
Marshal.AllocHGlobal(lLenOflDrives * 2)
Dim rc As Integer = Kernel.GetLogicalDriveStrings(lLenOflDrives,
lPointerToMemory)
If rc <> 0 Then
lDrives = Marshal.PtrToStringAuto(lPointerToMemory,
lLenOflDrives) 'Text to first null, e.g, a:\
Marshal.FreeHGlobal(lPointerToMemory)
Dim drives() As String = lDrives.Split(ControlChars.NullChar)
End If

For information on P/Invoke I normally reference Adam Nathan's book ".NET
and COM - The Complete Interoperability Guide" from SAMS Press.

Hope this helps
Jay
" Just Me" <gr****@a-znet.com> wrote in message
news:eI*************@TK2MSFTNGP09.phx.gbl...
The following almost works.
The problem is Marshal.PtrToStringAuto seems to terminate at the first
null so I don't get the full string.

Any suggestions on how to fix this?
Or how to improve the code?

Thanks

PS I added the +1 because as I understand the GetLogicalDriveStrings doc
there will be an uncounted null at the end for Unicode. Agree?

Dim lDrives As String
Dim lLenOflDrives As Integer
Dim lPointerToMemory As IntPtr
lLenOflDrives = Kernel.GetLogicalDriveStrings(0, Nothing)
Dim lDrivesSB As New StringBuilder(lLenOflDrives + 1)
lDrivesSB.Insert(0, ChrW(33), lLenOflDrives + 1)
lPointerToMemory = Marshal.StringToHGlobalAuto(lDrivesSB.ToString)
'Get the list of dirves. Returns a:\<null>c:\<null><null>
If Kernel.GetLogicalDriveStrings(lLenOflDrives, lPointerToMemory) Then
'Would need to use PtrToStringAnsi if GetLogicalDriveStrings were
declared CharSet.Ansi
lDrives = Marshal.PtrToStringAuto(lPointerToMemory, lLenOflDrives + 1)
'Text to first null, e.g, a:\
Marshal.FreeHGlobal(lPointerToMemory)
'See if aDrive is in the list
DriveExists = InStr(1, lDrives, drive, CompareMethod.Text)
End If



Nov 21 '05 #11
Notice there is an empty string between the last two null's & an empty
string between the last null & the end of the string.

Not sure what you mean by an empty string but QuickWatch give

lDrives.chars(10)="\"c
lDrives.chars(11)=Nothing
lDrives.chars(12))=Nothing
lDrives.chars(13)Index out of range

As you'd expect since lLenOflDrives=13

I don't see anything after the second null

I just hate to move on when I can't figure something out.
Thanks for the help


Nov 21 '05 #12
Just Me,
Remember that a null char is nothing special in .NET, it is a perfectly
valid string character.

Do you understand how String.Split works? It returns each of the strings
between the delimiters. If you have two delimiters in a row it returns an
empty string, if your string starts with or ends with a Delimiter it returns
an empty string.

Try the following:

Dim input As String = "A:\|C:\|D:\||"

Dim values() As String = input.Split("|"c)

How many strings were returned?

Do you see why they were all returned?

Null char is only special when you directly or indirectly call a Win32 API.
In purely managed code, such as the String class, null char has no
significance!

Hope this helps
Jay


" Just Me" <gr****@a-znet.com> wrote in message
news:e4**************@TK2MSFTNGP12.phx.gbl...
Notice there is an empty string between the last two null's & an empty
string between the last null & the end of the string.

Not sure what you mean by an empty string but QuickWatch give

lDrives.chars(10)="\"c
lDrives.chars(11)=Nothing
lDrives.chars(12))=Nothing
lDrives.chars(13)Index out of range

As you'd expect since lLenOflDrives=13

I don't see anything after the second null

I just hate to move on when I can't figure something out.
Thanks for the help

Nov 21 '05 #13
I wasn't confused about the null char but it hadn't occurred to me that if
the string ended in a separator Split would assume an empty string after
it - but it does make sense.

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:ec*************@TK2MSFTNGP15.phx.gbl...
Just Me,
Remember that a null char is nothing special in .NET, it is a perfectly
valid string character.

Do you understand how String.Split works? It returns each of the strings
between the delimiters. If you have two delimiters in a row it returns an
empty string, if your string starts with or ends with a Delimiter it
returns an empty string.

Try the following:

Dim input As String = "A:\|C:\|D:\||"

Dim values() As String = input.Split("|"c)

How many strings were returned?

Do you see why they were all returned?

Null char is only special when you directly or indirectly call a Win32
API. In purely managed code, such as the String class, null char has no
significance!

Hope this helps
Jay


" Just Me" <gr****@a-znet.com> wrote in message
news:e4**************@TK2MSFTNGP12.phx.gbl...
Notice there is an empty string between the last two null's & an empty
string between the last null & the end of the string.

Not sure what you mean by an empty string but QuickWatch give

lDrives.chars(10)="\"c
lDrives.chars(11)=Nothing
lDrives.chars(12))=Nothing
lDrives.chars(13)Index out of range

As you'd expect since lLenOflDrives=13

I don't see anything after the second null

I just hate to move on when I can't figure something out.
Thanks for the help


Nov 21 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: syd | last post by:
Hello all, In my project, I have container classes holding lists of item classes. For example, a container class myLibrary might hold a list of item classes myNation and associated variables...
9
by: Angel | last post by:
Hi again, I'm trying to call functions from a proprietary DLL but it's turned out to be more difficult than I thought. I have this W32.DLL which was written in C by USPS. They don't provide the...
7
by: Mo | last post by:
I am having problem with marshaling struct in C#. //the original C++ struct typedef struct _tagHHP_DECODE_MSG { DWORD dwStructSize; // Size of decode structure. TCHAR ...
3
by: Tom | last post by:
I think I'm still a little rough on the principle and understanding of Marshal by value and Marshal by reference after reading various materials. my understanding of Marshal by value is that the...
6
by: SB | last post by:
I feel dumb to ask because I bet this is a simple question... Looking at the code below, can someone please explain why I get two different values in my Marshal.SizeOf calls (see the commented...
3
by: Vincent Schmid | last post by:
Hello, I've declared a VB callback Sub which is called by an unmanaged DLL (code below). The PData parameter is a pointer to a memory bloc which is allocated and freed by the dll as necessary. ...
6
by: william.thorpe.b | last post by:
I have recently switched from VS2003 to VS2005 and at the same time from V1 to V2 of the .NET Compact Framework. The target is a Windows CE 5.0 device and an ARMV4I processor. ...
5
by: Anurag | last post by:
I have been chasing a problem in my code since hours and it bolis down to this import marshal marshal.dumps(str(123)) != marshal.dumps(str("123")) Can someone please tell me why? when...
0
by: yogiam | last post by:
I have a server listening for connections. Client connects and both start streaming webcam images. This works fine as long as there is only one client connected(running as a Thread). When another...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.