473,791 Members | 3,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb.net's CreateFile

Hi,

Private Declare Function CreateFile _
Lib "kernel32" Alias "CreateFile A" _
(ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByVal lpSecurityAttri butes As Any, _
ByVal dwCreationDispo sition As Long, _
ByVal dwFlagsAndAttri butes As Long, _
ByVal hTemplateFile As Long) As Long

Private Declare Function closeHandle_ _
Lib "kernel32" _
Alias "CloseHandl e" (ByVal hObject As Long) As Long

How to convert these to vb.net - or is there some other way of obtaining a
file handle. Well actually its "\\.\C:" i want to get to pass to another api
function

Stephen
Nov 20 '05 #1
8 7178
* "Stephen Remde" <sp*******@smre mde.co.uk> scripsit:
Private Declare Function CreateFile _
Lib "kernel32" Alias "CreateFile A" _
Declare the function as 'Auto' ('Declare Auto Function...'), then remove
the alias.
(ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByVal lpSecurityAttri butes As Any, _
ByVal dwCreationDispo sition As Long, _
ByVal dwFlagsAndAttri butes As Long, _
ByVal hTemplateFile As Long) As Long
Replace all 'As Long' with 'As Int32', 'lpSecurityAttr ibutes' can be
declared as 'Int32' (...), 'hTemplateFile' as 'IntPtr'. The return
value is an 'IntPtr'.
Private Declare Function closeHandle_ _
Lib "kernel32" _
Alias "CloseHandl e" (ByVal hObject As Long) As Long


Remove the alias, declare its parameter as 'IntPtr' and its return value
as 'Boolean'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #2
thanks, that worked...

now heres a tough one:

Private Declare Function NtFsControlFile _
Lib "ntdll.dll" _
(ByVal hFileHandle As Long, _
ByVal hEvent As Long, _
ByRef ApcRoutine As Any, _
ByRef ApcContext As Long, _
ByRef IoStatusBlock As IO_STATUS_BLOCK , _
ByVal FsControlCode As Long, _
ByRef InputBuffer As Any, _
ByVal InputBufferLeng th As Long, _
ByRef OutputBuffer As Any, _
ByVal OutputBufferLen gth As Long) As Long

i've tried

Public Structure IO_STATUS_BLOCK
Public Status As Integer ' (were long's in vb6)
Public Information As Integer
End Structure

Declare Auto Function NtFsControlFile Lib "ntdll.dll" _
(ByVal hFileHandle As Integer, _
ByVal hEvent As Integer, _
ByRef ApcRoutine As Integer, _
ByVal ApcContext As Integer, _
ByRef IoStatusBlock As IO_STATUS_BLOCK , _
ByVal FsControlCode As Integer, _
ByRef InputBuffer As Object, _
ByVal InputBufferLeng th As Integer, _
ByVal OutputBuffer As Object, _
ByRef OutputBufferLen gth As Integer) As Integer

but i get return values of &hC0000023 {Buffer Too Small} The buffer is too
small to contain the entry. No information has been written to the buffer.

so im thinking that theres something wrong ith these lines

ByRef InputBuffer As Object, _
ByVal InputBufferLeng th As Integer, _
ByVal OutputBuffer As Object, _
ByRef OutputBufferLen gth As Integer

the call i am making is

Dim a as Long
Dim b(bSize) as Byte

NtFsControlFile ( ... , ... , ... , ... , ... , ... , a , 8 , b , bSize)

Thanks in advance,
Stephen

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bo******** *****@ID-208219.news.uni-berlin.de...
* "Stephen Remde" <sp*******@smre mde.co.uk> scripsit:
Private Declare Function CreateFile _
Lib "kernel32" Alias "CreateFile A" _


Declare the function as 'Auto' ('Declare Auto Function...'), then remove
the alias.
(ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByVal lpSecurityAttri butes As Any, _
ByVal dwCreationDispo sition As Long, _
ByVal dwFlagsAndAttri butes As Long, _
ByVal hTemplateFile As Long) As Long


