mfc >> Not able to give char input in IPaddress control,but able to paste char's in it.

by aarya » Fri, 17 Feb 2006 21:06:49 GMT

Hi all,
In my MFC application I use an IPAddress control.In that ,if I
give a charectar input ,it will not accept it.But if I copy some
charectar & paste in the IPAddress column, it is accepting the input.I
dont want this to happen.Is there any way in which I can make that it
will not accept charectar input even if I paste some charectar's on the
IPAddress control...

Thanks in advance.



mfc >> Not able to give char input in IPaddress control,but able to paste char's in it.

by Tom Serface » Fri, 17 Feb 2006 22:49:46 GMT


You could hook into the EN_CHANGE notification and check each character as
it is typed and warn the user if the values are not correct (perhaps blank
them out).

Tom








Similar Threads

1. not able to typecast char* to TCHAR*

2. Not able to pass variables from page to user control - CSharp/C#

3. Not able to create an Activex control within another activex contr

Hi,

I'm not able to create an Activex control within another activex control.
..........
CAxCtrl m_obj;
................
m_obj.Create(NULL,_T("Control1"),WS_CHILD | 
WS_VISIBLE,CRect(0,0,100,50),this,1000);

( this ----> parent activex control)

I'm getting an error in occcont.cpp , in this particular line

 TRY
 {
        m_pCtrlCont = afxOccManager->CreateContainer(this);
 }
  END_TRY

Thanks

4. Not able to remove the indentation in the list control after removing the imagelist

5. Not able to handle WM_CHAR in CStatic-derived control

Hello,

     I have a CStatic-derived control inside a CFormView-derived window. 
That control would need to handle WM_CHAR messages, so I have written the 
corresponding OnChar handle as a member of the control class.
     Unfortunately, nothing happens durgin the execution when I press a key 
like 'a'. The code inside "OnChar()" never gets reached (I have put a 
"AfxMessageBox()" in it for tracking).
     The focus is own by th control, I have verified it.
     I would really appreciate some help in finding out the cause of this 
strange (to me) behaviour. 
     Thanks in advance,

     David
    

6. forming an ipaddress string from unsigned char array

7. converting from IPADDRESS string to unsigned char array

On Sun, 30 Mar 2008 05:32:28 -0700, sam.barker0 wrote:

> Hi ,
> I am trying to convert from an IPADDRESS string [say "12.12.1.2"]to a
> unsigned char array[containing the octets witout the dots]
> 
> I tried to use c_str().Its was stupid because I tried to cast it with
> <unsigned int> .
> Is there a way easily do this.
> 

#include <sstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>

std::istream & operator>>(std::stringstream & strm, std::vector<int> & v) {
	if(strm.good()) {
		int temp = ~0;
		strm >> temp;
		v.push_back(temp);
	}
	return strm;
}

int main() {
	std::stringstream stream("12.12.1.12");
	std::vector<int> v;
	while(stream.good()) {
		stream >> v;
		stream.ignore();
	}
	std::copy(v.begin(),v.end(),std::ostream_iterator<int>(std::cout,"\n"));	
	return 0;
}

-- 
OU

8. Padding bits and char, unsigned char, signed char