|
Greetings...
I have a custom drawn window in a dialog box. In the window procedure I am not able to trap WM_LBUTTONDBLCLK, the message is not coming only.
I am getting WM_ONLBUTTONDOWN ?
Any suggestions on how to get WM_LBUTTONDBLCLK.
Thanks in advance.
Ritesh
|
|
|
|
|
That is weird. What does the code in the message queue looks like in your dialog box i.e. ON_COMMAND, etc?
Kuphryn
|
|
|
|
|
Is the CS_DBLCLKS specified in the WNDCLASS.style of your control...?
Just a thought
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Well...CSDBLCLICKS in my wndclass during RegisterWindowEx solved the problem.
Thannks for the suggestion
Ritesh
|
|
|
|
|
Hello,
I am wondering if there is an easy or fast way to resolve DNS names to IP addresses? As of right now I create a CAsyncSocket and connect it to a dns name I then do a GetPeerName to resolve the IP address.. This doesn't seem like a clean way to do this plus i am running this process agains a list of names, this function runs each time I receive a msg from a listening socket, sometimes this takes quite awhile to complete..
Any ideas?
|
|
|
|
|
// Perform the DNS lookup
hostent *pHost = gethostbyname( pszHostname );
if ( pHost != 0 )
{
// Copy the IP address into sockaddr_in structure
// There is only one hostent structure per thread, so we need to copy it before we call the function
// again.
sockaddr_in addr;
memset( &addr, 0, sizeof(addr) );
addr.sin_family = AF_INET;
memcpy( &addr.sin_addr, pHost->h_addr, pHost->h_length );
}
This is unlikely to be much faster though as the DNS lookup itself is the bottleneck
Dave
|
|
|
|
|
Thanks for the fast reply.. (Dumb question) How do I pull the structured IP address from addr.sin_addr structure? I seem to be getting a number like .. "2974562880"
|
|
|
|
|
MessageBox(inet_ntoa(addr.sin_addr));
|
|
|
|
|
I've got a modeless dialog where, I've got a static text field, progress bar, and and edit box.
Ranging through a CStringArray, I'm updating the static text and progress bar OK, but I can't seem to get the CEdit to update properly.
The Edit box is just supposed to display which files have been processed, and some relevent info. 1 per line.
I've tried dlgModeless->m_cEditBox.SetWindowText(sStatusOut) , but no go.
Thanks for help.
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
How did you declare m_cEditBox? Is it a control or a CString variable? For a CString variable, remember to call UpdateData(FALSE).
Kuphryn
|
|
|
|
|
I've declared it both as CEdit and CString. Now it is back to CString. I'm updating this CString(m_sStatusEdit) in the calling function, and then calling UpdateData(false).
Nothing.
The window is up, and two other controls are being properly updated.
Actually I'm not even seeing the edit box. (visible setting is checked, though)
thanks for your help
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
How did you add the edit box? If it Windows does not draw it, then there is definitely a problem that is bigger than the update problem original posted.
Kuphryn
|
|
|
|
|
Well I tried not destoying the dialog, and my edit box does become visible with everything as it should be, once the process is over. (i do updateData() after each pass.
I appreciate your time/help
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
I got it working!
thanks
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
Does it give any trick to include some little resource objects (like bitmaps) in the header file of a class?
I want to write a subclassed dialog with some buttons, but I don't want to add the button bitmaps (icons) to the resource file! I want to add this bitmaps in the header or cpp file, so that I can use the class very easy!
--
Nice greets, Daniel.
|
|
|
|
|
Funny I was thinking the same thing just the other day...
The way I see it, yes it has advantages...you don't have to include resource files with your project, just one CPP and one H file is all that are required...
I think if anything it'd be a bit (no pun intended) faster than using traditional resource bitmaps. You can avoid the call to LoadBitamp() or LoadImage()
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
You can but the size of bitmap you can include is limited.
Todd Smith
|
|
|
|
|
Any one knows how to convert a binary array to a decimal array in C++? Thanks.
mIchAel Liu
__________________________________________________________
The secret of business is to know something that nobody else knows.
|
|
|
|
|
what's a "binary array" ?
-c
All you have to do is tell the people they are being attacked, and denounce the opposition for lack of patriotism and exposing the country to danger.
-- Herman Goering, on how to control the public
|
|
|
|
|
... and what's a "decimal array" ?
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
1111 0000 1111 1000 = F0F0
is "111100001111000" a string?
Developing with C++ is like programming by the seat of your pants
|
|
|
|
|
Actually, I have a big integer value, larger than 80 bits which I can't use DOUBLE to hold this value and print it out. Now I have a array to hold this value by binary integers(0,1), then I need to convert it to another array which hold decimal integers(0 to 9) to present this large value. Because I can't use power of 2 ( if I have 256 bits, then I can't hold the it), I have touble to convert it.
mIchAel Liu
__________________________________________________________
The secret of business is to know something that nobody else knows.
|
|
|
|
|
CString * pArray;
int iArraySize = 4;
for (int i =0; i< iArraySize; i++)
{
pArray[i] = "abc";
}
It chokes at the line where I assign it "abc" . Previously I had assigned it 2*i, so I thought that since i is int and p String, thats causing the crash. But the above is not happy.
Whats wrong?
Appreciate your help,
ns
|
|
|
|
|
Why don't you assign the array like that:
const int iArraySize = 4;
CString Array[iArraySize];
for (int i=0; i < iArraySize; i++)
{
Array[i] = "abc";
}
<pre>
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Fine. Thanks for that!
How will I pass this array into a function?
myFunc( CString * pArray)
called as
myFunc(pArray)
? ????
Appreciate your help,
ns
|
|
|
|