Replace all 'As Long' with 'As Int32', 'lpSecurityAttr ibutes' can be
declared as 'Int32' (...), 'hTemplateFile' as 'IntPtr'. The return
value is an 'IntPtr'.
Private Declare Function closeHandle_ _
Lib "kernel32" _
Alias "CloseHandl e" (ByVal hObject As Long) As Long


Remove the alias, declare its parameter as 'IntPtr' and its return value
as 'Boolean'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>

Nov 20 '05 #3
Bob
For starters you should be converting VB6 longs to VB.Net Int32... not
integer... you have declared a variable that is too small to take the long
datatype value being returned...

Herfield stated this in his reply to your first post...

Cheers
"Stephen Remde" <sp*******@smre mde.co.uk> wrote in message
news:uW******** ******@tk2msftn gp13.phx.gbl...
thanks, that worked...

now heres a tough one:

Private Declare Function NtFsControlFile _
Lib "ntdll.dll" _
(ByVal hFileHandle As Long, _
ByVal hEvent As Long, _
ByRef ApcRoutine As Any, _
ByRef ApcContext As Long, _
ByRef IoStatusBlock As IO_STATUS_BLOCK , _
ByVal FsControlCode As Long, _
ByRef InputBuffer As Any, _
ByVal InputBufferLeng th As Long, _
ByRef OutputBuffer As Any, _
ByVal OutputBufferLen gth As Long) As Long

i've tried

Public Structure IO_STATUS_BLOCK
Public Status As Integer ' (were long's in vb6)
Public Information As Integer
End Structure

Declare Auto Function NtFsControlFile Lib "ntdll.dll" _
(ByVal hFileHandle As Integer, _
ByVal hEvent As Integer, _
ByRef ApcRoutine As Integer, _
ByVal ApcContext As Integer, _
ByRef IoStatusBlock As IO_STATUS_BLOCK , _
ByVal FsControlCode As Integer, _
ByRef InputBuffer As Object, _
ByVal InputBufferLeng th As Integer, _
ByVal OutputBuffer As Object, _
ByRef OutputBufferLen gth As Integer) As Integer

but i get return values of &hC0000023 {Buffer Too Small} The buffer is too
small to contain the entry. No information has been written to the buffer.

so im thinking that theres something wrong ith these lines

ByRef InputBuffer As Object, _
ByVal InputBufferLeng th As Integer, _
ByVal OutputBuffer As Object, _
ByRef OutputBufferLen gth As Integer

the call i am making is

Dim a as Long
Dim b(bSize) as Byte

NtFsControlFile ( ... , ... , ... , ... , ... , ... , a , 8 , b , bSize)

Thanks in advance,
Stephen

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bo******** *****@ID-208219.news.uni-berlin.de...
* "Stephen Remde" <sp*******@smre mde.co.uk> scripsit:
Private Declare Function CreateFile _
Lib "kernel32" Alias "CreateFile A" _


Declare the function as 'Auto' ('Declare Auto Function...'), then remove
the alias.
(ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByVal lpSecurityAttri butes As Any, _
ByVal dwCreationDispo sition As Long, _
ByVal dwFlagsAndAttri butes As Long, _
ByVal hTemplateFile As Long) As Long


Replace all 'As Long' with 'As Int32', 'lpSecurityAttr ibutes' can be
declared as 'Int32' (...), 'hTemplateFile' as 'IntPtr'. The return
value is an 'IntPtr'.
Private Declare Function closeHandle_ _
Lib "kernel32" _
Alias "CloseHandl e" (ByVal hObject As Long) As Long


Remove the alias, declare its parameter as 'IntPtr' and its return value
as 'Boolean'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>


Nov 20 '05 #4
Bob,

VB.NETs Integer's are 32bit, the same as Int32... (se below) exchanging
the Integer types for Int32s make no difference.

i think the problem is with
ByRef InputBuffer As Object, _
ByVal InputBufferLeng th As Integer, _
ByVal OutputBuffer As Object, _
ByRef OutputBufferLen gth As Integer
OutputBuffer - needs to pass a memory pointer to the actual data of the
array. this is where the api call will write its response.

Thanks,

