Visual Studio Installtion Help

V

vanisathish

Hi,


Is it possible to install the Visual Studio 6.0 (Professional
Edition)( Designed for Windows NT and Windows 98) on a Windows XP
/Windows 2000 Professional Machines ?


I dont have any problems when i install Visual Studio 6.0 on these
machines, but i suspect some applications especially the Serial Comm
API is not working properly. eg, the ReadFile method is getting blocked

forever( i have specified the COMMtimeouts correctly) to read a single
character and i see data coming on the serial port(using a serial port
monitor)


Thanks
 
J

Jonny

For those wondering, he's talking about an older version of this:
http://www.ulead.com/vs/sysreq.htm

Serial port input/output was done by the some older digital single frame
picture cameras. These were usually accompanied by download picture and
camera adjustment software. Due to increases in these type camera
resolution, and actual picture size, the serial port type were generally
phase out in favor of USB or Firewire.

6.0 version is phased out. 9.0 is current.
http://www.ulead.com/tech/phasedout.htm
 
F

frodo

Is it possible to install the Visual Studio 6.0 (Professional
Edition)( Designed for Windows NT and Windows 98) on a Windows XP
/Windows 2000 Professional Machines ?

Yes, it'll work fine; be sure to apply SP6 for it.
I dont have any problems when i install Visual Studio 6.0 on these
machines, but i suspect some applications especially the Serial Comm
API is not working properly. eg, the ReadFile method is getting blocked
forever( i have specified the COMMtimeouts correctly) to read a single
character and i see data coming on the serial port(using a serial port
monitor)

serial comm programming for this is very basic. google around, there are
samples out there.

try this:


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp


I remember doing this years ago, it was a pain to get everything just
right. As I recall, part of the problem was getting the dcb init'd
correctly. note the ZeroMemory() call below and the filling in of the
dcbLength element, that essentially id's the version of the dcb structure.

here's a snippit of that code; it was multithreaded but these
open/close/read functions should provide some clues as to how to set it
up:

note that reading was done via polling.

===========

////////////////////////////////////////////////////////////////////
static
int open_comm ( char *port )
////////////////////////////////////////////////////////////////////
{

HANDLE hWriteThrd;
DWORD idWriteThrd;
int res;

// note: upon entry we have exclusive access to CSS

// open the comm device
HPort = CreateFile( port, GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL );
if ( HPort == INVALID_HANDLE_VALUE )
return -2; // -2 = can't open port

// init the overlapped structs' event handles
// (rest of olp structs are init'd to 0's -- ok for serial comm)
Rolp.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
if ( Rolp.hEvent == NULL )
{
CloseHandle( HPort );
HPort = NULL;
return -3; // -3 = can't make io event
}
Wolp.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
if ( Wolp.hEvent == NULL )
{
CloseHandle( Rolp.hEvent );
CloseHandle( HPort );
HPort = NULL;
return -3; // -3 = can't make io event
}
EmptyOlp.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
if ( EmptyOlp.hEvent == NULL )
{
CloseHandle( Rolp.hEvent );
CloseHandle( Wolp.hEvent );
CloseHandle( HPort );
HPort = NULL;
return -3; // -3 = can't make io event
}

// setup device buffers
res = SetupComm( HPort, 5600, 512 );
res = PurgeComm( HPort, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR
| PURGE_RXCLEAR );

// setup timeouts; we will only poll reads, and writes are cached, so
// we don't need to spec anything special here
COMMTIMEOUTS c = { MAXDWORD, 0, 0, 0, 0 };
// these settings say that a ReadFile() will always return
// immeadiately w/ any/all chars already recvd, even if none;
// and that WriteFile() will not use timeouts. this is important to
// write_thread() below.
res = SetCommTimeouts( HPort, &c );

// as a test, let's see what comm-config dialog the driver offers
// COMMCONFIG cc;
// cc.dwSize = sizeof( cc );
// cc.wVersion = 1;
// res = CommConfigDialog( port, NULL, &cc );

// set up comm parameters
DCB dcb;
ZeroMemory( &dcb, sizeof( dcb ) );
dcb.DCBlength = sizeof( dcb );
// get state to fill in defaults
res = GetCommState( HPort, &dcb );
// then mod for my app
dcb.BaudRate = CBR_115200;
dcb.fBinary = TRUE;
dcb.fParity = NOPARITY;
dcb.fOutxCtsFlow = FALSE;
dcb.fOutxDsrFlow = FALSE;
dcb.fDsrSensitivity = FALSE;
dcb.fDtrControl = DTR_CONTROL_DISABLE;
dcb.fRtsControl = RTS_CONTROL_DISABLE;
dcb.fAbortOnError = FALSE; // i don't want it to ever abort
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = ONESTOPBIT;
if ( SetCommState( HPort, &dcb ) == 0 )
{
CloseHandle( HPort ); HPort = NULL;
CloseHandle( Rolp.hEvent );
CloseHandle( Wolp.hEvent );
CloseHandle( EmptyOlp.hEvent );
return -4; // -4 = can't make settings
}

// create a semaphore that the write_thread() will use
HWriteWakeup = CreateSemaphore( NULL, 0, 100, NULL );
if ( HWriteWakeup == NULL )
{
CloseHandle( HPort ); HPort = NULL;
CloseHandle( Rolp.hEvent );
CloseHandle( Wolp.hEvent );
CloseHandle( EmptyOlp.hEvent );
return -5; // -5 = can't make semaphore
}

// and create the write_thread
hWriteThrd = CreateThread( NULL, 0,
(LPTHREAD_START_ROUTINE)write_thread, NULL, 0, &idWriteThrd );
if ( hWriteThrd == NULL )
{
CloseHandle( HPort ); HPort = NULL;
CloseHandle( Rolp.hEvent );
CloseHandle( Wolp.hEvent );
CloseHandle( EmptyOlp.hEvent );
CloseHandle( HWriteWakeup );
return -6; // -6 = can't make write_thread
}

// close the handle to the thread, we don't need it anymore
CloseHandle( hWriteThrd );

return 0; // 0 = success

} // end of open_comm()

