|
Try Removing 'Postmessage()'. Don't Post Any Msg.
-Malli...!
|
|
|
|
|
Hi,
if(m_brush!=NULL)
DeleteObject(m_brush);
bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
i have tried removing the PostMessage() and even the code given by everyone but still application is crashing.
Let me be Clear , I have Created CBrush m_MyBrush; and in OnInItDialog() function i have Created Solid Brush m_MyBrush.CreateSolodBrush(RGB(255,0,0));
In OnCtlColor()
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)
{
// Return handle to our CBrush object
return (HBRUSH)m_brush;
}
Now the RED color Has to be Changed to GREEN in OnOk() function...
I have tried all the case given by our Buddies..pls help..
|
|
|
|
|
Thank q every one its working .......Thanks for the help
|
|
|
|
|
I've got an example here. Look in the Extras section.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I had exactly (well ALMOST...) the same requirement. After many inquiries to experienced developers I finally had to find the solution for myself...
1.) Hand-edit the RC file (text mode) to set your static control to OWNER-DRAW. E.G.,
CTEXT "AUTH",IDC_StatAuth1,177,139,28,10,SS_CENTERIMAGE |
SS_SUNKEN | SS_OWNERDRAW | WS_BORDER | NOT WS_GROUP
2.) Override the OnPaint() handler (you don't need the OnCtlColor handler...) an example snippet follows fom the OnPaint() handler:
CWnd* pStat = m_pDlg->GetDlgItem(GetID());
CDC * pDC = pStat->GetDC();
CRect rect;
pStat->GetClientRect(&rect);
pDC->FillSolidRect(&rect, m_nRgbColor);
pDC->SelectObject(m_pDlg->GetMLEDisplayFont()); // Select presized font
pDC->DrawText(m_strText, &rect, DT_VCENTER | DT_CENTER | DT_NOCLIP);
pStat->ReleaseDC(pDC);
The problem is, with static controls is that the background is always drawn by the framework unless you specify owner draw, and the AppWiz (now non-existant in newer VS editions...) never thought of you wanting to owner draw a static control. Thus you have to edit the .rc file by hand.
Work good, no crash!
- Ed.
--------------------------------
|
|
|
|
|
Hi,
I am writing test cases for a project. one of the source file contains export functions along with some other class definitions and implementation. Now when i declare a class instance and invoke one of the function with possible set of parameters(by including that cpp in my application) i am getting the following error(for all the export functions)
error C2491: 'VXItelInit' : definition of dllimport function not allowed.
How to go about this.
Subramanyeswari
|
|
|
|
|
subramanyeswari wrote: Now when i declare a class instance and invoke one of the function with possible set of parameters(by including that cpp in my application)
You should not include the .cpp the file but the .h file. Because .cpp files contain the definitions of the functions declared in .h file.
Definitions are included when you link to the dll . So no need for .cpp files here.
Nibu thomas
Software Developer
|
|
|
|
|
The .h file contains one structure definition and 4 export function declarations. No other class definitions whereas the .cpp file contains the class definitions(ex..VXItelImpl is a class defined in .cpp and its implementation is also there in .cpp)not .h file. We write test cases for the four export functions. Now we have to cover the other class definitions and implementations which are declared in .cpp.
So i can't avoid including the cpp or is there any other option.
Regards
|
|
|
|
|
subramanyeswari wrote: (ex..VXItelImpl is a class defined in .cpp and its implementation is also there in .cpp)not .h file.
This is bad.
I can suggest you this. Since you are having both .cpp and .h files you can remove the export qualifiers for classes as well as functions.
Nibu thomas
Software Developer
|
|
|
|
|
Hello Subramanyeshwari !
you just try to separate your implementation part and definition part using .cpp files and .h files. Did you check that your .cpp file has been include in more that one file? And try to put some code description over here to get more clarity !
-Malli...!
|
|
|
|
|
can i hide a modal dialog box while opening the .exe?
JAYARAJ
|
|
|
|
|
|
what is conversion regular from int to dotted ?
|
|
|
|
|
inet_ntoa()
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
hey,
i need to create a web browser control for my app. i'm using mfc, and don't want to use .net's web browser control (unless i can statically link it).
ive searched the articles and found a few things, but they are all pretty complicated. i don't need to display the page, just connect to a server and store the html code in a string.
is their a simple way to do this?
thanks in advance,
sam kline
|
|
|
|
|
If you are using webbrowser control, when load completes you must use IHTMLDocument and related interfaces to retrieve the code but in your case, my recomendation is to use sockets to connect to the server, send it the minimal http request header and parse the response.
I believe it can be less complicated and avoid webcontrol dependency.
Best regards,
Mauro.
|
|
|
|
|
Have a look at the MFC internet class - CInternetFile etc. They will let you download a web page as a CFile object that you can just call Read() on to get the page data.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
|
thats what i used.
thanks & nice article.
Sam Kline
|
|
|
|
|
How can I add a carriage return at the end of a CString?
|
|
|
|
|
CString s;
s += _T("\n");
s += _T("\r\n");
Steve
|
|
|
|
|
Thanks a lot. I don't know why I didn't think of that.
|
|
|
|
|
isn't \n\r work or \r\n ..!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
It depends on what the string will be written to. If it's a text file, use \r\n uness you're going to be using the C I/O functions, in which case use \n and let the CRT change it to \r\n on its own. For multi-line text boxes, use \r\n .
\n\r is never right.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|