|
Read files that are in the EXE (as a resource), or read files using an EXE?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hi all,
i m write code on OnCtlColor function for color the controls.
HBRUSH CMyPropertyPage2::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor);
switch (nCtlColor)
{
case CTLCOLOR_EDIT:
pDC->SetTextColor(RGB(0,0,0));
pDC->SetBkColor(RGB(255,255,255));
return hbr;
case CTLCOLOR_STATIC:
LOGBRUSH logbrush;
m_brush.GetLogBrush( &logbrush );
pDC->SetTextColor(RGB(0,0,0));
pDC->SetBkColor(logbrush.lbColor);
return m_brush;
case CTLCOLOR_BTN:
case CTLCOLOR_MSGBOX:
case CTLCOLOR_DLG:
return m_brush;
default:
return m_brush;
}
}
when i use this same code for dialog box its working fine,but in case of property pages its not working fine.
the problem is that its not color the background of RadioBox,CheckBox,GroupBox type controls.
please help me for this.
and tell me solution for this.
thanks in advance
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
I don;t know the answer to your probklem, but I know where I'd start looking...
Spy++. Keep an eye where the messages go - maybe to the propertysheet, maybe to the propertypage... But you can find out!
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Actully i dont understand that you say i have no idea of SPY please explain me.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Well, in VC6, it's a program under the tools menu, and it exists in later versions of Visual Studio also.
It monitors messages between windows, so you can see for yourself where messages end up.
(It's called Spy++ - sorry if I misnamed it before).
It takes a little practise to use, but it's very powerful.
Good luck,
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
i m using VC2005.
thanks.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi,
We have planned to convert the project from VC++6.0 to VC+.net .
But i have no idea about this.
Is there any problem will come by converting or any tutorila is available for this?
Pls help me.
Anu
|
|
|
|
|
This[^] blog post on MSDN has links to a number of topics that should help you.
|
|
|
|
|
Is there any articles which help me to connect with a sqlite database using VC2008?
And how will I include dll/lib files to my project?help me.
|
|
|
|
|
CodeProject has a Database articles section (hidden on the "Chapters" pane on the left side...)
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi,
I am able to display Images in Lisbox one by one in single column.I want to Display Images as rows and columns.Can anyone suggest me how to do it.
Rekha.
modified on Saturday, February 21, 2009 4:43 AM
|
|
|
|
|
A list control (CListCtrl [^] in MFC) is much easier to use for that purpose.
|
|
|
|
|
As already told CListCtrl would be a better choice.
But if you still want to use list box Look here[^]. This link was already given to you for your previous post, doesn't it help?
Regards,
Sandip.
|
|
|
|
|
Hi there,
I'm new to C++ and i've got a basic project i've made up, just to play around with templates. It consists of the following classes:
- enumerable (used much like IEnumerable in .NEt Framework code)
- list<Type> [inherits from enumerable] (provides basic add & remove alongside initial sizes)
- keyValuePair<KeyType, ValueType> (is a simple struct with 2 properties - key and value...
- dictionary<KeyType, ValueType> [inherits from list] (is a list, which uses keyValuePair
No error appears to occur until the end of my program exection. At this point the program simply hangs while executing my final instruction:
delete [] pDict;
My program currently does something no more complex than adding a few initial items to a dictionary, retrieving a list object filled with keys and then cleaning up... So I pause the debugger, it warns me:
The process appears to be deadlocked (or is not running any user-mode code). All threads have been stopped.
and it then points me to:
dbgrpt.c (line 360 - 363):
nCode = __crtMessageBox(szOutMessage,
_T("Microsoft Visual C++ Debug Library"),
MB_TASKMODAL|MB_ICONHAND|MB_ABORTRETRYIGNORE|MB_SETFOREGROUND);
and points out that the line containing _T("Mi... is where the error occured. As far as i can understand, this portion of the "dbgprt.c" file displays an assertion failed error message. In case that helps any:
szOutMessage = "Debug Assertion Failed!
Program: ...iversity for the West of Scotland\Samples\Debug\Templates.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgdel.cppLine: 52
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.
(Press Retry to debug the application)";
I then proceded to search MSDN documentation and found nothing specific to help me... Unfortunately searches of this forum didn't help me get any further so here is my question:
Where should I look? and what should I be looking for as possible sources of the error?
I've checked for un-initialised variables, memory leaks, and ensured (i think) all functions that return a value have a variable to be copied into so as to clean the stack... and so far all seems fine.
Thankyou for reading.
|
|
|
|
|
First question: Was pDict allocated as an array, i.e.
pDict = new pDictType[size]; You are using the array delete syntax (delete []pDict ). If pDict is a simple pointer, then using the array delete will Do Bad Things.
Other than that, the general things I can suggest are to step through the code and ensure that you're not walking over something in the stack. The symptom you are describing (all threads exited) sounds like a stack overwrite.
|
|
|
|
|
Thanks for the resonse (and sorry about the delay) Yes, pDict was initialised as an array.
would you know of any areas or topics I might want to look into to refrence, or is it purely experience and luck :p
|
|
|
|
|
If the program is simple (your description made it sound like that was the case), single-stepping through it and verifying that each statement does exactly what you think it does is a valid approach. Look for side effects, possible buffer overruns, and things like that.
Barring that, you might post some of the code here, and let us have a look, if it's not horribly lengthy.
The STL container classes can occasionally be a double-edged sword. They are very capable, but I've seen folks do some foolhardy things with them (think void pointers, up and down casts, and that sort of thing).
|
|
|
|
|
I've just re-validated all of my code and found that your initial conclusion was correct - I intended to use a dictionary object, not an array called dictionary causing me to use the wrong delete statement...
Thankyou very much for your help - it has been much appreciated.
|
|
|
|
|
|
Wow - this was a freakin awesome feel-good thread
|
|
|
|
|
Yes it was; this is the way the programming forums are supposed to work.
Someone asks a reasonable question, showing that they did the work but are having trouble.
They follow the suggestions or respond with more details if asked.
They say "thank you" (that's a big one for me).
I've avoided the C++ forum in recent months, partly due to lack of time and partly because it had become a swamp of "do my homework for me" and "plz urntz send codez now!" posts.
|
|
|
|
|
Hi
I need to use a flexgrid in which i will be able to enter only Hexadecimal characters
from 0 - 9 and A - F (Capital letters only),which proprty should i use here in this case. Also i have to resize the column by clicking in the border of two columns heading just as we do in windows.
Please provide the comments.
modified on Saturday, February 21, 2009 9:46 AM
|
|
|
|
|
Hi,
I have developed program in which I am creating window.I want to maximize window size before its creation.Can anyone suggest me.
Rekha.
|
|
|
|
|
Override the PreCreateWindow method in the main window class.
Add the WS_MAXIMIZE style to the style member of the CREATESTRUCT parameter like so.
cs.style |= WS_MAXIMIZE
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi,
I have overriden PreCreateWindow like this.But I am unable to create maximized window.
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
cs.style &= ~FWS_ADDTOTITLE;
cs.style |= WS_MAXIMIZE;
return TRUE;
}
|
|
|
|