|
When a view has splitter windows present, by default all the On_COMMAND and ON_UPDATE_COMMAND_UI handler calls go through to the first view class in Pane1. You will have to write some kind of handler which allows these calls to be passed through to the active splitter view.
If you vote me down, my score will only get lower
|
|
|
|
|
|
when i install the LSP code Sample of the MSDN
my internet explorer cant establish any internet connection.
if any one know why this problem occurs and how to solve it please send me .
also if any one have code any other code sample that doesnt contain this problem please send it to me .
thank you
|
|
|
|
|
how can i add a listview contrl into a dialog box in sdk
without using mfc how can i add values into it
regards Tijo
|
|
|
|
|
i using serial Class for my vc++ project.
i check sometime this port is on or off.
(it more than one port) it may be 1 to 3 port.
if port is close(power off),my project is slow.
how can i control my project more faster.
code here
---------
// Serial.cpp
#include "stdafx.h"
#include "Serial.h"
CSerial::CSerial()
{
memset( &m_OverlappedRead, 0, sizeof( OVERLAPPED ) );
memset( &m_OverlappedWrite, 0, sizeof( OVERLAPPED ) );
m_hIDComDev = NULL;
m_bOpened = FALSE;
}
CSerial::~CSerial()
{
Close();
}
BOOL CSerial::Open( int nPort, int nBaud )
{
if( m_bOpened ) return( TRUE );
char szPort[15];
char szComParams[50];
DCB dcb;
wsprintf( szPort, "COM%d", nPort );
m_hIDComDev = CreateFile( szPort, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL );
if( m_hIDComDev == NULL ) return( FALSE );
memset( &m_OverlappedRead, 0, sizeof( OVERLAPPED ) );
memset( &m_OverlappedWrite, 0, sizeof( OVERLAPPED ) );
COMMTIMEOUTS CommTimeOuts;
CommTimeOuts.ReadIntervalTimeout = 0xFFFFFFFF;
CommTimeOuts.ReadTotalTimeoutMultiplier = 0;
CommTimeOuts.ReadTotalTimeoutConstant = 0;
CommTimeOuts.WriteTotalTimeoutMultiplier = 0;
CommTimeOuts.WriteTotalTimeoutConstant = 5000;
SetCommTimeouts( m_hIDComDev, &CommTimeOuts );
wsprintf( szComParams, "COM%d:%d,n,8,1", nPort, nBaud );
m_OverlappedRead.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
m_OverlappedWrite.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL );
dcb.DCBlength = sizeof( DCB );
GetCommState( m_hIDComDev, &dcb );
dcb.BaudRate = nBaud;
dcb.ByteSize = 8;
unsigned char ucSet;
ucSet = (unsigned char) ( ( FC_RTSCTS & FC_DTRDSR ) != 0 );
ucSet = (unsigned char) ( ( FC_RTSCTS & FC_RTSCTS ) != 0 );
ucSet = (unsigned char) ( ( FC_RTSCTS & FC_XONXOFF ) != 0 );
if( !SetCommState( m_hIDComDev, &dcb ) ||
!SetupComm( m_hIDComDev, 10000, 10000 ) ||
m_OverlappedRead.hEvent == NULL ||
m_OverlappedWrite.hEvent == NULL ){
DWORD dwError = GetLastError();
if( m_OverlappedRead.hEvent != NULL ) CloseHandle( m_OverlappedRead.hEvent );
if( m_OverlappedWrite.hEvent != NULL ) CloseHandle( m_OverlappedWrite.hEvent );
CloseHandle( m_hIDComDev );
return( FALSE );
}
m_bOpened = TRUE;
return( m_bOpened );
}
BOOL CSerial::Close( void )
{
if( !m_bOpened || m_hIDComDev == NULL ) return( TRUE );
if( m_OverlappedRead.hEvent != NULL ) CloseHandle( m_OverlappedRead.hEvent );
if( m_OverlappedWrite.hEvent != NULL ) CloseHandle( m_OverlappedWrite.hEvent );
CloseHandle( m_hIDComDev );
m_bOpened = FALSE;
m_hIDComDev = NULL;
return( TRUE );
}
BOOL CSerial::WriteCommByte( unsigned char ucByte )
{
BOOL bWriteStat;
DWORD dwBytesWritten;
bWriteStat = WriteFile( m_hIDComDev, (LPSTR) &ucByte, 1, &dwBytesWritten, &m_OverlappedWrite );
if( !bWriteStat && ( GetLastError() == ERROR_IO_PENDING ) ){
if( WaitForSingleObject( m_OverlappedWrite.hEvent, 1000 ) ) dwBytesWritten = 0;
else{
GetOverlappedResult( m_hIDComDev, &m_OverlappedWrite, &dwBytesWritten, FALSE );
m_OverlappedWrite.Offset += dwBytesWritten;
}
}
return( TRUE );
}
int CSerial::SendData( const char *buffer, int size )
{
if( !m_bOpened || m_hIDComDev == NULL ) return( 0 );
DWORD dwBytesWritten = 0;
int i;
for( i=0; i
|
|
|
|
|
why don;t you make your checking part a thread for each port your checking.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
i want to port is open or close.
example................
if (serial.Open(5,38400))
{
MessageBox("Port 5 is open");
serial.Close();
}
com 5 is network serial com port.
VLINX ESP Server make virtual com port for my computer.
when com5 is power on,i open com5(OK).
when com5 is power off,i open com5(very slow my application)
|
|
|
|
|
Have you tried setting these timeouts to smaller numbers.
CommTimeOuts.ReadIntervalTimeout = 0xFFFFFFFF;
CommTimeOuts.ReadTotalTimeoutMultiplier = 0;
CommTimeOuts.ReadTotalTimeoutConstant = 0;
CommTimeOuts.WriteTotalTimeoutMultiplier = 0;
CommTimeOuts.WriteTotalTimeoutConstant = 5000;
|
|
|
|
|
i was tried as u say but i don't success..
|
|
|
|
|
hello can u tell me how 2 create xml in vc++ using MSXML 3.0
thx
Rahul Agarwal
|
|
|
|
|
Please Read Documentation of IXMLDocument in your local copy of MSDN ,you will get all your answers to your problem there.
Or you can manully create XML (by following XML standards ) through your coding as you have to pass it Remote Server.
During receiving and parsing the XML,use the coding I have given to you in my last POST to you,
here[^]
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello,
Is there an easy way to port an ActiveX control (partially based on MFC) back to a plain MFC control?
I'm well aware the good side of ActiveX controls, but here, due to the versioning nightmare and also due that it is poorly written, I will be difficult to continue to use as-is. (Written Quick &Dirty by a programmer that left the company and now I need to maintain it .
Also, adding new interfaces, or even changing the current interfaces this control has, may corrupt its use on other projects that must run in parallel.
For this, I thought that the best is move back to MFC, so every project has its tailored control and it will not deppend on how/where the ActiveX control is registered.
The ActiveX control is a simple charting control that allows to display constellation, also works as a "scope" control.
Any hint?
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
Hi all,
Iam very new to windows programming stuff.
I require to add resolution modes in display settings of the desktop on Windows98 plateform.
Where as in windows 2K/XP/NT v have facility to check and uncheck the option " Hide the modes that this monitor cannot display" which adds many resolution modes to change for all display cards..or.. change the value 0/1 of "pruning mode" key in registry path HKLM\SYSTEM\CONTOLSET001\SERVICES\IALM\DEVICE0 ( intel graphics card).
i keep on changing cards like ATI,Nvedia,matrox,etc....
but in windows 98 there no facility in registry as such.
note:
On WIN98 i found one Modes folder in regisry HKLM\SYSTEM\CURRENTCONTROLSET\CLASS\DISPLAY\active driver e.g 0000\Modes
here i can see arround 37 resolution modes in which some are not shown in display settings.
i would like to add these modes into display settings options and customer to choose from that.
if anybody knows requested to help.
ur member
|
|
|
|
|
My application can able to open the *.xlc format file and shows the content in the file.
My Question was, How can I open the *.xlc file from windows explorer Open With option? How can I pass this *.xlc file parameter to the file to open the file with my application.
Please help me in this...
|
|
|
|
|
Are you looking to register the *.xlc with your application. If so the following lonk can help you. file association [^]
or look WinApp::RegisterShellFileTypes.
suhredayan There is no spoon.
|
|
|
|
|
I have two modules.
1. is a calibration modul, in which I am doing calibration of the system(that is doing some setting) and storing those
values to .INI file.
Now,
2. in second module I want to initialise this module or read some values from that .INI file which is set by first module.
I have some Idea that I need to use
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
but how to pass values to above class?
can any one please help me out. "or" give any sample code.
Dinesh Salvi
|
|
|
|
|
Unless you are against using __argc and __argv , I would suggest Paul DiLascia's CCommandLineInfoEx class.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi!
I´m a little newbie. I´m doing a program for my final career project. I´m using a derivied CListCtrl class that is doing its job in a perfect way. But, I have seen in some programs and in windows XP folders that if you select various files with the mouse, the mouse draws a blue rectangle selection. If you does the selection in desktop, this rectangle is transparent (only borders).
More than a question, it is a curiosity...how could I do this? I have reviewed the MSDN and I haven´t found anything.
thanks in advance
(sorry for my poor english
|
|
|
|
|
In the MFC dialog editor, set the Selection Type to "Extended"
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
I´m sorry, I don´t use the newsgroups
thanks!!!I have used the LVS_EX_DOBLEBUFFER and it works!! but..I get much flickering. Is there a way to relax this flickering?
thanks again
|
|
|
|
|
Hello,
Could anyone recommend an elegant way to insert a CBitmap (HBITMAP) object into a raw CRichEditCtrl (WITHOUT the doc/view architecure)? IOW, I need to create an OLE object from the bitmap handle (actually I am using GDI+ to generate this bitmap).
Regards,
BB
|
|
|
|
|
|
OK, but this HOWTO uses OleCreateFromFile to insert a bitmap FILE into the control, whereas I need to insert a dynamically created HBITMAP without saving it.
Regards,
BB
|
|
|
|
|
how about switch to OleCreateFromData?
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|