473,715 Members | 6,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: share a structure array containing multidimensiona l char array

Hi Willy,

Thank you very much for your work.

C++ code doesnot make any serialization.
So at runtime C# code gives an serialization error at
"msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);"

I thought that it is very hard to memory map structure array.
I need both read and write memory mapped file at both side of C# and C++.
I am looking other ways to share memory between C++ and C#.

Best Regards,
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer

"Willy Denoyette [MVP]" wrote:
Oh, but 256*256 is only 64.000 bytes!

You can declare your structure like this:

[Serializable]
[StructLayout(La youtKind.Sequen tial)]
public struct msg_file_s
{
public byte[,] mb_buffer;
public byte[] other;
}

The "writer" has to serialize the structure data and provide the size of the
total number of bytes in the shared memory segment to the "reader", for
instance as an int value at the start of the MM segment. Without this length
info there is no way to know the size and number of the individual
structures stored in the MM segment.

Then, the reader needs to deserialize the memory buffer as follows:

// pBuf is the pointer that points to the shared memory buffer returned
by the MapViewOfFile Win32 API.

static void GetObjectData2( IntPtr pBuf)
{
// get size of data bytes in MM segment
int len = Marshal.ReadInt 32(pBuf, 0);
// copy the MM data to a managed array
byte[] data = new byte[len];
Marshal.Copy(ne w IntPtr((int)pBu f + sizeof(int)), data, 0, len);
// deserialize the managed byte[] to the struct representation
BinaryFormatter bf = new BinaryFormatter ();
MemoryStream ms = new MemoryStream(da ta);
msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);
// use the array of structs...
foreach(msg_fil e_s s in sa)
{
// use structure data
int x = s.mb_buffer.Get UpperBound(0);
int y = s.mb_buffer.Get UpperBound(1);
...
}

}
}
Willy.
"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:6E******** *************** ***********@mic rosoft.com...
Hi,

My original structure is like shown below
struct msg_file_s
{
unsigned char mb_buffer[256][256];
unsigned char other[64];
};

struct msg_file_s msg_file[16];

This structure will execute on communication dll ( written with C++ ).
Applications will use this dll.
We have not the chance to edit it because we use for several projects for
15
years.
We use this MMF with VC++ 5 / VC++ 6 / BCB 6 on NT4 / 2000 / 2003 / XP.
We do not have any problem.

Best Regards
--
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer

"Willy Denoyette [MVP]" wrote:
"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:13******** *************** ***********@mic rosoft.com...
I want to share a structure array containing multi dimensional char
array
between C# and C++, by using memory mapped file.

I already have C++ code for handling memory mapped file.
I am passing pointer to the structure array as shown below for C++;
I am able to work with pointer ( for C++ ).
C++ code works fine.

I am working on converting code for memory mapped file in C#.
My problems:
1. How should I define structure array in C# ( for the below structure
array
).
2. How should I define pointer to structure array in C# ( for the below
structure array ).

Any help related to this would be highly appreciated.

C++ implementation:

struct msg_file_s
{
unsigned char mb_buffer[1000][1000];
.....
.....
};

struct msg_file_s msg_file[16];
struct msg_file_s *msg_file_ptr;
HANDLE api_map_memory( struct msg_file_s **msg_file_ptr)
{
HANDLE hKernel = CreateFileMappi ng ( (HANDLE) 0xFFFFFFFF,

NULL,

PAGE_READWRITE,
0,

sizeof( struct msg_file_s ),

_T("TEST"));

*msg_file_ptr = (struct msg_file_s *) MapViewOfFile( hKernel,

FILE_MAP_READ | FILE_MAP_WRITE,
0,
0,
0
);
return(hKernel) ;
}
map_memory_file (int index)
{
msg_file_ptr = &msg_file[index];
hKernel = api_map_memory( &msg_file_pt r);
}

/*************** *************** *************** *************** *************** */

C# implementation:

[StructLayout(La youtKind.Sequen tial)]
unsafe struct msg_file_s
{
[MarshalAs(Unman agedType.LPArra y, ArraySubType= UnmanagedType.U 1,
SizeConst = 100, SizeParamIndex= 2)]
byte[,] mb_buffer;
}
--
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer


Are you sure you want to pass such a huge amount of data through Shared
memory (MM file)?
I see in your declaration that one element is already 1000000 bytes, how
large are the other elements? and how large is the array of structures
you
want to share?

Note that passing data through Shared Memory requires a lot more memory
because you'll have to marshal the data from unmanaged memory to managed
memory before you will be able to access the managed presentation of the
unmanaged data. Note that the extra marshaling will reduce the
performance
advantage of the shared memory "transfer" significantly, if not
completely.

Willy.



Jun 27 '08 #1
5 3790
See Inline

Willy.

"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:F6******** *************** ***********@mic rosoft.com...
Hi Willy,

Thank you very much for your work.

C++ code doesnot make any serialization.
Mapping a datastructure, whatever it's type, in a serialization.
So at runtime C# code gives an serialization error at
"msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);"
What error do you get? Note that when mapping a structure to shared memory,
you have to consider the alignment and packing requirements of both readers
and writers if both are wriiten using different languages or compiler tools.
I thought that it is very hard to memory map structure array.
I need both read and write memory mapped file at both side of C# and C++.
I am looking other ways to share memory between C++ and C#.

Best Regards,
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer

"Willy Denoyette [MVP]" wrote:
>Oh, but 256*256 is only 64.000 bytes!

You can declare your structure like this:

[Serializable]
[StructLayout(La youtKind.Sequen tial)]
public struct msg_file_s
{
public byte[,] mb_buffer;
public byte[] other;
}

