|
Reinstalling VC++ didn't work.
|
|
|
|
|
The error message is explained here[^]. Can you quote the exact message?
Steve
|
|
|
|
|
C1900 is not a linker error, but a compiler error. Have you tried Googling for C1900?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I am attempting to document my code and its turning into a huge mess. The syntax for doxygen is making my code look terrible as theirs so many commenting styles now and I have parts of the code that the user does not need to be aware of that doxygen automatically adds. For example I have a structure and even with no commenting it shows up on the modules page and variables.
I also dislike how the functions are in random order, their should be a way to define their order as having the init() 3rd from the bottom makes no since.
Can anyone recommend a site that shows an empty source file and section by section they add the commenting and go over how to include/exclude variables & functions and how to modify the generated HTML layout?
Documentation is a project onto itself isn't it...
|
|
|
|
|
Just pass the headers to your interfaces through Doxygen - then only things that matter to the users of your code will be documented. Things like internal implementation details won't show up. Then you can concentrate on presenting your interfaces using Doxygen and you won't have to worry about any dirty implementation details.
Cheers,
Ash
|
|
|
|
|
I like to have clean header files that just give the relevant data and functions to the user, I use to just block document the header but figured as things got more complex I should use doxygen as then I can give examples and everything is in a organized place. Do you guys usually keep a copy of the header with all the doxygen markups and then include a clean unmarked copy with the library or something as my header looks like confetti.
|
|
|
|
|
To be honest I don't tend to use Doxygen anymore - I find a decent set of unit tests usually works better to describe how to use something. However when I did use it a couple of years ago everything got piled in a single copy of the interface files. I've never tried it but I can imagine things getting a bit hairy and hard to keep synched if you keep two versions of things.
Cheers,
Ash
|
|
|
|
|
|
Thanks for that link, I just discovered Natural Docs. It was created with exactly what I had in mind, generate help files from human readable in code comments!
Doxygen comments where cryptic to read in code with all its //! \bried /** */ stuff going on but Natural Docs has a very natural layout. I changed a few wordings in my existing comments and I got nice clean output. Also it has a proper walk through which is nice.
I recommend you guys check it out.
http://www.naturaldocs.org/[^]
|
|
|
|
|
Hi,
I have bitmap with a white background and a yellow arrow I would like to convert the background to gray
So I have the following code
CBitmap *bm = new CBitmap;
bm->LoadBitmap((UINT) IDD_BITMAP);
CDC *cdcwindow = this->GetDC();
CDC cdcimage;
cdcimage.CreateCompatibleDC(cdcwindow);
CBitmap *oldbit = cdcimage.SelectObject(bm);
cdcimage1.CreateCompatibleDC(&cdcimage);
cdcimage1.SelectObject(bm);
cdctrans.CreateCompatible(&cdcimage);
CBitmap bmask;
bmask.CreateBitmap(bm_struct.bmWidth,bm_struct.bmHeight,1,1,NULL);
cdctrans.SelectObject(&bmask);
COLORREF clr = cdcimage1.GetPixel(0,0);
cdcimage1.SetBkColor(clr);
cdctrans.BitBlt(0,0,bm_struct.bmWidth,bm_struct.bmHeight,&cdcimage1,0,0,SRCCOPY);
cdcimage.SetBkColor(RGB(125,125,125));
cdcimage.SetTextColor(RGB(255,255,0));
cdcimage.BitBlt(0,0,bm_struct.bmWidth,bm_struct.bmHeight,&cdctrans,0,0,SRCCOPY);
stgm.hBitmap = (HBITMAP)*bm; get bit map handle
later on when I use the bit map handle in "OLE" it sets the bitmap as all yellow
|
|
|
|
|
Would not CDC::FloodFill() be easier to use?
Select your image into a device context, FloodFill it, unselect it from DC.
|
|
|
|
|
unchaged still has white background
here is my code
CBitmap *bm = new CBitmap;
bm->LoadBitmap((UINT) IDD_BITMAP);
CDC *cdcwindow = this->GetDC();
CDC cdcimage;
cdcimage.CreateCompatibleDC(cdcwindow);
CBitmap *oldbit = cdcimage.SelectObject(bm);
cdcimage.SetDCBrushColor(RGB(125,125,125));
COLORREF cr = cdcimage.GetPixel(0,0);
cdcimage.FloodFill(0,0,cr);
bm = cdcimage.SelectObject(oldbit);
later stgm.hBitmap = (HBITMAP)*bm;
|
|
|
|
|
You are filling it with the color you had at (0, 0). That will change nothing.
The color (last arg in FloodFill) should be the new color value. As far as I see, you dont need the GetPixel() call at all.
|
|
|
|
|
Thought it filled it with the Brush okay thankx
|
|
|
|
|
How does it know How much to fill I only want to fill the BackGround
|
|
|
|
|
It will fill every pixel adjacent to the given pixel that has the same original color recursively. It will not touch pixels containing other colors, and not groups of pixels not 'connected' to the original 'pixel group'.
|
|
|
|
|
Thakx I appreciate your help
|
|
|
|
|
Filled the entire bitmap all white
from the MSDN doc says that area will be filled with the current brush till the color boudry
I would think boudry is the RGB of the yellow arrow
Here is the code
CBitmap *bm = new CBitmap;
bm->LoadBitmap((UINT) IDD_BITMAP);
CDC *cdcwindow = this->GetDC();
CDC cdcimage;
cdcimage.CreateCompatibleDC(cdcwindow);
CBitmap *oldbit = cdcimage.SelectObject(bm);
cdcimage.SetDCBrushColor(RGB(125,125,125));
clr = RGB(125,125,125);
cdcimage.FloodFill(0,0,clr);
bm = cdcimage.SelectObject(oldbit);
MFC Library Reference
CDC::FloodFill
Fills an area of the display surface with the current brush.
Copy
BOOL FloodFill(
int x,
int y,
COLORREF crColor
);
Parameters
x
Specifies the logical x-coordinate of the point where filling begins.
y
Specifies the logical y-coordinate of the point where filling begins.
crColor
Specifies the color of the boundary.
reading the doc on MSDN for Flood fill says it will fill the Color with the Current
brush
|
|
|
|
|
ForNow wrote: reading the doc on MSDN for Flood fill says it will fill the Color with the Current brush
The brush they speak of is the pattern. In your case you want a solid brush (filling every pixel) which is the default brush of a DC. You don't need the SetDCBrushColor call for FloodFill to work.
|
|
|
|
|
commentend out the SetDCBrushColor still getting a all white picture I am going to
CBitMap::GetBitmapBits and look at memory to see whats the bitmap looks like GetPixel just got the first byte
there is something strange here
thankx again
|
|
|
|
|
Hello,
I'm trying to write a asynchronous server that accepts (non-blocking) clients receives data from the client and reponds.
I have managed to write and get it to work a single threaded server blocking & a multithreaded server that blocks also. But now I have to make one that doesn't block and only a single thread.
I know that I setup the socket to async mode with ioctlsocket(). but after that how do I do a non-blocking
listen() & accept(). Also I have been reading that I need to use select() for when a client needs to read, write, etc...
I have been staring at the following example at CP (Code Project) at Programming Windows TCP Sockets in C++ for the Beginner[^]
which is a great example, but mine is console based. So I understand that code for the most part. But since I'm not use MFC with it just C or C++ it is a little a different and I could really use some help. any help will be greatly appreciate, and ty in advance.
Gemini S....
|
|
|
|
|
This[^] isn't a bad example of how to use select() in a traditional C application. There's only one non-portable thing in there as far as I can tell and that could be easily replaced.
Hope that helps,
Cheers,
Ash
|
|
|
|
|
Hi, can you tell if you have a specific question or rather want to be pointed to some examples?
/M
|
|
|
|
|
If I could get a specific example of how to use an asynchronous socket ( I know how to create), but how do I use it to get/send information to the client and it has to be non-blocking. That would help greatly thank you.
Gemini S.
|
|
|
|
|
Here is the theory: An asynchronous server will notify you when something interesting happens, e.g. about a new incoming connection, when data could be sent, or data could be received on a socket. So you do not have to to start a new thread for every incoming client connection. Instead you can handle many sockets within a single thread context, on Windows for example WSAAsyncSelect[^] will notify you if any of your socket status changes (see FD_READ and FD_WRITE ).
Here are two practical examples with source code:
- Programming Windows TCP Sockets in C++ for the Beginner[^]
- CAsyncSocketEx - Replacement for CAsyncSocket with proxy and SSL support[^]
Btw, there are also a couple of C++ network libraries with asynchronous sockets. You sounded like you wanted to implement it on you own, so just wanted to let you know that there are working solutions.
Happy coding
/M
|
|
|
|