|
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
|
|
|
|
|
The behaviour you are talking about is by default. To solve the problem you could create your modeless directly as the child of the desktop window. Then you would need to manage the communication between the dialogs wich, i'm afraid, could raise some problems.
rechi
|
|
|
|
|
directly how?
you mean without using a dialog resource, or without using CDialog?
My modeless dialogs are already made with CDialog, and it would be an overhaul to change them.
Is there some way to intercept MFC and selectively stop it's internal message handling?
hey
|
|
|
|
|
Beer wrote:
Is there some way to intercept MFC and selectively stop it's internal message handling?
Theoretically it is possible by intercepting PreTranslateMessage but i don't know if it works in this case.
Beer wrote:
directly how?
Check this sample:
CModelessDlg *pdlg=new CModelessDlg;
CWnd *pMan=new CWnd;
pMan->Attach(::GetDesktopWindow());
pdlg->Create(IDD_DIALOG_MODELESS, pMan);
pMan->Detach();
delete pMan;
pdlg->ModifyStyleEx(0, WS_EX_APPWINDOW);
pdlg->ShowWindow(SW_SHOW);
where CModelessDlg is the CDialog derived. You have to manage the pdlg pointer
rechi
|
|
|
|
|
rechi,
thanks for all your help, apparently it had to be created with the desktop window pointer.
hey
|
|
|
|
|
AHHHH!!!
I finally got it, you have to create the dialog with the desktop as the parent and not set it as the parent later
dlg->Create(IDD_DIALOG, GetDesktopWindow());
Boy do i feel stupid
hey
|
|
|
|
|
Hi,
I'm new to Active Directory... so don't know if what I'm saying it's an stupid thing or can be done easier in some other way...
The idea it's when I launch my application, take the current logging and ask active directory if he is in the group of users that can access to any of the servers database.
If he is in that group, then he can access to a fileshare ( readonly for him), where the application will read from an XML file which is the connection string of the database that he can access ( there are different database depending on the department of the company), so the login process would be automatic. I thought about Active Directory because of security issues, it seems that the network administrator is the only one that can handle the permissions and...
My questions are:
- To retrieve the current user logged in, should I use the API ? It is possible to get it from the Active Directory ?
- How can I add a FileShare to an existing group ?
- Could it be possible to have the connection string information in the Active Directory database instead of in an external file ?
Thank in advance, greetings
Braulio
|
|
|
|
|
I see the tutorial connection to mysql server using vc++ but i dont know how to include mysql++. How to install mysql++ api and how to run it so that i can connect.
lau
|
|
|
|
|
hi there..
i included the MFC Libs in the project .. and the symbols were all linked..
but this came along and that too in hundreds..
error LNK2005: _strncpy already defined in libcd.lib
plz help..thanks
|
|
|
|
|
You are including a lib which already #includes or declares the strncpy (I would bet on a #include<string.h>. Remove that #include from your code.
~RaGE();
|
|
|
|
|
yes got it..
hey one more thing rage..
VCF1Ctl.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CVCF1Control::CVCF1ControlFactory::UpdateRegistry(int)" (?UpdateRegistry@CVCF1ControlFactory@CVCF1Control@@UAEHH@Z)
any ideas about this one?
kindest regards
safee
|
|
|
|