The "writer" has to serialize the structure data and provide the size of
the
total number of bytes in the shared memory segment to the "reader", for
instance as an int value at the start of the MM segment. Without this
length
info there is no way to know the size and number of the individual
structures stored in the MM segment.

Then, the reader needs to deserialize the memory buffer as follows:

// pBuf is the pointer that points to the shared memory buffer
returned
by the MapViewOfFile Win32 API.

static void GetObjectData2( IntPtr pBuf)
{
// get size of data bytes in MM segment
int len = Marshal.ReadInt 32(pBuf, 0);
// copy the MM data to a managed array
byte[] data = new byte[len];
Marshal.Copy(ne w IntPtr((int)pBu f + sizeof(int)), data, 0,
len);
// deserialize the managed byte[] to the struct representation
BinaryFormatter bf = new BinaryFormatter ();
MemoryStream ms = new MemoryStream(da ta);
msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);
// use the array of structs...
foreach(msg_fil e_s s in sa)
{
// use structure data
int x = s.mb_buffer.Get UpperBound(0);
int y = s.mb_buffer.Get UpperBound(1);
...
}

}
}
Willy.
"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:6E******* *************** ************@mi crosoft.com...
Hi,

My original structure is like shown below
struct msg_file_s
{
unsigned char mb_buffer[256][256];
unsigned char other[64];
};

struct msg_file_s msg_file[16];

This structure will execute on communication dll ( written with C++ ).
Applications will use this dll.
We have not the chance to edit it because we use for several projects
for
15
years.
We use this MMF with VC++ 5 / VC++ 6 / BCB 6 on NT4 / 2000 / 2003 / XP.
We do not have any problem.

Best Regards
--
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer

"Willy Denoyette [MVP]" wrote:

"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:13******* *************** ************@mi crosoft.com...
I want to share a structure array containing multi dimensional char
array
between C# and C++, by using memory mapped file.

I already have C++ code for handling memory mapped file.
I am passing pointer to the structure array as shown below for C++;
I am able to work with pointer ( for C++ ).
C++ code works fine.

I am working on converting code for memory mapped file in C#.
My problems:
1. How should I define structure array in C# ( for the below
structure
array
).
2. How should I define pointer to structure array in C# ( for the
below
structure array ).

Any help related to this would be highly appreciated.

C++ implementation:

struct msg_file_s
{
unsigned char mb_buffer[1000][1000];
.....
.....
};

struct msg_file_s msg_file[16];
struct msg_file_s *msg_file_ptr;
HANDLE api_map_memory( struct msg_file_s **msg_file_ptr)
{
HANDLE hKernel = CreateFileMappi ng ( (HANDLE) 0xFFFFFFFF,

NULL,

PAGE_READWRITE,

0,

sizeof( struct msg_file_s ),

_T("TEST"));

*msg_file_ptr = (struct msg_file_s *) MapViewOfFile( hKernel,

FILE_MAP_READ | FILE_MAP_WRITE,

0,

0,

0
);
return(hKernel) ;
}
map_memory_file (int index)
{
msg_file_ptr = &msg_file[index];
hKernel = api_map_memory( &msg_file_pt r);
}

/*************** *************** *************** *************** *************** */

C# implementation:

[StructLayout(La youtKind.Sequen tial)]
unsafe struct msg_file_s
{
[MarshalAs(Unman agedType.LPArra y, ArraySubType= UnmanagedType.U 1,
SizeConst = 100, SizeParamIndex= 2)]
byte[,] mb_buffer;
}
--
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer


Are you sure you want to pass such a huge amount of data through
Shared
memory (MM file)?
I see in your declaration that one element is already 1000000 bytes,
how
large are the other elements? and how large is the array of structures
you
want to share?

Note that passing data through Shared Memory requires a lot more
memory
because you'll have to marshal the data from unmanaged memory to
managed
memory before you will be able to access the managed presentation of
the
unmanaged data. Note that the extra marshaling will reduce the
performance
advantage of the shared memory "transfer" significantly, if not
completely.

Willy.




Jun 27 '08 #2
Hi Willy,

I am using C++ VS2005 and C# VS2005 compilers.
I write DLL with C++ VS2005. Struct member alignment=1byte .
I write application with C# VS2005.
I am not experienced at C# and dont know how to set structure alignment and
pack size.

Deserialization Error:
An unhandled exception of type
'System.Runtime .Serialization. SerializationEx ception' occurred in mscorlib.dll
Additional information: Binary stream '0' does not contain a valid
BinaryHeader.
Possible causes are invalid stream or object version change between
serialization and deserialization .

Thank you very much for your valuable effort.
Best Regards,
Aykut
"Willy Denoyette [MVP]" wrote:
See Inline

Willy.

"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:F6******** *************** ***********@mic rosoft.com...
Hi Willy,

Thank you very much for your work.

C++ code doesnot make any serialization.

Mapping a datastructure, whatever it's type, in a serialization.
So at runtime C# code gives an serialization error at
"msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);"
What error do you get? Note that when mapping a structure to shared memory,
you have to consider the alignment and packing requirements of both readers
and writers if both are wriiten using different languages or compiler tools.
I thought that it is very hard to memory map structure array.
I need both read and write memory mapped file at both side of C# and C++.
I am looking other ways to share memory between C++ and C#.

Best Regards,
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer

"Willy Denoyette [MVP]" wrote:
Oh, but 256*256 is only 64.000 bytes!

You can declare your structure like this:

[Serializable]
[StructLayout(La youtKind.Sequen tial)]
public struct msg_file_s
{
public byte[,] mb_buffer;
public byte[] other;
}

The "writer" has to serialize the structure data and provide the size of
the
total number of bytes in the shared memory segment to the "reader", for
instance as an int value at the start of the MM segment. Without this
length
info there is no way to know the size and number of the individual
structures stored in the MM segment.

Then, the reader needs to deserialize the memory buffer as follows:

// pBuf is the pointer that points to the shared memory buffer
returned
by the MapViewOfFile Win32 API.

static void GetObjectData2( IntPtr pBuf)
{
// get size of data bytes in MM segment
int len = Marshal.ReadInt 32(pBuf, 0);
// copy the MM data to a managed array
byte[] data = new byte[len];
Marshal.Copy(ne w IntPtr((int)pBu f + sizeof(int)), data, 0,
len);
// deserialize the managed byte[] to the struct representation
BinaryFormatter bf = new BinaryFormatter ();
MemoryStream ms = new MemoryStream(da ta);
msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);
// use the array of structs...
foreach(msg_fil e_s s in sa)
{
// use structure data
int x = s.mb_buffer.Get UpperBound(0);
int y = s.mb_buffer.Get UpperBound(1);
...
}

}
}
Willy.
"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:6E******** *************** ***********@mic rosoft.com...
Hi,

My original structure is like shown below
struct msg_file_s
{
unsigned char mb_buffer[256][256];
unsigned char other[64];
};

struct msg_file_s msg_file[16];

This structure will execute on communication dll ( written with C++ ).
Applications will use this dll.
We have not the chance to edit it because we use for several projects
for
15
years.
We use this MMF with VC++ 5 / VC++ 6 / BCB 6 on NT4 / 2000 / 2003 / XP.
We do not have any problem.

Best Regards
--
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer

"Willy Denoyette [MVP]" wrote:

"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:13******** *************** ***********@mic rosoft.com...
I want to share a structure array containing multi dimensional char
array
between C# and C++, by using memory mapped file.

I already have C++ code for handling memory mapped file.
I am passing pointer to the structure array as shown below for C++;
I am able to work with pointer ( for C++ ).
C++ code works fine.

I am working on converting code for memory mapped file in C#.
My problems:
1. How should I define structure array in C# ( for the below
structure
array
).
2. How should I define pointer to structure array in C# ( for the
below
structure array ).

Any help related to this would be highly appreciated.

C++ implementation:

struct msg_file_s
{
unsigned char mb_buffer[1000][1000];
.....
.....
};

struct msg_file_s msg_file[16];
struct msg_file_s *msg_file_ptr;
HANDLE api_map_memory( struct msg_file_s **msg_file_ptr)
{
HANDLE hKernel = CreateFileMappi ng ( (HANDLE) 0xFFFFFFFF,

NULL,

PAGE_READWRITE,

0,

sizeof( struct msg_file_s ),

_T("TEST"));

*msg_file_ptr = (struct msg_file_s *) MapViewOfFile( hKernel,

FILE_MAP_READ | FILE_MAP_WRITE,

0,

0,

0
);
return(hKernel) ;
}
map_memory_file (int index)
{
msg_file_ptr = &msg_file[index];
hKernel = api_map_memory( &msg_file_pt r);
}

/*************** *************** *************** *************** *************** */

C# implementation:

[StructLayout(La youtKind.Sequen tial)]
unsafe struct msg_file_s
{
[MarshalAs(Unman agedType.LPArra y, ArraySubType= UnmanagedType.U 1,
SizeConst = 100, SizeParamIndex= 2)]
byte[,] mb_buffer;
}
--
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer


Are you sure you want to pass such a huge amount of data through
Shared
memory (MM file)?
I see in your declaration that one element is already 1000000 bytes,
how
large are the other elements? and how large is the array of structures
you
want to share?

Note that passing data through Shared Memory requires a lot more
memory
because you'll have to marshal the data from unmanaged memory to
managed
memory before you will be able to access the managed presentation of
the
unmanaged data. Note that the extra marshaling will reduce the
performance
advantage of the shared memory "transfer" significantly, if not
completely.

Willy.




Jun 27 '08 #3
My original test code is shown below
I may have several errors,

hoping for your help.
Thanks in advance
Aykut

C++ code asis

HANDLE hKernel;
HANDLE hFile;

struct msg_file_s
{
unsigned char mb_buffer[10][10];
};

struct msg_file_s msg_file[16];
struct msg_file_s *msg_file_ptr;

HANDLE gfnInitMemory(s truct msg_file_s **kernel_ram_pt r)
{
hKernel = CreateFileMappi ng ((HANDLE) 0xFFFFFFFF,
NULL,
PAGE_READWRITE,
0,
sizeof( struct msg_file_s ),
_T("TEST"));

if (hKernel != NULL)
{
switch(GetLastE rror())
{
case ERROR_ALREADY_E XISTS : return(FALSE);
case 0 : break;
}
}
else return(NULL);

*kernel_ram_ptr = (struct msg_file_s *)MapViewOfFile ( hKernel,
FILE_MAP_READ | FILE_MAP_WRITE,
0,
0,
0 );

return(hKernel) ;
}
void init_struct()
{
struct msg_file_s *file_ptr;
file_ptr = &msg_file[0];
for(BYTE i=0;i<16;i++,fi le_ptr++)
{
for(BYTE i=0;i<10;i++)
for(BYTE j=0;j<10;j++)
file_ptr->mb_buffer[i][j] = 0x55;
}
}
// create and fill the memory mapped file
test_function()
{
msg_file_ptr = &msg_file[0];
hKernel = NULL;
hKernel = gfnInitMemory(& msg_file_ptr);

if (hKernel == NULL)
{
exit(0);
}

init_struct();
}

/*************** *************** *************** *************** *************** *************** *************/
/*************** *************** *************** *************** *************** *************** *************/
C# Code asis

