|
|
Thank you, i'll take a look!
|
|
|
|
|
Hi
I have created a Dialog based application using VC++ 6.0. I have set the main dialog to NOT have a title bar and system menu. Unfortunately, this also remove the icon in the Windows taskbar when the application is running. Is there a way I can get round this problem? My endusers demand that the icon be seen next to the application name in the taskbar.
Thanks in advance
|
|
|
|
|
I removed the title bar and system menu in a test app I just wrote (I did it in the resource editor), and the icon still appeared on the task bar. All I had to do extra was make sure I called SetWindowText on the dialog with some meaningful text so the taskbar button wasn't blank.
Chris Richardson Terrain Software
|
|
|
|
|
Thanks for your quick reply.
I already did the SetWindowText call. Unfortunately, the icon in the taskbar only shows the text, not the picture (icon?) next to it (like MS Word or Exchange etc.). It is documented to only show the text if I have remove the System Menu. That's why I am looking for a workaround. Also, while the icon may be seen when you run your application in MSVC, it will not show the picture in the icon on another PC.
|
|
|
|
|
Hmm, sounds pretty strange. What styles are you using on your dialog? Also, if it will show on your PC but not on another PC this sounds like some strange difference in behavior between the two operating system setups.
Chris Richardson Terrain Software
|
|
|
|
|
|
Hi All
i have the following code which im using to find particualr
words within a string (m_tts_message), however the below
only works when there is only one string to search for, in this case its "truant", however i want it to search m_tts_message for several words not just one.
can ne1 help
thakns
si
char *pdest;
char str[] = "truant";
int result;
pdest = strstr( m_tts_message, str );
result = (int)(pdest - m_tts_message + 1);
if ( pdest != NULL )
AfxMessageBox("found");
else
AfxMessageBox("not found");
|
|
|
|
|
You said CString (which is a MFC and also a ATL classs) when instead you used char*.
With CString, it would look look somewhat like this:
CString m_tts_message("truantjflsdlflsdfjtruantjdsfölsdlkjfdlskflkjstruantkgökfkfksdöf");
CString str ("truant");
int found = 0;
int result = m_tts_message.Find(str, 0);
while (result != -1)
{
if (result>-1)
found++;
result = m_tts_message.Find(str, result+1);
};
if ( found>0 )
AfxMessageBox("found");
else
AfxMessageBox("not found"); }
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
hi, thanks for the reply
i think im confusing you,
if m_tts_message contains "your child is absent from school and is playing truant"
m_tts_message contains a message which schools will send to parents
of there child, however i need to restrict them from using certain words
or phrases theres about 20 different words which cannot be used
i need to scan that (m_tts_message) looking for any of the reseverd words or phrases; which cannot be used
so in the above case i would be looking for the words "truant" and "absent" to see if either of them can be found
so consider the problem with the reseverd words/phrases: truant| absent
not in school|not at school|truant|truanting|truancy
thanks is advance
si
|
|
|
|
|
si_69 wrote:
..need to restrict them from using certain words..
Such as f*beep*uck, cu*beep*nt and so on?
You could make a std::vector<std::string> of the list of forbidden words and use your algorithm size() times, keeping track of which word was found (and maybe where it was found).
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Code looks okay. Post the code that does multiple searches.
Kuphryn
|
|
|
|
|
You need to do a seperate search for each word.
|
|
|
|
|
I have develop an SDI application where I have more that one
CView derived class and I switch them using the following
code:
CView* CMyDoc::SwitchToView(CView* pNewView)<br />
{ <br />
CFrameWnd* pMainWnd = (CFrameWnd*)AfxGetMainWnd();<br />
CView* pOldActiveView = pMainWnd->GetActiveView();<br />
ASSERT(pOldActiveView != NULL);<br />
ASSERT_VALID(pOldActiveView);<br />
<br />
ASSERT(pOldActiveView->GetDocument() == this);<br />
<br />
if(pNewView == pOldActiveView)<br />
{<br />
return NULL;<br />
}<br />
<br />
::SetWindowLong(pOldActiveView->m_hWnd, GWL_ID, 0);<br />
::SetWindowLong(pNewView->m_hWnd, GWL_ID, AFX_IDW_PANE_FIRST);<br />
<br />
pNewView->ShowWindow(SW_SHOW);<br />
pOldActiveView->ShowWindow(SW_HIDE);<br />
<br />
AddView(pNewView); <br />
RemoveView(pOldActiveView);<br />
pMainWnd->SetActiveView(pNewView);<br />
pMainWnd->RecalcLayout();<br />
<br />
return pOldActiveView;<br />
}
The problem is that windows messages are sent (by the framework)
only to the Default CView derived class (the one created with
Doc and Mainframe classes).
When a change View... the news one doesn't receive any windows
messages.
Which could be the problem ???
Thanks a lot!
|
|
|
|
|
Hi,
Can anybody help me with my problem?
How to load RTF file with pictures in CRichEditCtrl?
Thanks in advance !
|
|
|
|
|
Are you wanting to save the contents of a CRichEditCtrl to an RTF file?
|
|
|
|
|
Ok, here is what I know how to do and what I need to do:
I know how to insert picture (BMP) file in my CRichEdit.
I also know how to save the contents of the CRichEditCtrl as RTF file.
I need to load a RTF file with pictures (BMP) in it, in my CRicheEdit control,
but I don't know how to do that.
Can you help me?
Thanks!
Yasen
|
|
|
|
|
... Again the Active Directory newcomer ,
I want to create several groups ( e.g. Marketing, Sales, ...), and I want to associate to each group a database connection string. How can I do that using ADSI ?
Thanks
Braulio
|
|
|
|
|
hi, G. Steudtel
i am having a problem. could u try to solve that for me?
i want to mail that sample project to u as an attachment..
can i get ur mail id please?..(tell me how to attach the zip file
to u) my mail-id cpbalaji2000@yahoo.com
problem in short:
*****************
I want to draw the RichTextControl content in a specified rectangle on my printing page (as i done with editbox control) using FormatRange function with the different Font styles as in RichEditControl - HelpMe please!.
DrawRichText(CDC *pDC) -> could u solve the problem that i have in this function ?..
Balaji
|
|
|
|
|
Can anybody help to clarify my problem:
ofstream* fName[6];
for (int j = 0; j < 6; j++)
{
CString filename;
filename.Format("file%d.txt", j);
fName[j]->open(filename, ios::out | ios::trunc);
}
results in:
<br />
C:\Program Files\Microsoft Visual Studio\MyProjects\Solver2D\SpringSolver.cpp(820) : error C2228: left of '.open' must have class/struct/union type<br />
<br />
|
|
|
|
|
ofstream* fName[6];
for (int j = 0; j < 6; j++)
{
CString filename;
filename.Format("file%d.txt", j);
fName[j] = new ofstream;
fName[j]->open(filename, ios::out | ios::trunc);
}
|
|
|
|
|
Ah Ha!
Thank you.
|
|
|
|
|
1. MFC dialog app is created
2. 2nd modeless dialog is created with extended style WS_EX_APPWINDOW, it's then shown and updated. The parent is set to null or desktop with SetParent(NULL) or SetParent(GetDesktopWindow())
3. Main dialog window is minimized, and as it is, the taskbar space for the non-modal disappears and the non-modal dialog is also minimized
4. NO, i repeat NO messages at all are sent to the non-modal dialog such as you would expect (ex. WM_SIZE message).
My Question is simple, what the heck is going on? How does one stop MFC from stealing the non-modal dialog's messages and reducing it automatically and removing it's taskbar space?
So far no one has been able to answer this, and I've posted it a couple times.
hey
|
|
|
|
|
Beer wrote:
So far no one has been able to answer this, and I've posted it a couple times.
Which might be an indication that no one has an answer.
|
|
|
|
|
DavidCrow wrote:
Which might be an indication that no one has an answer
I guess I was secretly hoping somebody was going to pull out their secret MFC internal mapping chart they swiped from the MS complex in Washington and answer this eventually, but alas, it doesn't seem to be happening
hey
|
|
|
|