Utilisation de la DLL Vic-Pilot avec Visual-C.

Placer la DLL Vic_Pilot.dll dans le répertoire Windows ou dans le répertoire même de votre application ou dans la variable Path..

#include <windows.h>

main(argc,argv) {

HANDLE hlib; int i,j;

static boolean (APIENTRY *Lance_Vic)(void) ;

static void (APIENTRY *Vic_Start_path)(int x,int y);
static void (APIENTRY *Vic_Close_path)(void);
static void (APIENTRY *Vic_Insert_pah)(void);
static void (APIENTRY *Vic_Set_Width_Path)(int width);
static void (APIENTRY *Vic_Stroke_Color)(COLORREF color);
static void (APIENTRY *Vic_Fill_Color)(COLORREF color);
static void (APIENTRY *Vic_Laser_Color)(COLORREF color);
static void (APIENTRY *Vic_unset_laser)(void);

static void (APIENTRY *Vic_Add_ligne)(int x,int y);
static void (APIENTRY *Vic_Add_Circle)(int r);
static void (APIENTRY *Vic_Add_Quart)(int x,int y);
static void (APIENTRY *Vic_Add_IQuart)(int x,int y);
static void (APIENTRY *Vic_Add_Spline)(int x,int y);
static void (APIENTRY *Vic_Add_Bezier)(int x,int y);
static void (APIENTRY *Vic_Add_Quadra)(int x,int y);

static void (APIENTRY *Vic_Line)(int x, int y, int xx, int yy);
static void (APIENTRY *Vic_Circle)(int x,int y,int r,boolean filled);
static void (APIENTRY *Vic_Rectangle)(int x,int y,int l,int h,boolean filled);
static void (APIENTRY *Vic_Ellipse)(int x,int y,int l,int h,boolean filled);
static void (APIENTRY *Vic_Angle_Ellipse)(int cx,int cy,int grand_axe,int petit_axe,int angle,boolean filled);



hlib = LoadLibrary("Vic_Pilot.dll");

Lance_Vic = GetProcAddress(hlib, "Lance_Vic");

Vic_Start_path          = GetProcAddress(hlib, "Vic_Start_path");
Vic_Close_path          = GetProcAddress(hlib, "Vic_Close_path");
Vic_Insert_pah          = GetProcAddress(hlib, "Vic_Insert_pah");
Vic_Set_Width_Path      = GetProcAddress(hlib, "Vic_Set_Width_Path");
Vic_Stroke_Color        = GetProcAddress(hlib, "Vic_Stroke_Color");
Vic_Fill_Color          = GetProcAddress(hlib, "Vic_Fill_Color");
Vic_Laser_Color         = GetProcAddress(hlib, "Vic_Laser_Color");
Vic_unset_laser         = GetProcAddress(hlib, "Vic_unset_laser");

Vic_Add_ligne           = GetProcAddress(hlib, "Vic_Add_ligne");
Vic_Add_Circle          = GetProcAddress(hlib, "Vic_Add_Circle");
Vic_Add_Quart           = GetProcAddress(hlib, "Vic_Add_Quart");
Vic_Add_IQuart          = GetProcAddress(hlib, "Vic_Add_IQuart");
Vic_Add_Spline          = GetProcAddress(hlib, "Vic_Add_Spline");
Vic_Add_Bezier          = GetProcAddress(hlib, "Vic_Add_Bezier");
Vic_Add_Quadra          = GetProcAddress(hlib, "Vic_Add_Quadra");

Vic_Line                = GetProcAddress(hlib, "Vic_Line");
Vic_Circ                = GetProcAddress(hlib, "Vic_Circle");
Vic_Rectangle           = GetProcAddress(hlib, "Vic_Rectangle");
Vic_Ellipse             = GetProcAddress(hlib, "Vic_Ellipse");
Vic_Angle_Ellipse       = GetProcAddress(hlib, "Vic_Angle_Ellipse");



Lance_Vic();

//Vic_Line(0,0,1000,1000);

for (j=0; j<12; j++) for (i=0; i<20; i++)
{

        Vic_Fill_Color(RGB(0,0,255));
        Vic_Rectangle(500+i*1100,500+j*1100,1000,1000,TRUE);
        Vic_Fill_Color(RGB(255,0,0));
        Vic_Circle(1000+i*1100,1000+j*1100,500,TRUE);

        Vic_Fill_Color(RGB(255,255,0));
        Vic_Fill_Color(RGB(255,255,0));
        Vic_Start_path(500+i*1100,500+j*1100);
        Vic_Add_Quadra(500,500);
        Vic_Add_Quadra(1000,0);
        Vic_Add_Quadra(500,500);
        Vic_Add_Quadra(1000,1000);
        Vic_Add_Quadra(500,500);
        Vic_Add_Quadra(0,1000);
        Vic_Add_Quadra(500,500);
        Vic_Add_Quadra(0,0);
        Vic_Close_path();
        Vic_Insert_pah();
} //for

FreeLibrary(hlib);
return(0);
} //main