[Serializable]
[StructLayout(La youtKind.Sequen tial)]
unsafe struct msg_file_s
{
public byte[,] mb_buffer;
}

unsafe msg_file_s[] msg_file = new msg_file_s[16];
IntPtr hFileMap;
IntPtr address;
unsafe IntPtr map_memory_file ()
{
hFileMap = CreateFileMappi ng(InvalidHandl eValue, IntPtr.Zero,
PAGE_READWRITE, 0, 100, "TEST");
if (hFileMap == IntPtr.Zero)
{
MessageBox.Show ("hFileMap olmadı");
return IntPtr.Zero;
}

address = MapViewOfFile(h FileMap, FILE_MAP_WRITE, 0, 0, IntPtr.Zero);
if (address == IntPtr.Zero)
{
MessageBox.Show ("address olmadı");
return IntPtr.Zero;
}

return address;
}
unsafe static void GetObjectData2( IntPtr pBuf)
{
// set size of data bytes in MM segment manually
int len = 100;

// copy the MM data to a managed array
byte[] data = new byte[len];
Marshal.Copy(pB uf, data, 0, len);

// deserialize the managed byte[] to the struct representation
BinaryFormatter bf = new BinaryFormatter ();
MemoryStream ms = new MemoryStream(da ta);
msg_file_s[] sa = (msg_file_s[])bf.Deserialize (ms);

// just a test to show
int x = sa[0].mb_buffer.GetU pperBound(0);
MessageBox.Show (x.ToString());

}

// test access memory mapped file
private void button1_Click(o bject sender, EventArgs e)
{
address = map_memory_file ();
GetObjectData2( address);
}
"Aykut Ergin" wrote:
Hi Willy,

I am using C++ VS2005 and C# VS2005 compilers.
I write DLL with C++ VS2005. Struct member alignment=1byte .
I write application with C# VS2005.
I am not experienced at C# and dont know how to set structure alignment and
pack size.

Deserialization Error:
An unhandled exception of type
'System.Runtime .Serialization. SerializationEx ception' occurred in mscorlib.dll
Additional information: Binary stream '0' does not contain a valid
BinaryHeader.
Possible causes are invalid stream or object version change between
serialization and deserialization .

Thank you very much for your valuable effort.
Best Regards,
Aykut
"Willy Denoyette [MVP]" wrote:
See Inline

Willy.

"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:F6******** *************** ***********@mic rosoft.com...
Hi Willy,
>
Thank you very much for your work.
>
C++ code doesnot make any serialization.
Mapping a datastructure, whatever it's type, in a serialization.
So at runtime C# code gives an serialization error at
"msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);"
>
What error do you get? Note that when mapping a structure to shared memory,
you have to consider the alignment and packing requirements of both readers
and writers if both are wriiten using different languages or compiler tools.
I thought that it is very hard to memory map structure array.
I need both read and write memory mapped file at both side of C# and C++.
I am looking other ways to share memory between C++ and C#.
>
Best Regards,
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer
>
>
>
"Willy Denoyette [MVP]" wrote:
>
>Oh, but 256*256 is only 64.000 bytes!
>>
>You can declare your structure like this:
>>
> [Serializable]
> [StructLayout(La youtKind.Sequen tial)]
> public struct msg_file_s
> {
> public byte[,] mb_buffer;
> public byte[] other;
> }
>>
>The "writer" has to serialize the structure data and provide the size of
>the
>total number of bytes in the shared memory segment to the "reader", for
>instance as an int value at the start of the MM segment. Without this
>length
>info there is no way to know the size and number of the individual
>structures stored in the MM segment.
>>
>Then, the reader needs to deserialize the memory buffer as follows:
>>
> // pBuf is the pointer that points to the shared memory buffer
>returned
>by the MapViewOfFile Win32 API.
>>
> static void GetObjectData2( IntPtr pBuf)
> {
> // get size of data bytes in MM segment
> int len = Marshal.ReadInt 32(pBuf, 0);
> // copy the MM data to a managed array
> byte[] data = new byte[len];
> Marshal.Copy(ne w IntPtr((int)pBu f + sizeof(int)), data, 0,
>len);
> // deserialize the managed byte[] to the struct representation
> BinaryFormatter bf = new BinaryFormatter ();
> MemoryStream ms = new MemoryStream(da ta);
> msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);
> // use the array of structs...
> foreach(msg_fil e_s s in sa)
> {
> // use structure data
> int x = s.mb_buffer.Get UpperBound(0);
> int y = s.mb_buffer.Get UpperBound(1);
> ...
> }
>>
> }
> }
>>
>>
>Willy.
>>
>>
>"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
>news:6E******* *************** ************@mi crosoft.com...
Hi,
>
My original structure is like shown below
struct msg_file_s
{
unsigned char mb_buffer[256][256];
unsigned char other[64];
};
>
struct msg_file_s msg_file[16];
>
This structure will execute on communication dll ( written with C++ ).
Applications will use this dll.
We have not the chance to edit it because we use for several projects
for
15
years.
We use this MMF with VC++ 5 / VC++ 6 / BCB 6 on NT4 / 2000 / 2003 / XP.
We do not have any problem.
>
Best Regards
--
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer
>
>
>
"Willy Denoyette [MVP]" wrote:
>
>"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
>news:13******* *************** ************@mi crosoft.com...
>I want to share a structure array containing multi dimensional char
>array
between C# and C++, by using memory mapped file.
>
I already have C++ code for handling memory mapped file.
I am passing pointer to the structure array as shown below for C++;
I am able to work with pointer ( for C++ ).
C++ code works fine.
>
I am working on converting code for memory mapped file in C#.
My problems:
1. How should I define structure array in C# ( for the below
structure
array
).
2. How should I define pointer to structure array in C# ( for the
below
structure array ).
>
Any help related to this would be highly appreciated.
>
C++ implementation:
>
struct msg_file_s
{
unsigned char mb_buffer[1000][1000];
.....
.....
};
>
struct msg_file_s msg_file[16];
struct msg_file_s *msg_file_ptr;
>
>
HANDLE api_map_memory( struct msg_file_s **msg_file_ptr)
{
HANDLE hKernel = CreateFileMappi ng ( (HANDLE) 0xFFFFFFFF,
>
NULL,
>
PAGE_READWRITE,
>
0,
>
sizeof( struct msg_file_s ),
>
_T("TEST"));
>
*msg_file_ptr = (struct msg_file_s *) MapViewOfFile( hKernel,
>
FILE_MAP_READ | FILE_MAP_WRITE,
>
0,
>
0,
>
0
);
return(hKernel) ;
}
>
>
map_memory_file (int index)
{
msg_file_ptr = &msg_file[index];
hKernel = api_map_memory( &msg_file_pt r);
}
>
/*************** *************** *************** *************** *************** */
>
C# implementation:
>
[StructLayout(La youtKind.Sequen tial)]
unsafe struct msg_file_s
{
[MarshalAs(Unman agedType.LPArra y, ArraySubType= UnmanagedType.U 1,
SizeConst = 100, SizeParamIndex= 2)]
byte[,] mb_buffer;
}
>
>
--
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer
>
>>
>>
>>
>Are you sure you want to pass such a huge amount of data through
>Shared
>memory (MM file)?
>I see in your declaration that one element is already 1000000 bytes,
>how
>large are the other elements? and how large is the array of structures
>you
>want to share?
>>
>Note that passing data through Shared Memory requires a lot more
>memory
>because you'll have to marshal the data from unmanaged memory to
>managed
>memory before you will be able to access the managed presentation of
>the
>unmanaged data. Note that the extra marshaling will reduce the
>performance
>advantage of the shared memory "transfer" significantly, if not
>completely.
>>
>Willy.
>>
>>
>>
>>
>>
>>
>>
Jun 27 '08 #4
Oh I see, you aren't 'serializing' the structure to shared memory, I guess I
wasn't clear when I said "the writer has to serialize...".

