esquiro27
Messages postés2Date d'inscriptionjeudi 5 juin 2008StatutMembreDernière intervention11 février 2012
-
11 févr. 2012 à 16:04
cs_rt15
Messages postés3874Date d'inscriptionmardi 8 mars 2005StatutModérateurDernière intervention 7 novembre 2014
-
13 févr. 2012 à 09:33
Salut tout le monde!
Je cherche à intégrer une DLL C++ dans mon application en D7, afin d'utiliser une fonction de conversion dont j'ai vraiment besoin!!!
Mon PB c'est que je ne sais vraiment pas comment faire...
et je n'arrive pas à convertir le code C++ fourni comme exemple en Delphi...
j'ai essayé quelques trucs mais en vain!!!
voici une description fournie avec la DLL:
[b]If you want to add a possibility to convert DBF files in your application
you could use our library for this purpose.
There are only two functions:
int DBFtoDBF_Converter(HWND hwnd, int argc, char *argv[]);
It accepts three parameters.
The first "hwnd" must be NULL. It is not used.
The second "argc" must be equal to number of parameters.
The third "argv" contains parameters.
int DBFtoDBF_ConverterStr(HWND hwnd, char *params);
It accepts two parameters.
The first "hwnd" must be NULL. It is not used.
The second "params" contains parameters which are delimited with sign #,
for example: source.dbf#target.dbf#/dBase3#/overwrite=1
The functions return:
0 - success
1 - not recognized a source file
2 - not recognized a target file or folder
3 - cannot open one or more source dbf files
/OVERWRITE=1 Overwrite existing file. (default)
/OVERWRITE=0 Do not overwrite existing file. (Append to existing file).
/SKIPDEL=1 Skip records marked as deleted.
/SKIPDEL=0 Do not skip records marked as deleted.
/RECALL=1 Remove a deleteion mark from the output file.
/RECALL=0 Keep a deletion mark in the output file. (default)
/DBASE3 Convert to dBase III format.
/DBASE4 Convert to dBase IV format.
/FOXPRO Convert to FoxPro format.
/VFP Convert to Visual FoxPro format.
/LEVEL7 Convert to dBase Level 7 format.
/BLOCKSIZE=????? Set blocksize for memo fields.
Example:
/BLOCKSIZE=128
/RECORDS=0 Do not export records of the table.
Output codepage
/ASIS Codepage as is. (default)
/ANSI Convert to ANSI codepage.
/OEM Convert to OEM codepage.
Source codepage
/SOURCE=ANSI
/SOURCE=OEM
/FILTER=condition It allows you to convert records which satisfy the condition.
/CHANGETYPE:FIELD=TYPE(LENGTH,WIDTH)
Set field type in the output file
Example:
/CHANGETYPE:FIELDNAME1=N(10,2)
/CHANGETYPE:FIELDNAME2=C(128)
/CHANGETYPE:FIELDNAME3=D(8)
/CHANGETYPE:FIELDNAME4=M
////////////////////// sample1.cpp ////////////////////////////
//parameters in the command line
//
//sample1.exe source.dbf target.dbf ...
//
#include <windows.h>
int __declspec(dllexport) __stdcall DBFtoDBF_Converter(HWND hwnd, int argc, char *argv[]);
//////////////////////// net.cpp //////////////////////////////
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
[DllImport("dbf2dbf_d.dll", CharSet = CharSet.Ansi)]
static extern void DBFtoDBF_Converter(string hwnd, int argc, string[] argv);