////////////////////////////////////////////////////////////////////
static
void close_comm ( void )
////////////////////////////////////////////////////////////////////
{

int fail_safe;

// set flag to writer thread to exit
ThreadExit = 1;
// wake it from any pending overlapped
PurgeComm( HPort, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR |
PURGE_RXCLEAR );
SetCommMask( HPort, 0 );
// wake it from the semaphore wait
ReleaseSemaphore( HWriteWakeup, 1, NULL );
// and give it a chance to run and return
fail_safe = 0;
while ( ThreadExit != 2 && ++fail_safe < 15 )
Sleep( 100 );

// clean up global handles created by open_port()
CloseHandle( HPort );
CloseHandle( Rolp.hEvent );
CloseHandle( Wolp.hEvent );
CloseHandle( EmptyOlp.hEvent );
CloseHandle( HWriteWakeup );

} // of close_comm()

////////////////////////////////////////////////////////////////////
static
void read_comm ( void )
////////////////////////////////////////////////////////////////////
{

COMSTAT s;
DWORD err_flags, cnt, n;

// note: we already have access to CSS upon entry

// clear any error, and read back the port status
ClearCommError( HPort, &err_flags, &s );
// record any error flags for debug
CSS.Status.last_err_flags |= err_flags; // yes, OR it in;
Get_Status() resets it
CSS.Status.summ_err_flags |= err_flags;

// check if the driver has any bytes in it's internal buffer
cnt = s.cbInQue; // count of BYTEs
if ( cnt )
{
// see if we have room for all those bytes
if ( cnt + CSS.Recv_Put > RFSIZE )
{
// too big; get as many as we can tho
cnt = RFSIZE - CSS.Recv_Put;
CSS.Status.msg_recv_ovr++; // incr debug cntr
}

// read those bytes into our fifo; it should always succeed (rtn
nonzero)
if ( !ReadFile( HPort, &CSS.Recv_FIFO[CSS.Recv_Put], cnt, &n,
&Rolp ) )
{
// I don't really need to test for IO_PENDING, it had to be
another error
CSS.Status.msg_recv_fail++;
}
else
// update the fifo index
CSS.Recv_Put += cnt;
}

} // end of read_comm()

===========

good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top