When you want to deserialize/serialize a managed type to/from unmanaged
memory, you have to use the same serializer/deserializer at both sides, that
means you also need to use .NET to serialize/deserialize at the C++ side.
For this you can use C++/CLI (VS2006 or VS2008) and compile your C++ program
using /clr.

If you don't want to use .NET at the C++ side, you'll have to "custom"
serialize, that means you'll have to copy the array of structures to the
buffer obtained by MapViewOfFile. Besides the structures, you also have to
store the number of structures serialized to the shared memory buffer and
the size of the individual structure members, without this info it's
impossible for the reader to determine the number of array members (number
of structs) and the size of the structure members.

Willy.

"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:9F******** *************** ***********@mic rosoft.com...
My original test code is shown below
I may have several errors,

hoping for your help.
Thanks in advance
Aykut

C++ code asis

HANDLE hKernel;
HANDLE hFile;

struct msg_file_s
{
unsigned char mb_buffer[10][10];
};

struct msg_file_s msg_file[16];
struct msg_file_s *msg_file_ptr;

HANDLE gfnInitMemory(s truct msg_file_s **kernel_ram_pt r)
{
hKernel = CreateFileMappi ng ((HANDLE) 0xFFFFFFFF,
NULL,
PAGE_READWRITE,
0,
sizeof( struct msg_file_s ),
_T("TEST"));

if (hKernel != NULL)
{
switch(GetLastE rror())
{
case ERROR_ALREADY_E XISTS : return(FALSE);
case 0 : break;
}
}
else return(NULL);

*kernel_ram_ptr = (struct msg_file_s *)MapViewOfFile ( hKernel,
FILE_MAP_READ | FILE_MAP_WRITE,
0,
0,
0 );

return(hKernel) ;
}
void init_struct()
{
struct msg_file_s *file_ptr;
file_ptr = &msg_file[0];
for(BYTE i=0;i<16;i++,fi le_ptr++)
{
for(BYTE i=0;i<10;i++)
for(BYTE j=0;j<10;j++)
file_ptr->mb_buffer[i][j] = 0x55;
}
}
// create and fill the memory mapped file
test_function()
{
msg_file_ptr = &msg_file[0];
hKernel = NULL;
hKernel = gfnInitMemory(& msg_file_ptr);

if (hKernel == NULL)
{
exit(0);
}

init_struct();
}

/*************** *************** *************** *************** *************** *************** *************/
/*************** *************** *************** *************** *************** *************** *************/
C# Code asis

[Serializable]
[StructLayout(La youtKind.Sequen tial)]
unsafe struct msg_file_s
{
public byte[,] mb_buffer;
}

unsafe msg_file_s[] msg_file = new msg_file_s[16];
IntPtr hFileMap;
IntPtr address;
unsafe IntPtr map_memory_file ()
{
hFileMap = CreateFileMappi ng(InvalidHandl eValue, IntPtr.Zero,
PAGE_READWRITE, 0, 100, "TEST");
if (hFileMap == IntPtr.Zero)
{
MessageBox.Show ("hFileMap olmadı");
return IntPtr.Zero;
}

address = MapViewOfFile(h FileMap, FILE_MAP_WRITE, 0, 0, IntPtr.Zero);
if (address == IntPtr.Zero)
{
MessageBox.Show ("address olmadı");
return IntPtr.Zero;
}

return address;
}
unsafe static void GetObjectData2( IntPtr pBuf)
{
// set size of data bytes in MM segment manually
int len = 100;

// copy the MM data to a managed array
byte[] data = new byte[len];
Marshal.Copy(pB uf, data, 0, len);

// deserialize the managed byte[] to the struct representation
BinaryFormatter bf = new BinaryFormatter ();
MemoryStream ms = new MemoryStream(da ta);
msg_file_s[] sa = (msg_file_s[])bf.Deserialize (ms);

// just a test to show
int x = sa[0].mb_buffer.GetU pperBound(0);
MessageBox.Show (x.ToString());

}

