|
Thanks for your reply. Inline functions are not a problem with DLLs since the implementation has to be inside the header files, which means that the source code is available and can be inlined by the compiler, so no problem there.
The solution you are proposing is exactly what the macro from my post would do (the macro would just add the benefit that it is transparent to client code because it would provide the semantics of a regular const). But I found it hard to believe that C++ offers no built-in solution. I mean, the standard allows inlining of functions, but it doesn't seem to be able to inline constants. Well, I guess I'll just have to bite the bullet and live with it then.
Thanks again,
Peter
|
|
|
|
|
Hi,
I am working on a search engine project.
If any one has C++/VC++ sample code for interacting with IFilter to create indexes for list of PDF file, please share with me.
I searched the net but unable to find any thin on C++/VC++.
Thanks in advance.
Regards,
Ramachandraraju KK
|
|
|
|
|
Hello,
I am trying to concatenate several icons from an apps' resource file into a larger (wider only icon), that I can use to display on the statusbar with:
SendMessage(hWnd,SB_SETICON,0,(LPARAM)hIcon)
The icons are located in the app's resource file and are loaded hIcon1, etc... hIcon7. All icons are 16 x 16 (in color).
Based on some changeable preferences the icons being concatenate may be 1,3,4 or 1,2,5,6 etc.
I am looking for a routine that will concatenate 2 icons passed in and return a handle to a new icon on exit that has the two concatentated. Calling this several times will satisfy what I am trying to do. I would appreciate any assistance in this area since I am not a bitblt or dc guru and have know idea on how to get this to work, win32 c++ only.
Thanks,
|
|
|
|
|
I am sorry to keep asking questions abut this, but:
HDC dc; HBITMAP bm;
----- set up the bitmap; I now know how to do this, I think -----
Please how do I link the device context to the bitmap so that I can write to and read from the bitmap using TextOut(dc,----) etc? Do I use SelectObject(), or what?
|
|
|
|
|
Take a look at this article.
Hope this helps,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Thanks; but I have been writing my own software to handle Windows graphics images and graphics files for many years. I merely need to know how to link an existing bitmap (as identified by its HBITMAP handle), to a device context (HDC), so I can use TextOut(dc,----) etc to write text to the graphics image in the bitmap identified by the hbitmap. Thanks.
(I learned Windows programming in the old days; I do not use classes, except some classes which I wrote for myself.)
Thanks for answering the various queries that I have asked here in the past.
|
|
|
|
|
Oh, I see. You just use:
SelectObject(hdc, bm);
Where hdc is the Device context handle (HDC) and bm is the bitmap handle (HBITMAP).
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Anthony Appleyard wrote: Please how do I link the device context to the bitmap so that I can write to and read from the bitmap using TextOut(dc,----) etc?
Like this?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
How can I find the size of a file without opening it? Or if I do have to open it, how can I open it and get the file size when it is already open by another application?
|
|
|
|
|
|
The FindFirstFile() API works fine.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have Windows Vista.
I am writing an image-handling section in a program. The parts relevant here are:
SIZE sz; char T[256]; BITMAP bm;
// Next I set bm.bmType=0; bm.bmWidth=bm.bmHeight=840; bm.bmWidthBytes=2520,
// bm.bmPlanes=1; bm.bmBitsPixel=24; bm.bmBits = address of the bit pattern of an image;
HBITMAP hbm=CreateBitmapIndirect(&bm);
// which should put in hbm a copy of the bit pattern bm
// Here a test showed that hbm!=0
GetBitmapDimensionEx(hbm,&sz);
sprintf(t,"hbitmap is %d * %d",sz.cx,sz.cy);
MessageBox(0,t,"size",MB_OK);
//which showed that sz.cx == 0 and sz.cy == 0, i.e. the bit pattern in hbm is size 0 * 0, and not as in bm.
Please what may be wrong?
|
|
|
|
|
You should use GetObject() to get the bitmap's dimensions, not GetBitmapDimensionEx().
From the GetBitmapDimensionEx() docs:
"The retrieved dimensions must have been set by the SetBitmapDimensionEx function."
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
I am implementing an TFTP server application.
As far as I know a server can not send any data to client until it asks for it.
Till that time it will be in listening mode.
But is there any chance that the server can send any simple command to client with out the initiation of client.??
Please help me.
Regards,
Sunil Kumar
|
|
|
|
|
I strongly doubt it. That poses a lot of security risks.
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
sunilkumar.d wrote: But is there any chance that the server can send any simple command to client with out the initiation of client.??
what client? How does the server know of a client until the client connects? This is somewhat of constant in the concept of client-server computing, servers are known, clients are not.
led mike
|
|
|
|
|
Probably you should not be talking of client-server model
The server has no idea of the client till the client connect to it .
Though TFTP being light weight & using UDP , it cannot know who the client is
Vikas Amin
UNITED STATES STEEL CORPORATION
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
Hi all,
How can I convert a number to binary?
For example when I write 10, 1010 appears.
Thanks all.
|
|
|
|
|
You never convert a number to binary, a number is a number and is independant of how you 'present'it. I guess what you want to do is create a string representing your number in binary notation, right ?
If that is the case, you can use itoa[^] with a base of 2.
|
|
|
|
|
And this[^] article has good info about conversion between Binary,...
|
|
|
|
|
Wow, it looks like an awfull article Why the hell would you want to rewrite those parsing functions ?
|
|
|
|
|
Cedric Moonen wrote: Why the hell would you want to rewrite those parsing functions ?
A academic learning exercise.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
The new job need to programming for ATM XSF, newbie to it.
Wanna know a place to discuss or learn.
Any help would appreciate!
|
|
|
|
|
fantasy1215 wrote: ATM XSF
XFS... Not here
fantasy1215 wrote: Wanna know a place to discuss or learn.
see here[^]
This is a VC++/MFC forum dude...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi!
The following code shows error.
protected:
virtual int_type uflow()
{
int_type v = base_type::uflow();
count_ += egptr() - gptr();
int p = count_ * 40 / size_;
if (p > prev_perc_)
{
std::cout << "*";
prev_perc_ = p;
}
return v;
}
The errors are:
error C2146: syntax error : missing ';' before identifier 'uflow'
error C2433: 'TestGUIApp::int_type' : 'virtual' not permitted on data declarations
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
warning C4183: 'uflow': missing return type; assumed to be a member function returning 'int'
error C2065: 'int_type' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'v'
error C2065: 'v' : undeclared identifier
error C2653: 'base_type' : is not a class or namespace name
error C3861: 'egptr': identifier not found
error C3861: 'gptr': identifier not found
How do I resolve these errors?
|
|
|
|