me in the Console application works.
In Form Aplications to report an error, the "extern", in header "USMCDLL.h"

Declaration in Motor.cpp:

// Motory.cpp : main project file.
#pragma warning(disable : 4996) // Disable warnings about some functions in VS 2005
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

#include "stdafx.h"
#include <stdio.h>
#include <tchar.h>
#include <conio.h>
#include <process.h>
#include "USMCDLL.h"
#include "Form1.h"

using namespace System;
using namespace Motory;




Declaration in USMCDLL.h :

#pragma once

#include <windows.h>

// Please use the USMCDLL.lib to easely import functions from dll with "dllimport" (In Microsoft Visual Studio)
#ifdef USMCDLL_EXPORTS
#define USMCDLL_API __declspec(dllexport)
#else
#define USMCDLL_API __declspec(dllimport)
#endif
.
.
.
.
.(Code)
.
.
.
.
.(functions in the following error occurs) (Error is reflected in all of these features)
.
#ifdef __cplusplus // C++
extern "C" {
//
// The USMC_Init function initializes driver and returns devices information
//
USMCDLL_API DWORD USMC_Init( USMC_Devices &Str); // OUT - Array of structures describing all divices (may be NULL) MUST NOT be deleted

//
// The USMC_GetState function returns structure representing current state of device
//
USMCDLL_API DWORD USMC_GetState( DWORD Device, // IN - Device number
USMC_State &Str // OUT - Structure representing divice state
);
//
// The USMC_SaveParametersToFlash function saves current parameters of controller in static memory
// so thay can be loaded at start up time
//
USMCDLL_API DWORD USMC_SaveParametersToFlash( DWORD Device // IN - Device number
);
//
// The USMC_SetCurrentPosition function sets current position of controller
//
USMCDLL_API DWORD USMC_SetCurrentPosition( DWORD Device, // IN - Device number
int Position // IN - New position
);
//
// The USMC_GetMode function returns USMC_Mode structure last sent to device
//
USMCDLL_API DWORD USMC_GetMode( DWORD Device, // IN - Device number
USMC_Mode &Str // OUT - Structure representing some of divice parameters
);
//
// The USMC_SetMode function sets some of device parameters
//
USMCDLL_API DWORD USMC_SetMode( DWORD Device, // IN - Device number
USMC_Mode &Str // IN/OUT Structure representing some of divice parameters
);
//
// The USMC_GetParameters function returns USMC_Parameters structure last sent to device
//
USMCDLL_API DWORD USMC_GetParameters( DWORD Device, // IN - Device number
USMC_Parameters &Str // OUT - Structure representing some of divice parameters
);
//
// The USMC_SetParameters function sets some of divice parameters
//
USMCDLL_API DWORD USMC_SetParameters( DWORD Device, // IN - Device number
USMC_Parameters &Str // IN/OUT Structure representing some of divice parameters
);
//
// The USMC_GetStartParameters function returns USMC_StartParameters structure last sent to device
//
USMCDLL_API DWORD USMC_GetStartParameters( DWORD Device, // IN - Device number
USMC_StartParameters &Str // OUT - Structure representing start function parameters
);
//
// The USMC_Start function sets start parameters and starts motion
//
USMCDLL_API DWORD USMC_Start( DWORD Device, // IN - Device number
int DestPos, // IN - Destination position
float &Speed, // IN/OUT - Speed of rotation
USMC_StartParameters &Str // IN/OUT - Structure representing start function parameters
);
//
// The USMC_Stop function stops device
//
USMCDLL_API DWORD USMC_Stop( DWORD Device // IN - Device number
);
//
// The USMC_GetLastErr function return string representing last error
//
USMCDLL_API void USMC_GetLastErr( char *str, // OUT - String buffer
size_t len // IN - Lenght of that string buffer in bytes
);

//
// The USMC_GetDllVersion function returnes version values of USMCDLL.dll
//
USMCDLL_API void USMC_GetDllVersion( DWORD &dwHighVersion, // OUT - High Version Value
DWORD &dwLowVersion); // OUT - Low Version Value

//
// The USMC_Close function closes virtual driver window "microsmc.exe"
//
USMCDLL_API DWORD USMC_Close( void );

//
// The USMC_RestoreCurPos function checks AReset bit and if it is TRUE
// restores previous CurPos value
//
USMCDLL_API DWORD USMC_RestoreCurPos(DWORD Device // IN - Device number
);

// New For Firmware Version 2.4.1.0 (0x2410)

//
// The USMC_GetEncoderState function returns structure representing current position of encoder
//
USMCDLL_API DWORD USMC_GetEncoderState( DWORD Device, // IN - Device number
USMC_EncoderState &Str // IN/OUT Structure containing encoder state
);

// ~New For Firmware Version 2.4.1.0 (0x2410)

} // extern "C"
#else // C
DWORD USMC_Init( USMC_Devices *Str );
DWORD USMC_GetState( DWORD Device, USMC_State *Str );
DWORD USMC_SaveParametersToFlash( DWORD Device );
DWORD USMC_SetCurrentPosition( DWORD Device, int Position );
DWORD USMC_GetMode( DWORD Device, USMC_Mode *Str );
DWORD USMC_SetMode( DWORD Device, USMC_Mode *Str );
DWORD USMC_GetParameters( DWORD Device, USMC_Parameters *Str );
DWORD USMC_SetParameters( DWORD Device, USMC_Parameters *Str );
DWORD USMC_GetStartParameters( DWORD Device, USMC_StartParameters *Str );
DWORD USMC_Start( DWORD Device, int DestPos, float *Speed, USMC_StartParameters *Str);
DWORD USMC_Stop( DWORD Device );
void USMC_GetLastErr( char *str, size_t len );
DWORD USMC_Close( void );
DWORD USMC_GetEncoderState( DWORD Device, USMC_EncoderState *Str);
#endif // C/C++






!!!!! (I give only one message that error.)!!!!!
ERROR:

Motory.obj : error LNK2031: unable to generate p/invoke for "extern "C" unsigned long __clrcall USMC_GetEncoderState(unsigned long,struct USMC_EncoderState_st &)" (?USMC_GetEncoderState@@$$J0YMKKAAUUSMC_EncoderState_st@@@Z); calling convention missing in metadata
.
.
.
Motory.obj : error LNK2028: unresolved token (0A00000B) "int __clrcall Exit(void)" (?Exit@@$$FYMHXZ) referenced in function "void __clrcall Start(void)" (?Start@@$$FYMXXZ)
.
.
.
Motory.obj : error LNK2019: unresolved external symbol "void __clrcall zapisListBox1(unsigned long,char *,char *)" (?zapisListBox1@@$$FYMXKPAD0@Z) referenced in function "void __clrcall PrintDevices(struct USMC_Devices_st &)" (?PrintDevices@@$$FYMXAAUUSMC_Devices_st@@@Z)



Thank you for your help!