// test access memory mapped file
private void button1_Click(o bject sender, EventArgs e)
{
address = map_memory_file ();
GetObjectData2( address);
}
"Aykut Ergin" wrote:
>Hi Willy,

I am using C++ VS2005 and C# VS2005 compilers.
I write DLL with C++ VS2005. Struct member alignment=1byte .
I write application with C# VS2005.
I am not experienced at C# and dont know how to set structure alignment
and
pack size.

Deserializatio n Error:
An unhandled exception of type
'System.Runtim e.Serialization .SerializationE xception' occurred in
mscorlib.dll
Additional information: Binary stream '0' does not contain a valid
BinaryHeader .
Possible causes are invalid stream or object version change between
serializatio n and deserialization .

Thank you very much for your valuable effort.
Best Regards,
Aykut
"Willy Denoyette [MVP]" wrote:
See Inline

Willy.

"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:F6******** *************** ***********@mic rosoft.com...
Hi Willy,

Thank you very much for your work.

C++ code doesnot make any serialization.

Mapping a datastructure, whatever it's type, in a serialization.

So at runtime C# code gives an serialization error at
"msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);"

What error do you get? Note that when mapping a structure to shared
memory,
you have to consider the alignment and packing requirements of both
readers
and writers if both are wriiten using different languages or compiler
tools.

I thought that it is very hard to memory map structure array.
I need both read and write memory mapped file at both side of C# and
C++.
I am looking other ways to share memory between C++ and C#.

Best Regards,
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer

"Willy Denoyette [MVP]" wrote:

Oh, but 256*256 is only 64.000 bytes!

You can declare your structure like this:

[Serializable]
[StructLayout(La youtKind.Sequen tial)]
public struct msg_file_s
{
public byte[,] mb_buffer;
public byte[] other;
}

The "writer" has to serialize the structure data and provide the
size of
the
total number of bytes in the shared memory segment to the "reader",
for
instance as an int value at the start of the MM segment. Without
this
length
info there is no way to know the size and number of the individual
structures stored in the MM segment.

Then, the reader needs to deserialize the memory buffer as follows:

// pBuf is the pointer that points to the shared memory buffer
returned
by the MapViewOfFile Win32 API.

static void GetObjectData2( IntPtr pBuf)
{
// get size of data bytes in MM segment
int len = Marshal.ReadInt 32(pBuf, 0);
// copy the MM data to a managed array
byte[] data = new byte[len];
Marshal.Copy(ne w IntPtr((int)pBu f + sizeof(int)), data, 0,
len);
// deserialize the managed byte[] to the struct
representati on
BinaryFormatter bf = new BinaryFormatter ();
MemoryStream ms = new MemoryStream(da ta);
msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);
// use the array of structs...
foreach(msg_fil e_s s in sa)
{
// use structure data
int x = s.mb_buffer.Get UpperBound(0);
int y = s.mb_buffer.Get UpperBound(1);
...
}

}
}
Willy.
"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in
message
news:6E******* *************** ************@mi crosoft.com...
Hi,

My original structure is like shown below
struct msg_file_s
{
unsigned char mb_buffer[256][256];
unsigned char other[64];
};

struct msg_file_s msg_file[16];

This structure will execute on communication dll ( written with
C++ ).
Applications will use this dll.
We have not the chance to edit it because we use for several
projects
for
15
years.
We use this MMF with VC++ 5 / VC++ 6 / BCB 6 on NT4 / 2000 / 2003
/ XP.
We do not have any problem.

Best Regards
--
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer

"Willy Denoyette [MVP]" wrote:

"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in
message
news:13******* *************** ************@mi crosoft.com...
I want to share a structure array containing multi dimensional
char
array
between C# and C++, by using memory mapped file.

I already have C++ code for handling memory mapped file.
I am passing pointer to the structure array as shown below for
C++;
I am able to work with pointer ( for C++ ).
C++ code works fine.

I am working on converting code for memory mapped file in C#.
My problems:
1. How should I define structure array in C# ( for the below
structure
array
).
2. How should I define pointer to structure array in C# ( for
the
below
structure array ).

Any help related to this would be highly appreciated.

C++ implementation:

struct msg_file_s
{
unsigned char mb_buffer[1000][1000];
.....
.....
};

struct msg_file_s msg_file[16];
struct msg_file_s *msg_file_ptr;
HANDLE api_map_memory( struct msg_file_s **msg_file_ptr)
{
HANDLE hKernel = CreateFileMappi ng ( (HANDLE) 0xFFFFFFFF,

NULL,

PAGE_READWRITE,

0,

sizeof( struct msg_file_s ),

_T("TEST"));

*msg_file_ptr = (struct msg_file_s *) MapViewOfFile( hKernel,

FILE_MAP_READ | FILE_MAP_WRITE,

0,

0,

0
);
return(hKernel) ;
}
map_memory_file (int index)
{
msg_file_ptr = &msg_file[index];
hKernel = api_map_memory( &msg_file_pt r);
}

/*************** *************** *************** *************** *************** */

C# implementation:

[StructLayout(La youtKind.Sequen tial)]
unsafe struct msg_file_s
{
[MarshalAs(Unman agedType.LPArra y, ArraySubType=
UnmanagedType.U 1,
SizeConst = 100, SizeParamIndex= 2)]
byte[,] mb_buffer;
}
--
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer


Are you sure you want to pass such a huge amount of data through
Shared
memory (MM file)?
I see in your declaration that one element is already 1000000
bytes,
how
large are the other elements? and how large is the array of
structures
you
want to share?

Note that passing data through Shared Memory requires a lot more
memory
because you'll have to marshal the data from unmanaged memory to
managed
memory before you will be able to access the managed presentation
of
the
unmanaged data. Note that the extra marshaling will reduce the
performance
advantage of the shared memory "transfer" significantly, if not
completely.

Willy.




Jun 27 '08 #5
Hi Willy,

Thank you very much for your help.
I will try your solution for C++.

Kind Regards,
Aykut
"Willy Denoyette [MVP]" wrote:
Oh I see, you aren't 'serializing' the structure to shared memory, I guess I
wasn't clear when I said "the writer has to serialize...".

When you want to deserialize/serialize a managed type to/from unmanaged
memory, you have to use the same serializer/deserializer at both sides, that
means you also need to use .NET to serialize/deserialize at the C++ side.
For this you can use C++/CLI (VS2006 or VS2008) and compile your C++ program
using /clr.

If you don't want to use .NET at the C++ side, you'll have to "custom"
serialize, that means you'll have to copy the array of structures to the
buffer obtained by MapViewOfFile. Besides the structures, you also have to
store the number of structures serialized to the shared memory buffer and
the size of the individual structure members, without this info it's
impossible for the reader to determine the number of array members (number
of structs) and the size of the structure members.

Willy.

"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:9F******** *************** ***********@mic rosoft.com...
My original test code is shown below
I may have several errors,

hoping for your help.
Thanks in advance
Aykut

C++ code asis

HANDLE hKernel;
HANDLE hFile;

struct msg_file_s
{
unsigned char mb_buffer[10][10];
};

struct msg_file_s msg_file[16];
struct msg_file_s *msg_file_ptr;

HANDLE gfnInitMemory(s truct msg_file_s **kernel_ram_pt r)
{
hKernel = CreateFileMappi ng ((HANDLE) 0xFFFFFFFF,
NULL,
PAGE_READWRITE,
0,
sizeof( struct msg_file_s ),
_T("TEST"));

if (hKernel != NULL)
{
switch(GetLastE rror())
{
case ERROR_ALREADY_E XISTS : return(FALSE);
case 0 : break;
}
}
else return(NULL);

*kernel_ram_ptr = (struct msg_file_s *)MapViewOfFile ( hKernel,
FILE_MAP_READ | FILE_MAP_WRITE,
0,
0,
0 );

return(hKernel) ;
}
void init_struct()
{
struct msg_file_s *file_ptr;
file_ptr = &msg_file[0];
for(BYTE i=0;i<16;i++,fi le_ptr++)
{
for(BYTE i=0;i<10;i++)
for(BYTE j=0;j<10;j++)
file_ptr->mb_buffer[i][j] = 0x55;
}
}
// create and fill the memory mapped file
test_function()
{
msg_file_ptr = &msg_file[0];
hKernel = NULL;
hKernel = gfnInitMemory(& msg_file_ptr);

if (hKernel == NULL)
{
exit(0);
}

init_struct();
}

/*************** *************** *************** *************** *************** *************** *************/
/*************** *************** *************** *************** *************** *************** *************/
C# Code asis

[Serializable]
[StructLayout(La youtKind.Sequen tial)]
unsafe struct msg_file_s
{
public byte[,] mb_buffer;
}

unsafe msg_file_s[] msg_file = new msg_file_s[16];
IntPtr hFileMap;
IntPtr address;
unsafe IntPtr map_memory_file ()
{
hFileMap = CreateFileMappi ng(InvalidHandl eValue, IntPtr.Zero,
PAGE_READWRITE, 0, 100, "TEST");
if (hFileMap == IntPtr.Zero)
{
MessageBox.Show ("hFileMap olmadı");
return IntPtr.Zero;
}

address = MapViewOfFile(h FileMap, FILE_MAP_WRITE, 0, 0, IntPtr.Zero);
if (address == IntPtr.Zero)
{
MessageBox.Show ("address olmadı");
return IntPtr.Zero;
}

return address;
}
unsafe static void GetObjectData2( IntPtr pBuf)
{
// set size of data bytes in MM segment manually
int len = 100;

// copy the MM data to a managed array
byte[] data = new byte[len];
Marshal.Copy(pB uf, data, 0, len);

// deserialize the managed byte[] to the struct representation
BinaryFormatter bf = new BinaryFormatter ();
MemoryStream ms = new MemoryStream(da ta);
msg_file_s[] sa = (msg_file_s[])bf.Deserialize (ms);

// just a test to show
int x = sa[0].mb_buffer.GetU pperBound(0);
MessageBox.Show (x.ToString());

}

// test access memory mapped file
private void button1_Click(o bject sender, EventArgs e)
{
address = map_memory_file ();
GetObjectData2( address);
}
"Aykut Ergin" wrote:
Hi Willy,

I am using C++ VS2005 and C# VS2005 compilers.
I write DLL with C++ VS2005. Struct member alignment=1byte .
I write application with C# VS2005.
I am not experienced at C# and dont know how to set structure alignment
and
pack size.

Deserialization Error:
An unhandled exception of type
'System.Runtime .Serialization. SerializationEx ception' occurred in
mscorlib.dll
Additional information: Binary stream '0' does not contain a valid
BinaryHeader.
Possible causes are invalid stream or object version change between
serialization and deserialization .

Thank you very much for your valuable effort.
Best Regards,
Aykut
"Willy Denoyette [MVP]" wrote:

See Inline