quoted from the msdn
(ms-help://MS.VSCC/MS.MSDNVS/vblr7/html/vadatInteger.ht m):

Integer Data Type

Integer variables are stored as signed 32-bit (4-byte) integers ranging in
value from -2,147,483,648 through 2,147,483,647.

The Integer data type provides optimal performance on a 32-bit processor, as
the smaller integral types are slower to load and store from and to memory.

-snip-

*** The equivalent .NET data type is System.Int32. ***
Stephen
"Bob" <bo*@nospam.com > wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
For starters you should be converting VB6 longs to VB.Net Int32... not
integer... you have declared a variable that is too small to take the long
datatype value being returned...

Herfield stated this in his reply to your first post...

Cheers
"Stephen Remde" <sp*******@smre mde.co.uk> wrote in message
news:uW******** ******@tk2msftn gp13.phx.gbl...
thanks, that worked...

now heres a tough one:

Private Declare Function NtFsControlFile _
Lib "ntdll.dll" _
(ByVal hFileHandle As Long, _
ByVal hEvent As Long, _
ByRef ApcRoutine As Any, _
ByRef ApcContext As Long, _
ByRef IoStatusBlock As IO_STATUS_BLOCK , _
ByVal FsControlCode As Long, _
ByRef InputBuffer As Any, _
ByVal InputBufferLeng th As Long, _
ByRef OutputBuffer As Any, _
ByVal OutputBufferLen gth As Long) As Long

i've tried

Public Structure IO_STATUS_BLOCK
Public Status As Integer ' (were long's in vb6)
Public Information As Integer
End Structure

Declare Auto Function NtFsControlFile Lib "ntdll.dll" _
(ByVal hFileHandle As Integer, _
ByVal hEvent As Integer, _
ByRef ApcRoutine As Integer, _
ByVal ApcContext As Integer, _
ByRef IoStatusBlock As IO_STATUS_BLOCK , _
ByVal FsControlCode As Integer, _
ByRef InputBuffer As Object, _
ByVal InputBufferLeng th As Integer, _
ByVal OutputBuffer As Object, _
ByRef OutputBufferLen gth As Integer) As Integer

but i get return values of &hC0000023 {Buffer Too Small} The buffer is

too small to contain the entry. No information has been written to the buffer.
so im thinking that theres something wrong ith these lines

ByRef InputBuffer As Object, _
ByVal InputBufferLeng th As Integer, _
ByVal OutputBuffer As Object, _
ByRef OutputBufferLen gth As Integer

the call i am making is

Dim a as Long
Dim b(bSize) as Byte

NtFsControlFile ( ... , ... , ... , ... , ... , ... , a , 8 , b , bSize)

Thanks in advance,
Stephen

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bo******** *****@ID-208219.news.uni-berlin.de...
* "Stephen Remde" <sp*******@smre mde.co.uk> scripsit:
> Private Declare Function CreateFile _
> Lib "kernel32" Alias "CreateFile A" _

Declare the function as 'Auto' ('Declare Auto Function...'), then remove the alias.

> (ByVal lpFileName As String, _
> ByVal dwDesiredAccess As Long, _
> ByVal dwShareMode As Long, _
> ByVal lpSecurityAttri butes As Any, _
> ByVal dwCreationDispo sition As Long, _
> ByVal dwFlagsAndAttri butes As Long, _
> ByVal hTemplateFile As Long) As Long

Replace all 'As Long' with 'As Int32', 'lpSecurityAttr ibutes' can be
declared as 'Int32' (...), 'hTemplateFile' as 'IntPtr'. The return
value is an 'IntPtr'.

> Private Declare Function closeHandle_ _
> Lib "kernel32" _
> Alias "CloseHandl e" (ByVal hObject As Long) As Long

Remove the alias, declare its parameter as 'IntPtr' and its return value as 'Boolean'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>



Nov 20 '05 #5
* "Bob" <bo*@nospam.com > scripsit:
For starters you should be converting VB6 longs to VB.Net Int32... not
integer... you have declared a variable that is too small to take the long
datatype value being returned...

Herfield stated this in his reply to your first post...


?!?

