K8097 Problem with c++ program

Hello,
I´ve got a problem with my written program for a stepper Motor, which i want to control with the K8097.
The program is written in c++ with Microsoft Visual Studio 2010.

Thats the code:

[code]#include
#include <windows.h>
#include
#include <stdlib.h>

using namespace std;

HINSTANCE MyDll;

int main(int argc, char** argv[]) {

MyDll= LoadLibrary(L"mtrapi32.dll");

typedef bool (WINAPI *Connect_t) (char *cPort, unsigned long ulMotorCnt);
typedef void (WINAPI *Disconnect_t)(void);
typedef int (WINAPI *GetMoving_t)(unsigned long ulMotorIndx);
typedef bool (WINAPI *Connected_t) ();
typedef void (WINAPI *Move_t)(unsigned long ulMotorIdx, unsigned long ulSteps, unsigned long ulDirection, unsigned long Speed);
typedef int (WINAPI *GetMotorCount_t) ();

int connect;
int motorCount;

Connect_t Connect = (Connect_t)GetProcAddress(MyDll, “SMCConnect”);
GetMoving_t GetMoving = (GetMoving_t)GetProcAddress(MyDll, “SMCGetMoving”);
Connected_t Connected = (Connected_t)GetProcAddress(MyDll, “SMCConnected”);
Move_t Move = (Move_t)GetProcAddress(MyDll, “SMCMove”);
Disconnect_t Disconnect = (Disconnect_t)GetProcAddress(MyDll, “SMCDisconnect”);
GetMotorCount_t GetMotorCount = (GetMotorCount_t)GetProcAddress(MyDll, “SMCGetMotorCount”);

connect = Connect(“COM4”, 4);
motorCount = GetMotorCount();

if (connect)
{
cout << “Connected with Board” << endl;
}
else
{
cout << “Not connected with Board” << endl;
}

if (Connected())
{
Move(0, 200, 1,8000); // 8000 Maximale Geschwindigkeit
}
printf("%i\n",motorCount);
Disconnect();
FreeLibrary(MyDll);
return 0;
}
[/code]

One Problem is, that the value to check how many stepper motors are connected, is always 4?
My other problem is that when i try to use the GetMoving function i alway get a True.
So i hope that you can help me.
With best regards M. Vornholt

Connect("COM4", 4);Here you define a card with four motors. This is necessary because the two types of boards have a different protocol.

GetMotorCount();Will return 4 since you just told the library that you are connecting to a four-motor card.

GetMoving requires a windowed application to be able to receive feedback from the board. A console application is not suitable in this case. We only have an example in .NET.

Thank you for the fast answer.
Is there an other possibility to check out whether the motor is moving?
And can i work with an overcurrent as an limit switch. Because i don´t want to buy an extra limit switch.

With best regards M.Vornholt