Willy.

"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in message
news:F6******** *************** ***********@mic rosoft.com...
Hi Willy,
>
Thank you very much for your work.
>
C++ code doesnot make any serialization.

Mapping a datastructure, whatever it's type, in a serialization.

So at runtime C# code gives an serialization error at
"msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);"
>
What error do you get? Note that when mapping a structure to shared
memory,
you have to consider the alignment and packing requirements of both
readers
and writers if both are wriiten using different languages or compiler
tools.

I thought that it is very hard to memory map structure array.
I need both read and write memory mapped file at both side of C# and
C++.
I am looking other ways to share memory between C++ and C#.
>
Best Regards,
Aykut ERGÄ°N
Nortel NetaÅŸ
Software Design Engineer
>
>
>
"Willy Denoyette [MVP]" wrote:
>
>Oh, but 256*256 is only 64.000 bytes!
>>
>You can declare your structure like this:
>>
> [Serializable]
> [StructLayout(La youtKind.Sequen tial)]
> public struct msg_file_s
> {
> public byte[,] mb_buffer;
> public byte[] other;
> }
>>
>The "writer" has to serialize the structure data and provide the
>size of
>the
>total number of bytes in the shared memory segment to the "reader",
>for
>instance as an int value at the start of the MM segment. Without
>this
>length
>info there is no way to know the size and number of the individual
>structures stored in the MM segment.
>>
>Then, the reader needs to deserialize the memory buffer as follows:
>>
> // pBuf is the pointer that points to the shared memory buffer
>returned
>by the MapViewOfFile Win32 API.
>>
> static void GetObjectData2( IntPtr pBuf)
> {
> // get size of data bytes in MM segment
> int len = Marshal.ReadInt 32(pBuf, 0);
> // copy the MM data to a managed array
> byte[] data = new byte[len];
> Marshal.Copy(ne w IntPtr((int)pBu f + sizeof(int)), data, 0,
>len);
> // deserialize the managed byte[] to the struct
>representati on
> BinaryFormatter bf = new BinaryFormatter ();
> MemoryStream ms = new MemoryStream(da ta);
> msg_file_s[] sa = (msg_file_s[]) bf.Deserialize( ms);
> // use the array of structs...
> foreach(msg_fil e_s s in sa)
> {
> // use structure data
> int x = s.mb_buffer.Get UpperBound(0);
> int y = s.mb_buffer.Get UpperBound(1);
> ...
> }
>>
> }
> }
>>
>>
>Willy.
>>
>>
>"Aykut Ergin" <Ay********@dis cussions.micros oft.comwrote in
>message
>news:6E******* *************** ************@mi crosoft.com...
Hi,
>
My original structure is like shown below
struct msg_file_s
{
unsigned char mb_buffer[256][256];
unsigned char other[64];
};
>
Jun 27 '08 #6

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

Similar topics

15
2455
by: M.Siler | last post by:
<HTML> <HEAD> <TITLE></TITLE> <SCRIPT> <!-- var factor_val = new Array(8,7) factor_val = 68.8 factor_val = 55
2
6957
by: shane | last post by:
Ive searched a fair bit for the answer, but nothing has come up that matches what i want to do. I'm having an issue with passing and assigning pointers to multidimensional arrays. The code: /*.....*/ TCHAR msg func(msg); /*.....*/
6
4203
by: Eric Smith | last post by:
Is a structure containing an incomplete array as its last element (per paragraph 2 of section 6.7.2.1 of ISO/IEC 9899:1999 (E)) itself an incomplete type? That appears to be indicated by paragraph 22 of section 6.2.5. If so, that seems to make it difficult to allocate such structures, because sizeof() is not allowed on incomplete types (paragraph 1 of section 6.5.3.4). For instance, I've routinely done things like this: struct foo {...
9
2618
by: buda | last post by:
Hi, I've been wondering for a while now (and always forgot to ask :) what is the exact quote from the Standard that forbids the use of (&array) (when x >= number_of_columns) as stated in the FAQ 6.19 (http://www.eskimo.com/~scs/C-faq/q6.19.html). Thanks.
2
11950
by: vikas | last post by:
I have following structure in c++. typedef struct MMF_result_struct { int action; char text; int cols,rows; int month,day,year; } MMF_result; Now this structure is shared between C++ and C# using memory mapped file. We already have C++ code for handling memory mapped file. I am working on converting code for memory mapped file in C#. Now I have to pass pointer to the above structure. I converted this structure to C# as follows:
10
2126
by: nambissan.nisha | last post by:
I am facing this problem.... I have to define a structure at runtime as the user specifies... The user will tell the number of fields,the actual fields...(maybe basic or array types or multiple arrays,etc) I do not understand how to define the structure at run time.i.e.what fields it will contain.
10
12208
by: | last post by:
I'm fairly new to ASP and must admit its proving a lot more unnecessarily complicated than the other languages I know. I feel this is because there aren't many good official resources out there to help do the most basic things. One of the "basic" things I haven't been able to find out how to do is how to delete an item from a multidimensional array object and resize it afterwards. It seems so easy to conceive of the code to delete...
10
4993
by: David Fort | last post by:
Hi, I'm upgrading a VB6 app to VB.net and I'm having a problem with a call to a function provided in a DLL. The function takes the address of a structure which it will fill in with values. I get an error: ---------------- An unhandled exception of type 'System.NullReferenceException' occured in
2
2286
by: ...vagrahb | last post by:
I am having accessing individual rows from a multidimensional array pass to a function as reference CODE: function Declaration int Part_Buffer(char (*buffer),int Low, int High)
0
8823
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8718
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9343
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...
1
9104
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9047
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...
1
6646
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
4477
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...
2
2541
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2119
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.