In VB.NET 'Integer' = 'System.Int32' (= VB6's 'Long' datatype).

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #6
maybe i converted it to vb6 wrong in the first place. here is the c version:

typedef UINT NTSTATUS;

//
// Io Status block
//
typedef struct _IO_STATUS_BLOC K {
NTSTATUS Status;
ULONG Information;
} IO_STATUS_BLOCK , *PIO_STATUS_BLO CK;
//
// Apc Routine
//
typedef VOID (*PIO_APC_ROUTI NE) (
PVOID ApcContext,
PIO_STATUS_BLOC K IoStatusBlock,
ULONG Reserved
);
//
// The undocumented NtFsControlFile
//

NTSTATUS (__stdcall *NtFsControlFil e)(
HANDLE FileHandle,
HANDLE Event, // optional
PIO_APC_ROUTINE ApcRoutine, // optional
PVOID ApcContext, // optional
PIO_STATUS_BLOC K IoStatusBlock,
ULONG FsControlCode,
PVOID InputBuffer, // optional
ULONG InputBufferLeng th,
PVOID OutputBuffer, // optional
ULONG OutputBufferLen gth
);


"Bob" <bo*@nospam.com > wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
For starters you should be converting VB6 longs to VB.Net Int32... not
integer... you have declared a variable that is too small to take the long
datatype value being returned...

Herfield stated this in his reply to your first post...

Cheers
"Stephen Remde" <sp*******@smre mde.co.uk> wrote in message
news:uW******** ******@tk2msftn gp13.phx.gbl...
thanks, that worked...

now heres a tough one:

Private Declare Function NtFsControlFile _
Lib "ntdll.dll" _
(ByVal hFileHandle As Long, _
ByVal hEvent As Long, _
ByRef ApcRoutine As Any, _
ByRef ApcContext As Long, _
ByRef IoStatusBlock As IO_STATUS_BLOCK , _
ByVal FsControlCode As Long, _
ByRef InputBuffer As Any, _
ByVal InputBufferLeng th As Long, _
ByRef OutputBuffer As Any, _
ByVal OutputBufferLen gth As Long) As Long

i've tried

Public Structure IO_STATUS_BLOCK
Public Status As Integer ' (were long's in vb6)
Public Information As Integer
End Structure

Declare Auto Function NtFsControlFile Lib "ntdll.dll" _
(ByVal hFileHandle As Integer, _
ByVal hEvent As Integer, _
ByRef ApcRoutine As Integer, _
ByVal ApcContext As Integer, _
ByRef IoStatusBlock As IO_STATUS_BLOCK , _
ByVal FsControlCode As Integer, _
ByRef InputBuffer As Object, _
ByVal InputBufferLeng th As Integer, _
ByVal OutputBuffer As Object, _
ByRef OutputBufferLen gth As Integer) As Integer

but i get return values of &hC0000023 {Buffer Too Small} The buffer is too small to contain the entry. No information has been written to the buffer.
so im thinking that theres something wrong ith these lines

ByRef InputBuffer As Object, _
ByVal InputBufferLeng th As Integer, _
ByVal OutputBuffer As Object, _
ByRef OutputBufferLen gth As Integer

the call i am making is

Dim a as Long
Dim b(bSize) as Byte

NtFsControlFile ( ... , ... , ... , ... , ... , ... , a , 8 , b , bSize)

Thanks in advance,
Stephen

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bo******** *****@ID-208219.news.uni-berlin.de...
* "Stephen Remde" <sp*******@smre mde.co.uk> scripsit:
> Private Declare Function CreateFile _
> Lib "kernel32" Alias "CreateFile A" _

Declare the function as 'Auto' ('Declare Auto Function...'), then remove the alias.

> (ByVal lpFileName As String, _
> ByVal dwDesiredAccess As Long, _
> ByVal dwShareMode As Long, _
> ByVal lpSecurityAttri butes As Any, _
> ByVal dwCreationDispo sition As Long, _
> ByVal dwFlagsAndAttri butes As Long, _
> ByVal hTemplateFile As Long) As Long

Replace all 'As Long' with 'As Int32', 'lpSecurityAttr ibutes' can be
declared as 'Int32' (...), 'hTemplateFile' as 'IntPtr'. The return
value is an 'IntPtr'.

