|
Marriage slows down your coding, a baby slows it down even more!
thats something really true ,
actually marriage changes lots of things??
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hi!
For some reason, when I'm calling SetBkColor on a device context, the color is just not changing. I've used this function dozens of times in other programs I've written and it's always worked. I have no idea why it isn't working now.
So my code looks like this:
SetBkColor(the_HDC, RGB(100, 255, 255));
TextOut(the_HDC, 100, 100, text, strlen(text));
The text draws fine, but it's always black. The variable 'text' is frequently changed, and always draws correctly, but the color does not change from RGB(0,0,0)
I'm not using double-buffering in this program so the HDC drawn to is the one the user is looking at. What could be wrong?
Thanks!
Kelly Ryan
|
|
|
|
|
SetBkColor sets the background color. Have you seen SetTextColor?
--
I've killed again, haven't I?
|
|
|
|
|
.... I guess I shouldn't be coding on 2 hours sleep with the flu.....
Thanks... I've only used the darned thing like 50 times...
Geesh... I need to go to bed, sorry for wasting your time.
Kelly Ryan
|
|
|
|
|
No problem!
Heck, I spent two days this week looking for some kind of weird regex parser/token extractor combo, then realized "strspn" did all I needed... and I'm healthy, well-rested, and just coming off a week of vacation!
--
I've killed again, haven't I?
|
|
|
|
|
I need C++ code to solve exercises below:
• First, read the text file and show 8 choices for an operator.
• 1) Make a list for first “N” word of frequency repeated.
• 2) Make a list for even “M” word that close to each other.
• 3) Word count.
• 4) Paragraph count.
• 5) Witch paragraph is the largest one – show it by first 3 letter and number of that paragraph.
• 6) Sentence count – each sentences are up to “Dot point”.
• 7) Get a word from operator and after search, show how many used.
• 8) Get a list of words and after search, show how many used by percent.
I am Pouya Vatanpour, from Iran and I study in a college of computer science.
I used Deitel book – programming with C++ 2editin - up to chapter six.
I am waiting for your help and so many thanks if you tell me more ASAP.
Best Regards,
vatanpour@msn.com / vatanpoor@gmail.com
Pouya
|
|
|
|
|
I really hate to tell you this, but you will get more help if you try doing your own homework first. Then ask specific questions.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
The least you could do is to not word it like a homework assignment. Show some initiative, and then ask specific questions. You'll get tons more help that way. See here for more.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
What puzzles me is why people opt for a Computer Science course and then don't want to write code.
|
|
|
|
|
Nishant Sivakumar wrote: What puzzles me is why people opt for a Computer Science course and then don't want to write code.
They think learning computer programming is easy and earns big bucks.
-Prakash
|
|
|
|
|
pvatanpour wrote: Witch paragraph is the largest one
How do you know she's a witch ?
Sorry, I don't usually make fun of people who can't spell, especially people who don't speak English. However, more than anything, you need to do your own homework, and you need to learn to look things up on the web. There are a million sites only a google away with all the info you need to do this stuff.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
And, should he suffer the paragraph to die?
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I'm trying to detect if I currently have a connection to the network either over LAN or wireless. If I use IsNetworkAlive, it returns TRUE even if the wireless card is removed from the machine, there is no cable in the wired adapter and there are no active dialup connections. If I disable the wired LAN adapter from control panel, the function works as expected.
Any ideas on how I can test for network TCP/IP connectivity without disabling any adapters? IsDestinationReachable won't work for me because the application will be run behind a firewall.
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Is this of any help?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
That's what I've been using for a reference, none of the other methods really seem to apply to me.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
How can I do to include ActiveX Controls to a MFC DLL Project, because when I do that in a dialog and execute this, the dialog isn`t show, thanks
|
|
|
|
|
|
|
# Improve performance and ability to work directly with hardware
# Fit into the real world
This two are more important for me as i work in Embedded domain
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
Hello there,
I have a dialog based application which has two classes, CMainWindow and CChildWindow. I want to create the ChildWindow from the MainWindow, from inside a thread.
My code snippet.
static UINT CMainWindow::_ShowChildWindow(LPVOID parameter)
{
CMainWindow *mainWind = (CMainWindow*) parameter;
mainWind->ShowChildWindow();
return 0;
}
CMainWindow::ShowChildWindow()
{
m_childwindow = new CChildWindow();
m_childwindow->Create(IDD_CHILDWINDOW);
m_childwindow->ShowWindow(SW_SHOW);
}
CMainWindow::OnButtonShow()
{
AfxBeginThread(_ShowChildWindow,this);
}
The newly created window just blinks and vanishes.
Please help me!
Regards
|
|
|
|
|
you need a message loop. See CWinThread::Run for more information.
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
Hello there,
I have a dialog based application which has two classes, CMainWindow and CChildWindow. I want to create the ChildWindow from the MainWindow, from inside a thread.
My code snippet.
static UINT CMainWindow::_ShowChildWindow(LPVOID parameter)
{
CMainWindow *mainWind = (CMainWindow*) parameter;
mainWind->ShowChildWindow();
return 0;
}
CMainWindow::ShowChildWindow()
{
m_childwindow = new CChildWindow();
m_childwindow->Create(IDD_CHILDWINDOW);
m_childwindow->ShowWindow(SW_SHOW);
}
CMainWindow::OnButtonShow()
{
AfxBeginThread(_ShowChildWindow,this);
}
The newly created window just blinks and vanishes.
Please help me!
Regards
|
|
|
|
|
you dont have the message pump in the _ShowChildWindow
i.e.
MSG msg;<br />
<br />
while (GetMessage(&msg, NULL, 0, 0)) <br />
{<br />
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) <br />
{<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
}
-Prakash
|
|
|
|
|
Hello Prakash,
It works the window pops up and stays. But it does not receive any key events. what could be the problem?
Regards
|
|
|
|