Click here to Skip to main content
15,899,632 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
QuestionHow to add control variables to control placed on ATL composite control Pin
viswanadhr22-Nov-07 4:14
viswanadhr22-Nov-07 4:14 
QuestionMMC node drag-drop using cut-copy-paste Pin
alien888820-Nov-07 21:07
alien888820-Nov-07 21:07 
Questionmemory leak Pin
anithavikram(manisha)20-Nov-07 20:06
anithavikram(manisha)20-Nov-07 20:06 
AnswerRe: memory leak Pin
Stuart Dootson20-Nov-07 21:49
professionalStuart Dootson20-Nov-07 21:49 
QuestionHow to transfer file using ATL SERVER .net 2003 [modified] Pin
SSATYAMASKE19-Nov-07 22:12
SSATYAMASKE19-Nov-07 22:12 
QuestionHow to Provide 30 day Trial Version Pin
swamy Narasimha17-Nov-07 0:47
swamy Narasimha17-Nov-07 0:47 
AnswerRe: How to Provide 30 day Trial Version Pin
ThatsAlok24-Nov-07 0:15
ThatsAlok24-Nov-07 0:15 
QuestionSerial Port Pin
sunny.rana12-Nov-07 9:57
sunny.rana12-Nov-07 9:57 
I am kinda very new to ATL and MFC programming i am kinda trying to control my stage motor connected to serial/com port using a sample software available online by activexperts.com it worked fine for abt month but now i guess the software a way to check evalution period which has expired so my software doesnt wrk anymore can anyone please help as to how i can work around this as i am a biomed engineer and really dont understand coding very well i have attached my code for refrence. It asl me to include 3 files i downloaded from their website.

void openport()
{
BSTR bstrTemp = NULL;
m_strDevice = "COM1";

CString strmotor;


ComPort->put_BaudRate( 9600 );
ComPort->put_StopBits ( asSTOPBITS_2 );
ComPort->put_DataBits (asDATABITS_8 );
ComPort->put_Parity ( asPARITY_NONE );

SysFreeString ( bstrTemp );
bstrTemp = m_strDevice.AllocSysString ();
ComPort->put_Device ( bstrTemp );
SysFreeString ( bstrTemp );
ComPort->put_ComTimeout( 200 );
ComPort->Open();

strmotor="SPEED X=3500 Y=3500 Z=20000";
writeport(strmotor);
DumpStageMotor(2);

strmotor= "ACCEL X=40 Y=40 Z=20";
writeport(strmotor);
DumpStageMotor(2);

strmotor= "WRITE X99=5000 Y99=5000";
writeport(strmotor);
DumpStageMotor(2);

strmotor= "JOYSTICK X-Y-Z-";
writeport(strmotor);
DumpStageMotor(2);

strmotor= "move x= 6500";
writeport(strmotor);
DumpStageMotor(2);

}
void closeport()
{
CString strmotor;
if( ComPort == NULL )
{
m_strResult = "Failed to load AComport.dll";

return;
}

m_strResult = "Please wait...";


ComPort->Close();
strmotor= "JOYSTICK X+Y+Z+";
writeport(strmotor);
DumpStageMotor(2);

}
void writeport(CString m_strCommand)
{
WCHAR wszTemp[ 1023 + 1 ];
BSTR pCommand;
CString cstrCommand;
INT i = 0;

if ( m_bComdata )
{
CString strTemp = m_strCommand;


strTemp.MakeUpper ();
strTemp = strTemp.SpanIncluding ( "ABCDEF 0123456789" );

while ( strTemp.GetLength () >= 2)
{
wszTemp [ i++ ] = strtol ( strTemp.GetBuffer ( 0 ), NULL, 16);

strTemp.TrimLeft ( "ABCDEF0123456789" );
strTemp.TrimLeft ( " " );
}

strTemp = "";

pCommand = SysAllocStringLen ( (OLECHAR FAR *) wszTemp, i );

ComPort->WriteBytes( pCommand );
}
else
{
pCommand = m_strCommand.AllocSysString ();

ComPort->WriteString( pCommand );
}

SysFreeString( pCommand );


}

CString readport()
{
BSTR pString;
CHAR szBuffer[ 16384 + 1 ] = {0};
BOOL bOpened;

if( ComPort == NULL )
{
m_strResult = "Failed to load AComport.dll";
return (m_strResult);
}

ComPort->get_IsOpened( &bOpened );

if( ! bOpened )
{
return (m_strResult);
}


if ( m_bComdata )
{
ComPort->ReadBytes ( &pString );

INT nLength = ::SysStringLen ( pString );

for ( INT n = 0; n < nLength ; n++ )
{
CString strTemp = "";

strTemp.Format ( "%02X ", pString [ n ] & 0xff );

m_strInput += strTemp;
}
}
else
{
ComPort->ReadString( &pString );

if( pString [ 0 ] != '\0' )
{
m_strInput += pString;
m_strInput += "\r\n";

}
}

SysFreeString ( pString );
return (m_strInput);

}

Dipen
AnswerRe: Serial Port Pin
Nathan Holt at EMOM16-Nov-07 6:56
Nathan Holt at EMOM16-Nov-07 6:56 
Questionwhen to/why use Allocator::construct()? [modified] Pin
jens rasmussen11-Nov-07 4:29
jens rasmussen11-Nov-07 4:29 
AnswerRe: when to/why use Allocator::construct()? Pin
Stuart Dootson12-Nov-07 15:30
professionalStuart Dootson12-Nov-07 15:30 
GeneralRe: when to/why use Allocator::construct()? Pin
jens rasmussen13-Nov-07 1:07
jens rasmussen13-Nov-07 1:07 
GeneralRe: when to/why use Allocator::construct()? Pin
Stuart Dootson13-Nov-07 5:01
professionalStuart Dootson13-Nov-07 5:01 
AnswerRe: when to/why use Allocator::construct()? Pin
led mike13-Nov-07 4:53
led mike13-Nov-07 4:53 
GeneralRe: when to/why use Allocator::construct()? Pin
Stuart Dootson13-Nov-07 5:12
professionalStuart Dootson13-Nov-07 5:12 
GeneralRe: when to/why use Allocator::construct()? Pin
led mike13-Nov-07 6:11
led mike13-Nov-07 6:11 
JokeRe: when to/why use Allocator::construct()? Pin
George L. Jackson13-Nov-07 11:09
George L. Jackson13-Nov-07 11:09 
JokeRe: when to/why use Allocator::construct()? Pin
led mike14-Nov-07 4:46
led mike14-Nov-07 4:46 
QuestionPush File into STL list Pin
Jeffrey Walton9-Nov-07 9:36
Jeffrey Walton9-Nov-07 9:36 
AnswerRe: Push File into STL list [modified] Pin
Rajasekharan Vengalil10-Nov-07 12:51
Rajasekharan Vengalil10-Nov-07 12:51 
GeneralRe: Push File into STL list Pin
Jeffrey Walton10-Nov-07 13:21
Jeffrey Walton10-Nov-07 13:21 
AnswerRe: Push File into STL list Pin
Stephen Hewitt11-Nov-07 15:49
Stephen Hewitt11-Nov-07 15:49 
GeneralRe: Push File into STL list Pin
Jeffrey Walton12-Nov-07 5:09
Jeffrey Walton12-Nov-07 5:09 
GeneralRe: Push File into STL list Pin
Stuart Dootson12-Nov-07 15:11
professionalStuart Dootson12-Nov-07 15:11 
AnswerRe: Push File into STL list Pin
Stuart Dootson11-Nov-07 22:54
professionalStuart Dootson11-Nov-07 22:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.