> Private Declare Function closeHandle_ _
> Lib "kernel32" _
> Alias "CloseHandl e" (ByVal hObject As Long) As Long

Remove the alias, declare its parameter as 'IntPtr' and its return value as 'Boolean'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>



Nov 20 '05 #7
On 2003-11-09, Stephen Remde <sp*******@smre mde.co.uk> wrote:

Stephen,

Here is my rough, first pass, and untested version :) This is probably
where I would start. If it doesn't work, let me know... And maybe a
little more information about what this function is supposed to do (even
a little project that uses it would be nice) - so that I can refine.
maybe i converted it to vb6 wrong in the first place. here is the c version:

typedef UINT NTSTATUS;

//
// Io Status block
//
typedef struct _IO_STATUS_BLOC K {
NTSTATUS Status;
ULONG Information;
} IO_STATUS_BLOCK , *PIO_STATUS_BLO CK;

<StructLayout(L ayoutKind.Seque ntial)> _
Structure IO_STATUS_BLOCK
Public Status As Integer
Public Information As Integer
End Structure

//
// Apc Routine
//
typedef VOID (*PIO_APC_ROUTI NE) (
PVOID ApcContext,
PIO_STATUS_BLOC K IoStatusBlock,
ULONG Reserved
);


' if you need the call back, it should look something like this
' since the above is defining a pointer to a function that returns
' void and takes 3 parameters...
Delegate Sub PIO_APC_ROUTINE _
(ByVal AbcContext As IntPtr, _
ByRef IoStatusBlock As IO_STATUS_BLOCK , _
ByVal Reserved As Integer)
//
// The undocumented NtFsControlFile
//

NTSTATUS (__stdcall *NtFsControlFil e)(
HANDLE FileHandle,
HANDLE Event, // optional
PIO_APC_ROUTINE ApcRoutine, // optional
PVOID ApcContext, // optional
PIO_STATUS_BLOC K IoStatusBlock,
ULONG FsControlCode,
PVOID InputBuffer, // optional
ULONG InputBufferLeng th,
PVOID OutputBuffer, // optional
ULONG OutputBufferLen gth
);


Declare Function NtFsControlFile Lib "ntdll" _
(ByVal FileHandle As IntPtr, _
ByVal Event As IntPtr, _
ByVal ApcRoutine As PIO_APC_ROUTINE , _
ByVal ApcContext As IntPtr, _
ByRef IoStatusBlock As IO_STATUS_BLOCK , _
ByVal FsControlCode As Integer, _
ByVal InputBuffer() As Byte, _
ByVal InputBufferLeng th As Integer, _
ByVal OutputBuffer() As Byte, _
ByVal OutputBufferLen gth As Integer) As IntPtr

Dim controlCode As Integer
Dim inputBuffer(bSi ze) As Byte
Dim outputBuffer(bS ize) As Byte
Dim controlBlock As IO_STATUS_BLOCK

NtFsControlFile ( _
FileHandle, _
Event, _
Nothing, _
IntPtr.Zero, _
controlBlock, _
controlCode, _
inputBuffer, _
inputBuffer.Len gth, _
outputBuffer, _
outputBuffer.Le ngth)

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #8
You want to create a new file. Try this one in .NET

Imports System.IO; //NAMESPACE

public function SaveFile(string strfile)
dim myStreamWriter as StreamWriter myStreamWriter
myStreamWriter = File.AppendText ("c:/oss_listen.log" )
myStreamWriter. WriteLine(strfi le)
myStreamWriter. Flush()
myStreamWriter. Close()
end function

}
-----Original Message-----
Hi,

Private Declare Function CreateFile _
Lib "kernel32" Alias "CreateFile A" _
(ByVal lpFileName As String, _
ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, _
ByVal lpSecurityAttri butes As Any, _
ByVal dwCreationDispo sition As Long, _
ByVal dwFlagsAndAttri butes As Long, _
ByVal hTemplateFile As Long) As Long

