|
send(sckClient, "GETSIZE", 8, 0);
There are only 7 chars in this. I do not know what the behaviour will be in
this case.
you have to send a null character if you want it to go.
i would assume
send(sckClient, "GETSIZE", 7, 0);
would be more appropriate
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I believe the server and client are out sync. Use a diagram to plot your algorithm and make sure the server sends the exact size and the exact data; and the client receives the correct size and read the exact data.
Kuphryn
|
|
|
|
|
Hello!
How can I make to mark as selected the entire line on a CListCtrl Box.
When the first column was clicked, this was mark as selected, but I need that the line must be complete mark as selected like on a CListBox control.
Thanks.
Walote
|
|
|
|
|
Use the LVS_EX_FULLROWSELECT extended style:
pListCtrl->SetExtendedStyle(pListCtrl->GetExtendedStyle()|LVS_EX_FULLROWSELECT);
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
Thank you Shog9 for you answer, but I see another problem.
SetExtendedStyle and GetExtendedStyle is not supported for my compiler (Visual C++ 5.00), the style LVS_EX_FULLROWSELECT can not be found on the Help for this compiler. (Visual Studio C++ 5.00)
Must to be inserted a new class or any include file with the definition for this extended style.
Thank you again.
Walote
|
|
|
|
|
You may need to upgrade your version of Visual C++, or at least install the (free) Platform SDK. From my commctrl.h :
#define LVS_EX_FULLROWSELECT 0x00000020 // applies to report mode only Good luck!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
As Ravi stated, you should consider upgrading, or downloading the platform SDK. But for the moment, here's the info you need:
#define LVS_EX_FULLROWSELECT 0x20
#define LVM_SETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+54)
#define LVM_GETEXTENDEDLISTVIEWSTYLE (LVM_FIRST+55)
::SendMessage(hWndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0,
(LPARAM) ::SendMessage(hWndList, LVM_GETEXTENDEDLISTVIEWSTYLE, 0,
0)|LVS_EX_FULLROWSELECT);
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
I don't know how to insert an icon into menu bar. In stead of showing the caption of item in menu bar, I want to show the icon to make it more beautiful.
Thank you for your reading.
Don't forget drop me some lines after reading.
|
|
|
|
|
DrawIcon() inside of DrawItem()
Make your menu item owner drawn and go nutts!!!
[edit]Your probably gonna wanna look at MeasureItem() also...[/edit]
Your not gonna need owner drawn if you just wanna have a small icon inside the menu item with normal text, just use bitmaps instead...and you'll have menus that look like VC++...Owner drawn is beautiful...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
How to write a simple application that can changed the DATE FORMAT.
I want to change the date format using my application instead of using Control Panel>Regional Option>Date to do.
|
|
|
|
|
|
I've just seen this in some code (CLabel from CodeProject).... i've nver seen syntax like this before but it works!!
m_monty
.SetFontName("Arial")
.SetFontSize(12)
.SetTextColor(RGB(255,255,0))
.SetFontUnderline(TRUE)
.SetBkColor(RGB(0,0,0))
.SetFontItalic(TRUE)
.SetFontBold(TRUE)
.SetBorder(TRUE)
.SetSunken(TRUE);
is this standard C++ or just a vc++ thing?
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
My guess is that these functions in the CLabel class return a CLabel& . That way you can chain many function calls together in one line (or many lines for that matter). It could also be written as:
m_monty.SetFontName("Arial").SetFontSize(12).SetTextColor( etc )...
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Yes it's standard. The methods return a reference to an instance of the class.
Pavel
Sonork 100.15206
|
|
|
|
|
Ahhhh......
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
This is not the least bit standard. It's the result of someone trying to be cute.
Certainly it works - see the other responses for why - but it's pointless.
|
|
|
|
|
It's "cute" coding following the style of STL streams, where you can chain a lot of stuff together like:
cout << "Hello " << "Bob" << endl;
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I'm using MFC and when I use level 4 warnings, I get all kinds of warnings in the VS files. Especially using std::vector. The warnings are things like C4201, C4100, C4663, C4018, and C4244. I put
#pragma warning(disable: 4201 [etc...] )
in stdafx.h, but they still come up. Any way I can get rid of them, or fix them? What do you do when building on Level 4??
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
I don't build on level 4. Why bother, if you'll have to disable the warnings anyway? When i want level 4 warnings, i'll do
#pragma warning(push,4)
#pragma warning(pop)
This lets me have that good, clean feeling about *my* code, but not be annoyed by all the crap i can't change in the headers.
Shog9
------
No one's immune now, from a world of problems
No one's exempt now, from a world of pain
That's the way that it goes
when you're down here with the rest of us...
|
|
|
|
|
Thanx! That's exactly what I want to do.
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
I have a linked list of 1000 X 1000 arrays of float, which I need for doing some simulations. When I run the part of the appln that declares the array, I get a stack overflow error. Is there a way to increase the memory allocated to my appln? With 10^6 elements repeated many times in my list, I need a lot of xtra mem. I currently have 350 MB available. Thx,
Ralf.
ralf.riedel@usm.edu
|
|
|
|
|
The stack has its limitations. You run into less than in the old 16 bit days, but its still there.
Rather than doing something like:
void MyFunction ()<br />
{<br />
float Wheee [1000][1000];<br />
....<br />
}
You can do:
void MyFunction ()<br />
{<br />
float *Whee = new float [1000*1000];<br />
....<br />
<br />
delete [] Whee<br />
}
Or other dynamic (off the heap) allocations. (e.g. LocalAlloc, IMalloc etc).
Good luck,
Iain.
|
|
|
|
|
Put your array on the heap rather than the stack. I would even wrap it in a class:
class CABigArray
{
public:
float theArray[1000][1000] = 0;
};
then:
void main()
{
CABigArray* p_ba = new CABigArray;
for(int i=0; i<1000; i++)
{
for(int q=0; q<100; q++)
p_ba->theArray[i][q] = i * q;
}
delete p_ba;
}
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Besides the heap. You can also just
declare it "static". You'll lose
reentrancy so it will make the method
useless for multithreading or recursion,
but it's a simple one word fix.
|
|
|
|
|
Normally the stack is guarded by a guard page.
If you call a function and its stack frame doesn't fit within the current stack size anymore, the guard page will be 'touched'. That will generate a page-fault. The logic of the guard page will then increase the stack by one page and put on top another guard page.
If you have a lot of local variables (and the stack frame would be larger than one page), the compiler is responsible for generating code to touch the guard pages until the stack has grown with enough pages.
We noticed in the past that if Fortran is linked in (I think the main had to be written in fortran as well, but I'm not sure) that this logic did not work (the code to touch all the guard pages was missing in the fortran version I think). You don't have fortran in your application, do you ?
Another reason for a stack overflow could be an infinity recursion.
But I agree with Iain, allocating it is much better.
Enjoy life, this is not a rehearsal !!!
|
|
|
|