|
I have a class with an abstract member function-
virtual void foo( obj& ) = 0;
and I have implemented this in the derived class. However, whenever I try and call a member function (which incidentally is derived from the base class publically also) from within the derived class one, I get an error message that the this argument (which I understand is passed implicitly in any member function call) discards qualifiers. Im not sure what im doing wrong and what these qualifiers are even...
thanks in advance,
Chris M
|
|
|
|
|
It would help if you post the code and the error message. It's probably talking about "CV-qualifiers" which means "const" and "volatile". If you call a method that specifies a const this pointer, you can't then call another method that doesn't have a const this. For example:
class xyz
{
int nonconstthis() { return 1; }
int constthis() const { return nonconstthis(); }
};
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Hi all, having succesfully created/loaded a 24-bit DIBSection and managed to access "the bits", I now need to display it transparently. The program loads a DIBSection from file (so say a photo), and I want to then draw another 24-bit DIBSection over it. However, using BitBlt it just copies the bitmap over it (obviously since I use the SRCCOPY flag), black background included, and you can`t see the photo anymore. Having looked at Christians article I tried using the following code to incorporate TransparentBlt :
HBITMAP hOldBitmap = (HBITMAP)dcMem.SelectObject(bm);
TransparentBlt(pDC->m_hDC,0,0,bm.bmWidth,bm.bmHeight,dcMem.m_hDC,0,0,bm.bmWidth,bm.bmHeight,0);
dcMem.SelectObject(hOldBitmap);
dcMem.DeleteDC();
However, I get the following error message:
BitmapView.obj : error LNK2001 : unresolved external symbol _imp_TransparentBlt@44
Debug/Dissertation.exe: fatal error LNK1120:1 unresolved externals
Error executing Link.exe
Dissertation.exe - 2 error(s), 0 warning(s)
Also, I have noticed in the MSDN that TransparentBlt should only be used with 4 or 8 bit bitmaps, and have tried using AlphaBlend, which is supposed to be for 32-bit bitmaps, but I get a similar message. Can someone please tell me where me or my computer are going wrong? Much appreciated.
Alan.
P.S. Any chance you know how to initialise a 24-bit DIBSection so that its background is white, not black? (Without iterating through "the bits") I`ve asked this question a couple of times, no-one seems to have a clue.
AEGC
|
|
|
|
|
TO make it white just select the DIBSection into a CDC and bltblt onto it using WHITENESS instead of SCRCCOPY.
My code for TransparentBlting is called TransparentBltU, you're trying to use the standard windows function, and for some reason you're finding the header but not the library. I assume you're talking the code from WDJ. Internally that function shows how to generate a mask on the fly.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
How do i get the library? do i have to re-install it? Would you mind if I used an implementation of your code from the WDJ site? (I was talking about that - couldn`t remember site name off top of my head though).
Cheers for the response, again, Christian,
Alan.
AEGC
|
|
|
|
|
HI.
I´m developing a database application using ADO and, although it´s a large program i don´t want to use more than 2 or 3 open connections.
The problem is that i can´t define a global connection pointer, right now, i can only make it work creating a new con in every cpp file.
I´ve tryed defining a global pointer in every way i know but I´m allways getting memory or even weirder errors.
Can anyone help me out?
Pedro Besteiro
LSI systems integration
|
|
|
|
|
Global variables are the work of the devil, but if you must, the best way is to make it extern in stdafx.h, and declare it in stdafx.cpp. Assuming you're using MFC, I'd put it in CMainFrame, because a pointer to that class is so easy to get ahold of from anywhere in your application - CMainframe * pMain = dynamic_cast<CMainFrame*>(AfxGetMainWnd());
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
I want to lock Internet Temporary folder. Don't permiss IE save any file to this folder!
If you have any infor please show it for me!
|
|
|
|
|
I have not tried this out. But you could rename it temporarily and then rename it back. Poor IE wont be able to write into it, because it won't exist. But you never know, perhaps it will create it again.
Nish
|
|
|
|
|
If you're using NT, you should use NTFS. If you are using NT and NTFS it's obvious: Don't give anyone but "System" any access whatsoever to the temp folder.
Please report how hard MSIE crashed.
/Mike
|
|
|
|
|
- How to modify the color of the caption of a button(not including the background of the button)?
- Regards,
Maer
|
|
|
|
|
Two ideas:
- handle WM_CTLCOLORBTN (MSDN: "By responding to this message, the parent window can set a button's text and background colors")
- use ownerdraw buttons (see BS_OWNERDRAW )
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
- Thanks, Paolo pal!
- I have never used "WM_CTLCOLORBTN" before (even not heard it). Since I am a newbie, can you show me an example?
- Have a nice weekend,
Maer
|
|
|
|
|
See this link:-
http://support.microsoft.com/support/kb/articles/Q130/9/52.ASP
WM_CTLCOLORBTN is not valid anymore.....
p.s. I first put this in the wrong thread...
|
|
|
|
|
See this link:-
http://support.microsoft.com/support/kb/articles/Q130/9/52.ASP
WM_CTLCOLORBTN is not valid anymore.....
|
|
|
|
|
- Thanks for your URL, Nish pal!
- I have never used the messages before, can you show me an example about the useage?
- Have a nice weekend,
Maer
|
|
|
|
|
- Sorry for interrupting again, Nish pal!
- I still have a question. After reading the article you introduced to me, it seems that we can not use these messages now. Are there any other methods to change the color of the caption of the button?
- Have a nice weekend,
Maer
|
|
|
|
|
see this link
http://www.codeproject.com/buttonctrl/cbuttonst.asp
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
- Thanks pal!
- The article will be great help to me.
- Have a nice day,
Maer
|
|
|
|
|
- Please help!
- Regards,
Maer
|
|
|
|
|
Is it possible to create a window that will render HTML, something like internet explorer. As our product is dependant on the version of the common controls dll that comes with IE5 I know IE5 will be installed so can I actually use the 'Internet Explorer_Server' window class. I am restricted to the Win32 API so the MFC solutions such as CHTMLView are not available to me. Any information you can provide would be greatly appreciated.
Steve.
|
|
|
|
|
I need my program to register itself as a service
I tried (RegisteSrviceProcess)
but it doesn't work with Win2000
so I need a way to do it (way that works with Win2000)
thanks in advance
MR.Byte
|
|
|
|
|
CreateService();
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
A small update...
Something like:
schService = CreateService(
schSCManager,
TEXT(SZSERVICENAME),
TEXT(SZSERVICEDISPLAYNAME),
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS,
SERVICE_DEMAND_START,
SERVICE_ERROR_NORMAL,
szPath,
NULL,
NULL,
TEXT(SZDEPENDENCIES),
NULL,
NULL);
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Under VC++, I made a DLL as -Win32 Dinamic Link-. It has only one ".C" file containing the DLLMain two Function and the callback function. The first function loads the callback function and the second function unloads the callback function. Here is how the callback is loaded:
HHOOK hhGetMsg;
HINSTANCE hInstance;
LRESULT CALLBACK GetMsg (int iCode, WPARAM wParam, LPARAM lParam);
{
hhGetMsg = SetWindowsHookEx (WH_GETMESSAGE, (HHOKPROC) GetMsg, hInstance, 0);
}
with the GetMsg sending messages to a window everytime a message pops-up. There are no filters so all messages are SUPPOSEDLY "trapped". I used SendMessage to avoid a mess. Also calls CallNextHookEx.
I have looked at other codes that SUCCESSFULLY loaded a system-wide hook and My code are basically Identical. But my hook only monitors the APP/.EXE that loads it! I don't get it! The DLL and its functions are loaded from the APP/.EXE using LoadLibrary and GetProcAddress.
Need help! Thanks in advance.
|
|
|
|