|
Just add a call to AfxEnableControlContainer(); function at the begining of InitInstance (of your app class).
|
|
|
|
|
I would like to use SVG to render some gauges to a HWND in a MFC app.
Unfortunately I haven't found a C++/MFC library. Amanith seems to be interesting, but it doesn't seems to be embeddable into a MFC app, only in Qt apps.
What I would like to do is create a scene from markup and then animate it. The scene have to be rendered to a HWND or HDC.
Any example where SVG is displayed in a MFC app?
Thanks
|
|
|
|
|
This might not be exactly what you're after, but you could embed an html control, and render the SVG in that
|
|
|
|
|
IE6 requires a Plug-In to render SVG, not sure about IE7. Firefox does support SVG, but I would like to add SVG support to my app rather than relying on a 3rd party app.
Anti-Grain looks promising, but I'm not sure if it can only render static scenes or also supports animations. I would like to render the gauge from markup and then animate the needle.
http://www.antigrain.com/svg/index.html[^]
|
|
|
|
|
I want to open "browse dialog box" on some button click event. Is there any predefined class for that in MFC? Or I need to create the same?
|
|
|
|
|
Aryan S wrote: browse dialog box"
CFileDialog
See here for a browse dialog
-- modified at 8:08 Tuesday 29th August, 2006
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
SHBrowseForFolder a dialogbox for select folder
CFileDialog m_File(True for File open False for File save)
|
|
|
|
|
Here is function that displays browse for folder dialog...
bool CDlg::GetFolder( CString& csFolderName_o )
{
try
{
BROWSEINFO stBrowseInfo = { 0 };
stBrowseInfo.hwndOwner = GetSafeHwnd();
stBrowseInfo.lpszTitle = _T( "Select a folder..." );
LPITEMIDLIST lpItemIDList = SHBrowseForFolder( &stBrowseInfo );
if( 0 == lpItemIDList )
{
return false;
}
TCHAR szFolderName[MAX_PATH];
if( FALSE == SHGetPathFromIDList( lpItemIDList, szFolderName ))
{
return false;
}
csFolderName_o = szFolderName;
return true;
}
catch( ... )
{
return false;
}
}
|
|
|
|
|
My MFC Application Takes 100% of CPU that i viewed from the TASK MANAGER.What is the Reason the Application Takes 100 % of the CPU?
|
|
|
|
|
Can you be more specific its not sufficient for answer,what your application
|
|
|
|
|
I Created some TOOL using MFC.When i run the Tool , you see that task manager takes 100% CPU time.The problem related to Memory?
|
|
|
|
|
The MFC Exe that reads the Data from database and display it in list control.
|
|
|
|
|
How to read data from database and insert to list ctrl?I'm not sure but i guess your problem is it?
|
|
|
|
|
What does the relevant code snippet look like?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Arul Joseph wrote: My MFC Application Takes 100% of CPU that i viewed from the TASK MANAGER.What is the Reason the Application Takes 100 % of the CPU?
I guess your application is trapped inside a loop which simply doesn't exit. Debug through your code and find out.
|
|
|
|
|
It'll be better that you debug it and see wich part is trapped and taking all the cpu. That's the only way to find it, all the rest we could say will be a lottery.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Simple answer: "Because that's what you programmed it to do."
With the information you provide, we can only guess.
Probably your application is sitting in a loop waiting for a keystroke or reading a file until EOF or something like that.
You could use debugger with profiler to see where (what function) the application spends most time.
|
|
|
|
|
How to Hide / Disable a list control while processing / adding items to the list control?
Thanks
Raji
|
|
|
|
|
See EnableWindow
m_List1.ShowWindow(SW_SHOW/*SW_HIDE*/);
|
|
|
|
|
RajiRaghu wrote: How to Hide / Disable a list control while processing / adding items to the list control?
WhiteSky answered your question.
Have you tried SetRedraw which is meant for exactly these kind of problems. I guess you don't want your list control to flicker or look wierd when you insert items into.
So just before the lengthy process of insertion begins just call SetRedraw( FALSE ) ,
and after finishing with the process just call SetRedraw( TRUE ) . Do call Invalidate on the list control to get it fully repainted.
|
|
|
|
|
Hi.
I write one application
i have one button(browse) when click on it, it call CFileDialog.DoModal().
When user chose a file, the dialog thake the name and call to save it to another file
void CRgnDoc::MyFileSaveFunction(int i,CString filename)
{
m_iStart=i; //int
m_strSongPath=filename; //CString - separate string and save like
//integer
OnSaveDocument("OneClock.one");
}
my Serialize function look like this
void CRgnDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{ // storing code
int i;
i=m_strSongPath.GetLength();
ar<<i;
for="" (int="" j="0;j<i;j++)
" {
="" int="" k="m_strSongPath.GetAt(j);
" trace("%c",k);
="" afxmessagebox("asw");
="" ar<<k;=""
="" }
="" ar<<m_istart;
="" else
="" {="" loading="" code
="" i,ch;
="" ar="">>i;
for (int j=0;j<i;j++) {
="" ar="">>ch;
m_strSongPath=m_strSongPath+(char)ch;
// TRACE("%c",ch);
// AfxMessageBox("asw");
}
ar>>m_iStart;
}
}
when call
MyFileSaveFunction(), Serizlize() don't want to save my file
byt if i call MyFileSaveFunction(4,"test") withought call CFileDalog befor that it work correct and everithing is save
Meto
-- modified at 7:19 Tuesday 29th August, 2006
|
|
|
|
|
m1m2 wrote: Serizlize() don't want to save my file
What do you mean ? What goes wrong ? Have you gone through debugging ?
m1m2 wrote: OnSaveDocument("OneClock.one");
OT: I am not used to writing MDI/SDI Apps, so this is maybe wrong, but calling an event handler function seems weird to me.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Find it
when i browse for a file
it change curren directory and save file in another plase
|
|
|
|
|
m1m2 wrote: i have one button(browse) when click on it, it call CFileDialog.DoModal().
When user chose a file, the dialog thake the name and call to save it to another file
Why? When the document saves its data, you will be presented with a Save As dialog where you can select the file to save to. It sounds as though you are reinventing the wheel.
m1m2 wrote: OnSaveDocument("OneClock.one");
This function is called by the framework as part of the File Save or File Save As command. It is not called directly.
m1m2 wrote: MyFileSaveFunction(), Serizlize() don't want to save my file
The Serialize() method is used simply to get the data to/from the document from a CArchive object. It has no knowledge of files or where the data comes from. That's the document's job.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|