Foros del Web » Programación para mayores de 30 ;) » Programación General » Visual Basic clásico »

Dll Cameo/Marplot

Estas en el tema de Dll Cameo/Marplot en el foro de Visual Basic clásico en Foros del Web. Hola. queria saber si alguien me podria decir cuales son los parametros de un dll, el cual esta detallado aqui abajo, el problema que tengo ...
  #1 (permalink)  
Antiguo 19/04/2006, 16:02
 
Fecha de Ingreso: abril-2006
Mensajes: 1
Antigüedad: 18 años
Puntos: 0
Pregunta Dll Cameo/Marplot

Hola. queria saber si alguien me podria decir cuales son los parametros de un dll, el cual esta detallado aqui abajo, el problema que tengo es que esta en otro lenguaje y no lo entiendo, lo necesitaria declarar en Visual Basic 6.
Código y Descripción:
Mechanism used by 16-bit applications that communicate via the NOAA16 DLL
To start: The file NOAA_16.DLL must be in the path. Load the NOAA16 DLL and register with it by calling its NERegister() function. For example, here is how an application named ALOHA, with signature ALH5 , would register:
HINSTANCE gNOAADLLInst = NULL;
void CallNERegister(void) // 16 bit version
{
char fullPath[256];
FARPROC proc=NULL;
if (gNOAADLLInst == NULL)
gNOAADLLInst = LoadLibrary("NOAA_16.DLL");
if ((UINT)gNOAADLLInst > 32) // we have the library
if (proc = GetProcAddress(gNoaaDllInst, "NERegister"))
{
GetPathToMe(fullPath); // path (incl. EXE file)
(*proc)((Ptr)"ALH5", // signature
(HWND)myMainWnd, // window handle
(Ptr)myMainClassName, // window class
(Ptr)NULL, // reserved for future use
(Ptr)"ALOHA", // “human readable” app name
(Ptr)"ALOHA.exe", // EXE file name
(Ptr)fullPath, // the last three parameters specify the
// window message (including wParam and
// lParam) that you want the DLL to send
// to your application when it has an IAC
// message for it
(UINT)WM_MY_WAKEUP, (WORD)0, (LONG)0);
}
}

To send a message: First make sure the receiving application is running. If not, launch it. Then:
Boolean CallNESendMessage(Ptr toSignature, Ptr messageStr) // 16 bit{ FARPROC proc; long err = -1;
if ((UINT)gNOAADLLInst > 32) { // we have the library
proc = GetProcAddress(gNOAADLLInst,"NESendMessage");
if (proc) err = (*proc)(toSignature, // signature of receiver
messageStr, // the message string
FALSE, // reserved for future use
NULL, // reserved for future use NULL);
// reserved for future use
return err == 0;
}

To receive a message:
In your WndProc(), check for WM_MY_WAKEUP messages (whatever message you sent asthe eighth parameter to NERegister()). When this message is received:
Boolean HandleNEMessage(void) // 16 bit version
{FARPROC proc;
Ptr message;
long len, maxLength;
if (gNOAADLLInst == NULL)
gNOAADLLInst = LoadLibrary(gDllFileName);
if ((UINT)gNOAADLLInst <= 32) // we do not have the library return FALSE;
if (!(proc = GetProcAddress(gNOAADLLInst, "NEGetNextMessageLength")))
return FALSE;
if ((len = (long)(*proc)((Ptr)"ALH5")) <= 0)
return FALSE;
if (!(proc = GetProcAddress(gNOAADLLInst,"NEGetNextMessage")))
return FALSE;
if (!(message = MyAllocatePointer(len + 1)))
return FALSE;
if ((*proc)((Ptr)"ALH5", message, len + 1) == FALSE)
{
MyFreePointer(messageString);
return FALSE;
}
MyHandleIACMessage(&message);
MyFreePointer(messageString);
return TRUE;

To see if an application is running:
Boolean CallNEAppIsRunning(Ptr appSignature) // 16 bit version
{
FARPROC proc;
if (gNOAADLLInst == NULL)
gNOAADLLInst = LoadLibrary(gDllFileName);
if ((UINT)gNOAADLLInst > 32) { // we have the library
proc = GetProcAddress(gNoaaDllInst,"NEAppIsRunning");
if (proc)return (Boolean)(*proc)((Ptr)appSignature);
}
return FALSE;


To quit:
Send a message to the DLL to let it know you’re quitting. Then free the DLL.
void CallNEBye(void) // 16 bit version
char sigStr[6];
FARPROC proc;
if ((UINT)gNOAADLLInst > 32) { // we have the library
proc = GetProcAddress(gNOAADLLInst, "NEBye");
if (proc) (*proc)(
(Ptr)"ALH5", // signature
(HWND)myMainWnd, // window handle
(Ptr)myMainClassName, // window class
(Ptr)NULL); // reserved for future use
FreeLibrary(gNOAADLLInst);
gNOAADLLInst= NULL;
}
}
Muchas Gracias. Luxo...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:11.