elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación C/C++ (Moderadores: Eternal Idol, Littlehorse, K-YreX)
| | |-+  Carga de funcion de una dll c++
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Carga de funcion de una dll c++  (Leído 1,674 veces)
alerico90

Desconectado Desconectado

Mensajes: 1


Ver Perfil
Carga de funcion de una dll c++
« en: 14 Agosto 2015, 22:37 pm »

Hola! tengo un problema al llamar una funcion de una dll que se supone envia  por paquetes udp lo que se encuentra en la estructura de los parametros pero en vez de eso envia el nombre de la funcion como tal aqui el codigo, la funcion es PBusTransferPLUCluster

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
 HMODULE  dllhandle;
#include "Unit1.h"
#include <windows.h>
#include <iostream.h>
#include <conio.h>
//#include "PBusDrv.dll"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;

typedef struct
{
    string Name;
    int LFCode;
    string Code;
    int BarCode;
    int UnitPrice;
    int WeightUnit;  //4 Kg, 9 PCS
    int Deptment;
    double Tare;
    int ShlefTime;
    int FixUnit;
    double FixWeight;
    int Tolerance;
    int Message1;
    byte Reserved;
    string Reserved1;
    byte Message2;
    byte Reserved2;
    int MultiLabel;
    int Rebate;
    int Account;
   }TPLU;


typedef struct
{
   string Name;
   int LFCode;
   string Code;
   int BarCode;
   int UnitPrice;
   int WeightUnit;  //4 Kg, 9 PCS
   int Deptment;
   double Tare;
   int ShlefTime;
   int FixUnit;
   double FixWeight;
   int Tolerance;
   int Message1;
   byte Reserved;
   string Reserved1;
   byte Message2;
   byte Reserved2;
   int MultiLabel;
   int Rebate;
   int Account;
   int PluKey;
   string ProdDate;
   bool IsLock;
   int Traceid;
   int IceRate;
   int TotalPrice;
   char JudgeCode;
   }TPLU1;


TPLU  ClusterUpload;
TPLU* ClusterDownload;
TPLU1 ClusterUpload1;
TPLU1 ClusterDownload1;
TPLU PPLUCluster[4];
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
   : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
   int d,d2;


   PPLUCluster[0].Name = "Melon";
   PPLUCluster[0].UnitPrice = 1832;
   PPLUCluster[0].LFCode = 1001;
   PPLUCluster[0].Code = "1001";
   PPLUCluster[0].WeightUnit = 4;
   PPLUCluster[0].Deptment = 21;
   PPLUCluster[0].BarCode = 7;

   PPLUCluster[1].Name = "Manzanas";
   PPLUCluster[1].UnitPrice = 1200;
   PPLUCluster[1].LFCode = 1002;
   PPLUCluster[1].Code = "1002";
   PPLUCluster[1].WeightUnit = 4;
   PPLUCluster[1].Deptment = 21;
   PPLUCluster[1].BarCode = 7;

   PPLUCluster[2].Name = "Uvas";
   PPLUCluster[2].UnitPrice = 1832;
   PPLUCluster[2].LFCode = 1003;
   PPLUCluster[2].Code = "1003";
   PPLUCluster[2].WeightUnit = 4;
   PPLUCluster[2].Deptment = 21;
   PPLUCluster[2].BarCode = 7;

   PPLUCluster[3].Name = "Melon";
   PPLUCluster[3].UnitPrice = 1200;
   PPLUCluster[3].LFCode = 1004;
   PPLUCluster[3].Code = "1004";
   PPLUCluster[3].WeightUnit = 4;
   PPLUCluster[3].Deptment = 21;
   PPLUCluster[3].BarCode = 7;

   dllhandle = LoadLibraryW(L"PBusDrv.dll");

   if(dllhandle)
   {
      typedef int (__stdcall *PBUSCONNECTEX)(char *aux1, char *aux2, char *ip);
      PBUSCONNECTEX PBusConnectEx;
      PBusConnectEx =  (PBUSCONNECTEX)GetProcAddress(dllhandle,  "PBusConnectEx");
      d=PBusConnectEx("","","192.168.30.252");

      if(d>=0)
      {
         CheckBox1->State=1;
      }

      typedef int (__stdcall *PBUSTRANSFERPLUCLUSTER)(TPLU PPLUCluster[]);
      PBUSTRANSFERPLUCLUSTER PBusTransferPLUCluster;
      PBusTransferPLUCluster =  (PBUSTRANSFERPLUCLUSTER)GetProcAddress(dllhandle,  "PBusTransferPLUCluster");
      d2=PBusTransferPLUCluster(PPLUCluster);


   }


En línea

ivancea96


Desconectado Desconectado

Mensajes: 3.412


ASMático


Ver Perfil WWW
Re: Carga de funcion de una dll c++
« Respuesta #1 en: 14 Agosto 2015, 22:52 pm »

Recuerda poner las etiquetas de código, GeSHi.

Sin más información de la función, es difícil saber qué ocurre.


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines