|
Big thanks, PJ Arends. Especially for the GetClipBox function!
I will now try to draw this way.
|
|
|
|
|
Dear friends,
I'd a problem. Please see the code below.
int main()
{
ifstream infile("exclusion_set");
istream_iterator<string> input(infile),eos;
vector<string> vec;
copy(input,eos,inserter(vec,vec.begin()));
sort(vec.begin(),vec.end(),greater<string>());
ostream_iterator<string> output(cout,"\n");
unique_copy(vec.begin(),vec.end(),output);
return 0;
}
if "exclusion_set" file cotents are like this:
the and but that then are been
can can't cannot could did for
had have him his her its into
were which when with would
the output will be each word like
the
and
etc.......
But if i want to read each line in the specified vector instead of each word. How shall i do.Which parameter that i should set so that each line is read in vector element.Please help.
Thanking you,
yours sincerely,
bhadram
bhadram
|
|
|
|
|
Hi,
I'm using this wonderful Tab control :
http://www.codeproject.com/tabctrl/XPTabApp.asp[^]
my problem is that the background color of the tab control is white,and when i'm adding a window to a tab,the window background color is gray.
How can I set the Background color of the window to the tab control color?
I tried to set the transparent property of the window to true but it's not working.
Also,I tried to do this with the following:
CDC *pDC = MyWindow->GetDC();
SetBkColor(pDC->m_hDC , RGB(255,255,255));
ReleaseDC(pDC);
But again,it's not working.
anyone?
regards,
Eli
|
|
|
|
|
You can handle WM_ERASEBKGND message
|
|
|
|
|
It depends on the ... window.
Could you be more explicit ?
SkyWalker
|
|
|
|
|
hello ...
in my program i used MFC connected with ODBC.
in the interface i added some items : textboxes to show data, button to find records,and button to add records .
when i execute the program ,i connect to the database and see the interface , but no data is founded .
so please i want to know how can i show the data in the text box .
thanks
|
|
|
|
|
hi
for example ur textbox variable is m_name
and ur ODBC class for example CStudent class variable is obj
so the value of textbox is
m_name=obj.m_name;
UpdateData(false);
obj.m_name is ur database attribute
MFC programmer
-- modified at 13:42 Sunday 11th September, 2005
|
|
|
|
|
I have a matrix 100x100 which stores phases of oscillators. I need to display this matrix by using HSV color code. Please help me!
Thanks a lot!
h
-- modified at 5:08 Sunday 11th September, 2005
|
|
|
|
|
|
I tried using the Picture Box control, but it resized my icon down to 16x16, and I want to show a 64x64. Any help would be much appreciated.
Thanks.
|
|
|
|
|
Hello,
I have an xml file that uses an external dtd file for validation. The Doctype looks something like:
I will be using an xmldocument object to edit this file. Is there a way to get the dtd filename ("somefile.dtd", in this example) from the xmldocument?
I'm sure that there is a very simple answer, but I have not been able to find it.
Thanks,
-----------------
Genaro
\\\|
_ _
@ @
_\\
--|
_/
|
|
|
|
|
I figured it out...
It was really simple. In case anyone is interested, all you have to do is (doc is an XmlDocument obj):
CString dtdName = (CString)(doc->DocumentType->SystemId);
|
|
|
|
|
when you stop mouse cursor on some icon, a yellow rectangle appears near the cursor containing help texts. how can I implement this, with API functions?
|
|
|
|
|
|
Ok. I know this is really basic, but why can't I find the constructor code to open my documents from a button control? (MFC) I must be using wrong search key words, because I can't find it here. Can any one point me in the right direction?
Thanks,
RRL
|
|
|
|
|
Try to use CDocTemlate class for this purposes, OpenDocumentFile member.
You must register DocTemplate first!
Another way is to use CWinApp::OpenDocumentFile or AfxGetApp()->OpenDocumentFile instead.
|
|
|
|
|
sveige wrote:
...why can't I find the constructor code to open my documents...
For your CDocument -derived class?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Using the class CLimitSingleInstance I have managed to enusure that only one instance of my application is active.
I would like to do one more enhancement.
Whenever there is an attempt to run multiple instance the current running instance should be restored to full view.
I think it has to be done in the InitInstance() of my appln.
Can anyone suggest the procedure.
laiju
|
|
|
|
|
Hi
if your instance is already running you should call showwindow() with maximise option.
Hope it works
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
I had tried that option but the application crashes when I do that.
Given below is the implementation..
CLimitSingleInstance g_SingleInstanceObj(TEXT("{A79AAE6A-62E1-4c0e-B678-72F127AD4B03}"));
BOOL CKolOSDBuilderApp::InitInstance()
{
// InitCommonControls() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
if (g_SingleInstanceObj.IsAnotherInstanceRunning())
{
AfxMessageBox("An instance is already running");
return FALSE;
}
laiju
|
|
|
|
|
Hello,
You could post a message to the application that is already running and maximize the application from there.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
i tried using the variable theApp.m_pMainWnd to post a message ,but i think this doesnt have a valid pointer which crashes the application.
BOOL CKolOSDBuilderApp::InitInstance()
{
// InitCommonControls() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
if (g_SingleInstanceObj.IsAnotherInstanceRunning())
{
theApp.m_pMainWnd->SendMessage(WM_CLOSE_PROJECT,0,0);
return FALSE;
}
laiju
|
|
|
|
|
Remember that you post the message to your own application. You'll have to find a way to obtain the process handle of the previous application.
You can always write a DLL that is shared among your applications and store various data there...
There are a lot of ways to solve your problem!
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I sometimes use the following method to only run a single instance, I simply use FindWindow to look for the window's title.
Yes, I know if two programs have the same title this logic will fail, but that is 'unlikely'
if((hWnd = FindWindow(NULL, szTitle)) != NULL)<br />
{<br />
ShowWindow(hWnd, SW_RESTORE);<br />
SetForegroundWindow(hWnd);<br />
MessageBeep(MB_ICONEXCLAMATION);<br />
return(0);<br />
}<br />
"An education isn't how much you have committed to memory, or even how much you know. It's being able to differentiate between what you do know and what you don't." - Anatole France
|
|
|
|
|
It will also fail if the app is an MDI or SDI app that has the opened file name in the caption.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|