|
The scroll in CEdit is a built in scroll bar.. its just a painiting..u cannot get the handle of CEit scroll bars..
If u want to Change the color of the Scroll bar in CEdit better u remove the scroll of CEdit and place your own scroll bar..
Another option is to use Detours check out the sample out herehttp://www.codeproject.com/dialog/coolscroll.asp[^]
nave
|
|
|
|
|
I got it
Thank you ~ nave
|
|
|
|
|
i'm reading data from a machine which gives me the data in small chunks, sa 64 bytes (the size varies). i want to write this to a file. the total data can be megabytes in all...so i know writing each chunk of data that comes to me won't be a nice solution (slow).
so i'm thinking of having a bit bigger buffer. wait for that to be filled up, then write it. im sure this will work, but it seems like too much to do for a problem that should happen often. is there any existing solution in the API perhaps?
|
|
|
|
|
ilidan wrote: but it seems like too much to do for a problem that should happen often.
you must mean "should not happen often"?
ilidan wrote: but it seems like too much to do
I certainly would not consider buffering output "too much to do"? There is not that much to it.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
led mike wrote:
you must mean "should not happen often"?
ah well, i work a lot with hardware and this happens often. everything's relative, i guess.
led mike wrote: I certainly would not consider buffering output "too much to do"? There is not that much to it.
i guess. i just half-expected there'd already be some class that i can pipe output to ("<<") and it'll automatically manage the write buffering to a file.
anyway, thanks. i should start writing the code.
|
|
|
|
|
it seems CArchive does do this.
|
|
|
|
|
ilidan wrote: i guess. i just half-expected there'd already be some class that i can pipe output to ("<<") and it'll automatically manage the write buffering to a file.
My bad. I did not catch that at all. Yeah the stl streams will do that for you.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
use fopen or CStdioFile.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
At the lowest level, the least part of information that can be read from, or written to the physical disk is a sector (normally 512 bytes).
So whatever file I/O functions you are using, the runtime will buffer the data for you.
(For completeness sake, there are ways to write directly to the disk, but that's not the issue here).
|
|
|
|
|
Will IOCP promotes the performence much in a server with only one CPU?
|
|
|
|
|
Yes.
What is IOCP? Just kidding.
Define "much".
It should improve perfomance. Even more so on the latests chips (dual core).
Of course that is also dependent on your code not eating up the benefits.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
iocp good any cpu
Kuphryn
|
|
|
|
|
How can I do attribution with DWORD type?
With CString
<br />
CString str;<br />
Str="something";<br />
Can I do something similar with DWORD type?
|
|
|
|
|
DWORD val;<br />
val = 4;
If you mean something different than this, you need to be more specific.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Joe Woodbury wrote: you need to be more specific.
Be careful where you point that! See this[^]
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
I've been search around web, and I can't find how can I code a dialog to open a file with his respective application.
For example, Click on button an open a pdf on adobe reader.
|
|
|
|
|
|
like this
<br />
CString FileName=_T("Ping");<br />
CString strParam=_T("127.0.0.1");<br />
<br />
ShellExecute(NULL,_T("open"), FileName,strParam,NULL,SW_SHOW);<br />
<br />
|
|
|
|
|
And If I want to open a pdf on folder?
I want to attach to my program a Help manual on pdf.
|
|
|
|
|
Just use ShellExecute like this:
ShellExecute(NULL, _T("open"), "C:\\MyFolder\\MyPdf.pdf", "", "", SW_SHOW);
RicoH
Don't think you are, know you are...
custom hardware & software - olloc.be
-- modified at 10:48 Friday 12th May, 2006
|
|
|
|
|
|
i am trying to use some activex controls that came with vc++ 6, but it wont let me insert any of them into my dialog, keeps saying connot be instantiated, or i need a design time license. is there anyway around all that?
|
|
|
|
|
I'm trying to create an 8 bit DIB image with a grayscale palette
I create the image like so
char* bmpStruct = new char[ sizeof(BITMAPINFO) + (sizeof(RGBQUAD) * 256) ];
bmpInfo_ = (BITMAPINFO*)bmpStruct;
bmpInfo->bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
bmpInfo->bmiHeader.biWidth = width;
bmpInfo->bmiHeader.biHeight = -height;
bmpInfo->bmiHeader.biPlanes = 1;
bmpInfo->bmiHeader.biBitCount = 8;
bmpInfo->bmiHeader.biCompression = BI_RGB;
bmpInfo->bmiHeader.biSizeImage = height * width;
I then create the rgb pal colors:
RGBQUAD* colors = &bmpInfo->bmiColors[0];
for ( int i=0;i<256;i++ ) {
colors->rgbBlue = i;
colors->rgbGreen = i;
colors->rgbRed = i;
colors->rgbReserved = 0;
colors ++;
}
A call to CreateDIBSection() then create the bitmap. This works fine. The problem arises when I try and blt the image to an HDC.
As I understand it, I need to create a palette, select it into the dest DC via a call to SelectPalette(), then call RealizePalette, and then to draw the image I call SetDIBitsToDevice(). I do all this, and the image does get drawn, however the colors it uses don't seem to reflect what I put into the palette.
I create the palette with this code:
unsigned char* tmp = new unsigned char[ sizeof(LOGPALETTE) + (sizeof(PALETTEENTRY) * 255) ];
LOGPALETTE* pal = (LOGPALETTE*)tmp;
pal->palNumEntries = 256;
pal->palVersion = 0x300;
PALETTEENTRY* entry = &pal->palPalEntry[0];
for (int i=0;i<pal->palNumEntries-1;i++ ) {
entry->peRed = bmpInfo.bmiColors[i].rgbRed;
entry->peGreen = bmpInfo.bmiColors[i].rgbGreen;
entry->peBlue = bmpInfo.bmiColors[i].rgbBlue;
entry->peFlags = 0;
entry ++;
}
HPALETTE palette_ = ::CreatePalette( pal );
This should give me a palette with a smooth gradient from black to white (0 to 255).
When I alter the bits of a the image (I create an image of 256 pix wide and 100 tall) so that the bits of each line range from 0 to 255, I expect to see this smooth gradient, but instead I see a gradient from 0 to 127! Assigning a pixel the value of 255 instead displays an RGB value of 127,127,127. Something stupid is going on, but I just don't get it.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Hey, it helps to use the right parameters!!
Note to self: do NOT call SetDIBitsToDevice() using DIB_PAL_COLORS, which is kind of what I would expect to use, nope, instead use DIB_RGB_COLORS, and everything is fine! Woot!
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
Hi,
I'm looking for a way to convert from a unicode CString (project is in UNICODE) to a Base64 string, so I can send it via XML to a web service.
Not much luck trying to use the ATL functions... maybe someone can see what i'm doing wrong or has a sample that works ? thanks !!!
CString csTest = _T("test123");
DWORD dwLen = csTest.GetLength();
int nDestLen = Base64EncodeGetRequiredLength(dwLen);
LPSTR strEncoded = new CHAR[nDestLen];
Base64Encode((const BYTE*)csTest.AllocSysString(), csTest.GetLength(), strEncoded, &nDestLen);
//strEncoded contains: "dABlAHMAdA==ÍÍýýýýÝÝÝÝÝÝ " after conversion
LPSTR strDecoded = NULL;
int iLen = 0;
Base64Decode(strEncoded, nDestLen, NULL, &iLen);
strDecoded = new CHAR[iLen]; //iLen is 7 at this point
Base64Decode(strEncoded, nDestLen, (BYTE*)strDecoded, &iLen);
//strDecoded contains: "t" after conversion, not the original "test123"
|
|
|
|