Private Declare Function closeHandle_ _
Lib "kernel32" _
Alias "CloseHandl e" (ByVal hObject As Long) As Long
How to convert these to vb.net - or is there some other way of obtaining afile handle. Well actually its "\\.\C:" i want to get to pass to another apifunction

Stephen
.

Nov 20 '05 #9

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

Similar topics

1
16711
by: Chuck Rittersdorf | last post by:
Hi There I am having a problem using the win32 API from VB6. I am trying to send a command string to a printer(zebra TLP 2742) on LPT1 using the folowing API functions CreateFile and WriteFile I have written C code which works fine, just the VB translation/port
0
1533
by: Joe Kraft | last post by:
I'm hoping someone can help me out. We're running a website that uses XML/XSLT transformations, VB.Net and an Oracle database. Currently the site cannot support more than 6-7 users at a time before the CPU gets pegged at 100% utilization. The XML/XSL document get transformed on the server and averages 200k when it runs through the transformNode method. I've created an IISState log file and noticed the following threads taking up a lot...
4
2772
by: Jim Hubbard | last post by:
I have some C# code that is supposed to wrap the defrag APIs and I am trying to convert it to VB.Net (2003). But, I keep having problems. The C# code is relatively short, so I'll post it here..... -------- // // a set of simple C# wrappers over the NT Defragmenter APIs //
5
2430
by: Jack Black | last post by:
Hi, all!! Using VB.Net and VS/2003. I'm trying to call standard Windows API calls from VB.NET, but keep getting an "Unhandled Exception of type 'System.NotSupportedExtension' occurred in myApp.exe". The call that's failing is CreateFile; all user types have been converted to STRUCTURES, and all ANYs have been converted to a type that is appropriate. Any ideas? I'm sure this is something basic that I'm overlooking... Thanks!
5
2262
by: Andrew Clark | last post by:
Hello, Recently, I converted my VB6 app to VB.NET. I got the standard upgrade messages and fixed them so now I can run my app. I have noticed, though, that some of the library functions will not work in .NET, namely: CreateFile LockFile UnlockFile CloseHandle
5
6330
by: Andrew Clark | last post by:
Hello, Thanks for all replies on this subject. I still cannot get CreateFile to retun a good value though. I went to PInvoke.net and saw the VB.NET declaration of this function: <DllImport("kernel32.dll", SetLastError:=True)> Private Shared Function CreateFile(ByVal lpFileName As String, ByVal dwDesiredAccess As EFileAccess, ByVal dwShareMode As EFileShare, ByVal lpSecurityAttributes As IntPtr, ByVal dwCreationDisposition As...
12
21137
by: Terry Olsen | last post by:
I'm trying to create a disk image of a floppy disk. Since I can't open the device using the system.io methods, i'm trying to use the CreateFile API to get a handle for me. But the call fails (returning a -1). Here's the code: Const GENERIC_READ = &H80000000 Const OPEN_EXISTING = 3 Const FILE_SHARE_READ = &H1 Const FILE_SHARE_WRITE = &H2 Const FILE_ATTRIBUTE_NORMAL = &H80
8
2114
by: news.microsoft.com | last post by:
Hello, i'm having problems to call a api dll in vb dot net. I absolutely want to use this api call and none of the frame calls. This is my declaration: ***************** Public Structure SECURITY_ATTRIBUTES Public nLength As UInt32 Public lpSecurityDescriptor As IntPtr
5
2946
by: Jordi Maycas | last post by:
Could I do something like this with .net 2005? PROGRAM WriteBootSector; VAR DiskSectorsPerTrack, DiskTracksPerHead, DiskHeads : WORD; FUNCTION WriteSector(Sector : WORD; Buffer : POINTER) : BYTE; ASSEMBLER; ASM
2
1266
by: Kerem Gümrükcü | last post by:
Hi all, sorry for Crossposting, but i dont know whether someone can help me here. If i remember right, there was a Class or a Member function in the .NET Framework that could do mostly the same as CreateFile can do for me, but i cant remember its Name. By saying the "same" i mean i was able to use it to open Handles to Devices and anything that could be opened with CreateFile and had a Symbolic Name that has been exported from Kernel...
0
10427
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9995
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5431
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.