|
|
Go to project Settings, Alt+F7, and in the right pane, select the file, then select the C++ tab and in the precompiled header category, select not using precompiled header.
This should solve your problem.
cheers
Daniel Cespedes
"There are 10 types of people, those who understand binary and those who do not"
"Santa Cruz de la Sierra Paraiso Terrenal!"
daniel.cespedes@ieee.org
|
|
|
|
|
|
I posted a message board similair to it but I just don't understand can anyone tell me how to CLEAR the recent file list in detail..
<marquee>Universal Project
|
|
|
|
|
You've asked this same question twice before, but have not indicated if the suggestions have helped, or what you have tried/not tried. Show us some code of what is not working and we can guide you through it.
|
|
|
|
|
Hi guys,
Does anyone how to create a pointer to the document class while you are in the mainframe class.
Raj
|
|
|
|
|
GetActiveDocument() does that!
|
|
|
|
|
Use: AfxGetApp()->m_pDocManager
Here is an modified example that may help:
void MyApp::InvalidateAllViews()
{
POSITION pos = m_pDocManager->GetFirstDocTemplatePosition();
while( pos )
{
CDocTemplate* pTemplate = m_pDocManager->GetNextDocTemplate(pos);
POSITION pos2 = pTemplate->GetFirstDocPosition();
while( pos2 )
{
CMyDoc* pDoc = (CMysDoc*)(pTemplate->GetNextDoc(pos2));
if( pDoc )
{
POSITION pos3 = pDoc->GetFirstViewPosition();
while( pos3 )
{
CMyView* pView = (CVMyView*)(pDoc->GetNextView(pos3));
pView->Invalidate();
}
}
}
}
}
INTP
|
|
|
|
|
Hi,
I have the code from CodeProject on Framegrabbers which is written in VC++ (MDI).....
it displays the video in the view class, how can I display the video in a dialog?
Ehsan Behboudi
|
|
|
|
|
Hi,
I have a (read-only) Rich Edit box and I need both bold and normal text in it, as it displays helpful information about my app under various titles (so I want the titles in bold and the main text not in bold). I've seen this done, but I have no idea how to go about having one long string containing different format.
At the moment I am just using SetDlgItemText to set the text in the Rich Edit box...
Any help much appreciated.
Oh, and I'm using the straight WinAPI SDK with _no_ MFC, btw.
Many thanks,
KB
|
|
|
|
|
You'll need to select the appropriate text with the EM_EXSETSEL message. Then, you can set that selection's font using the EM_SETCHARFORMAT message.
|
|
|
|
|
Thanks! Works perfectly.
Thanks again,
KB
|
|
|
|
|
With CFrameWnd I can simply insert status bar by CStatusBar x(this) in OnCreate. But with CWnd it doesn't work. What else have I to do?
|
|
|
|
|
hi..
firstly you should define indicators names,like that.
static UINT indicators[] ={ID_SEPARATOR};
then you must add "ID_SEPARATOR" to string table on your project.Lastly You must write this code in OnCreate.
m_wndStatusBar.Create(this);
m_wndStatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT));
it is not enough what you had only created for that.
Good Work.
|
|
|
|
|
Why indicators...you don't have to set them when constructing a status bar....the problem is: it's working with CFrameWnd, with CWnd it is not.
|
|
|
|
|
Hi,
I am working with the common CFileDialog and I want to set the initial "File name:" editbox to something like "myfile.txt".
I know I can do this with the lpszFileName of the CFileDialog class when constructing, but I would like to set it using the OPENFILENAME structure instead. To be honest, this LPTSTR thing is really bugging me now and I am determined to get it to work...but I do need some help
I have tried to set lpstrFile, but the app crashes. This is how I have tried to set it so far :-
//it crashed when I did this
CString theString( "This is a test" );
LPTSTR lpsz = new TCHAR[theString.GetLength()+1];
_tcscpy(lpsz, theString);
my_file_dlg.m_ofn.lpstrFile = lpsz;
//so I tried this and again it crashes
CString str("myfile.txt");
LPSTR ptr = str.GetBuffer(11);
my_file_dlg.m_ofn.lpstrFile = ptr;
Thank you for any pointers or guidance.
Michael
|
|
|
|
|
Have you looked at the CFileDialog constructor?
CFileDialog dlg(TRUE);
char szFile[MAX_PATH] = "myfile.txt";
dlg.m_ofn.lpstrFile = szFile;
dlg.m_ofn.nMaxFile = sizeof(szFile);
dlg.DoModal();
|
|
|
|
|
That worked just fine.
Now I feel a little humble (i.e stupid) as to how easy the solution was.
Thanks for your help. I think I need to take a break
Michael
|
|
|
|
|
lpstrFile is also used to return your user's selected file(s). The reason your app is crashing is because the buffer you are supplying is too small. Also, you have to set the nMaxFile member to the same size as your buffer. According to MSDN, the buffer should be at least 256 characters.
TCHAR buffer[256] = {0};
_tcscpy(buffer, _T("MyFile.txt"));
my_file_dlg.m_ofn.lpstrFile = buffer;
my_file_dlg.m_ofn.nMaxFile = 256;
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Hi guys,
I just want to know how you attach an existing view when creating a new ChildWnd
When using CMDIChildWnd::Create, it doesn't specify which view it wants to use. Maybe there is another funciton.
Thank you respectfully
Raj Qbus Surendra
|
|
|
|
|
Hi,I have two MFC (MDI) projects written in VC++ 6.0, Project1, Project2
I would like to call the axcutable file of project2 in one of the menu options of project1. What is the code to do that?
How can I have a pointer from project1 to the Doc and View class of project2 in order to access its functions????
Ehsan Behboudi
|
|
|
|
|
mr2003 wrote:
I would like to call the axcutable file of project2 in one of the menu options of project1. What is the code to do that?
Use ShellExecute() or CreateProcess().
mr2003 wrote:
How can I have a pointer from project1 to the Doc and View class of project2 in order to access its functions????
Either put the common code in a DLL that both EXEs can use, or have EXE1 post a message to EXE2.
|
|
|
|
|
thanks for the help...
I have another question,, say in the menu of program1, i have to following function,,
CPogram1View:: OnFile_CallProgram2_FunctionXXX()
{
//I want to be able to call that specific function of program2..
// how can I do that?
}
Ehsan Behboudi
|
|
|
|
|
Did you consult the documentation for the two functions I mentioned?
|
|
|
|
|
I use this code to call one process from other
char* program="project2.exe";
//llama al proceso EcoSG.exe y deja el proceso llamador en espera
_spawnl(P_WAIT,program,program,arguments,NULL);
Daniel Cespedes
"There are 10 types of people, those who understand binary and those who do not"
"Santa Cruz de la Sierra Paraiso Terrenal!"
daniel.cespedes@ieee.org
|
|
|
|