Visual Basic - FILEMAP, ayuda visual basic 6

Life is soft - evento anual de software empresarial
 
Vista:
sin imagen de perfil
Val: 1
Ha disminuido su posición en 37 puestos en Visual Basic (en relación al último mes)
Gráfica de Visual Basic

FILEMAP, ayuda visual basic 6

Publicado por pol (1 intervención) el 03/10/2019 02:14:35
Buenas Tardes:
Necsito comunicar un SCADA y un aplicacion realizada en Visual Basic 6. Actualmente se pueden comunicar usando un filmaping, pero debo reemplzar ese filemaping.
Ando buscando alguien que me ayude a hacer este nuevo filemaping y tenga conocimientos en visaual Basic. (E filemaping esta hecho en c , creo)
Estoy dispuesto a pagar por este servicio. Favor d econtactarme por mail a [email protected]
Este es el código

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* **********************************************************************************
 *
 *
 *
 *
 *
 *
 *
 ***********************************************************************************/
 
# include <windows.h>
# include "SimcotMap.h"
# include <stdio.h>
 
HANDLE			hFileMap;
TipoValores		*hValor;
 
/* ***************************************************************************
 *
 *
 *
 *
 *****************************************************************************/
long 	 _declspec(dllexport) _stdcall AbrirMapFile ()
{
 
  long			ErrorCode;
  char			NomFitxer[50]="DbsMap";
 
 /* Creamos el "file mapping"
  */
  hFileMap = CreateFileMapping ( (HANDLE) 0xFFFFFFFF,
    							   (LPSECURITY_ATTRIBUTES) NULL,
								   PAGE_READWRITE,
								   0,
								   sizeof(TipoValores),
								   NomFitxer);
 
 
   if (hFileMap == NULL ) ErrorCode = GetLastError ();
   else
   {
	   /* Nos mapeamos el fichero
		*/
		hValor = (TipoValores *) MapViewOfFile (
									hFileMap,
									FILE_MAP_READ | FILE_MAP_WRITE,
									0,0,0);
 
		if (hValor == NULL) ErrorCode = GetLastError ();
		else
		{
			ErrorCode		= NO_ERROR;
		}
	}
 
	return (ErrorCode);
}
 
/* ***************************************************************************
 *
 *
 *
 *
 *****************************************************************************/
long	 _declspec(dllexport)  _stdcall CerrarMapFile ()
{
 
	FlushViewOfFile( hValor,66);
	UnmapViewOfFile( hValor);
	CloseHandle (hFileMap);
 
	return NO_ERROR;
}
 
/* ***************************************************************************
 *
 *
 *
 *
 *****************************************************************************/
long	 _declspec(dllexport)   _stdcall EscMapInt (short Idx, long Valor)
{
 
	hValor->Entero[Idx] = Valor;
 
	return NO_ERROR;
}
 
/* ***************************************************************************
 *
 *
 *
 *
 *****************************************************************************/
long	 _declspec(dllexport)  _stdcall LeerMapInt (short Idx)
{
 
	long	Valor;
 
	Valor = hValor->Entero[Idx];
 
	return Valor;
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder