|
How I can know all the memory ram is it using my application? There are any function?
|
|
|
|
|
VietDelphi wrote:
How I can know all the memory ram is it using my application?
Read this article and see if you still want to ask that question.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Sorry, but i need a function which i press a button it return me the current size of my process.
thanx you so much!
|
|
|
|
|
You're not going to find such a function. At best you'll get an approximation. When you alllocate and then deallocate memory, the amount "charged" to your application does not immediately go down. That's the point the article I pointed you to (near the bottom) was trying to make. For an example, see my reply here. You can also try walking your process' heap.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Does GetProcessWorkingSetSize() help? See MSDN for more info.
Bikram Singh
|
|
|
|
|
Hello! Everyone I am new to MFC programming So i was
wondering if it is possible to use Multiple Dialogs in an
MFC project?
Any links/tutorials will be helpful!
Thankyou for reading
$TELOPHASE$
|
|
|
|
|
kun_911 wrote:
...is possible to use Multiple Dialogs in an
MFC project?
Sure. You can have one, a dozen or a hundred. However many it takes to solve the problem.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
yes ...
you can use one modal at a time, or multiple modeless dialogs at a time.
Any links/tutorials will be helpful!
look around here at CodeProject, you might find something.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Anton Zarubin wrote:
How to get access to the letters in the outbox folder (Microsoft Outlook)
Like this (using Outlook automation):
_Application app;
_NameSpace ns;
COleVariant vtOptional((long) DISP_E_PARAMNOTFOUND, VT_ERROR),
vtTrue((short) TRUE);
MAPIFolder folderOutbox;
_Items itemsMessages;
if (app.CreateDispatch("Outlook.Application") == TRUE)
{
ns = app.GetNamespace("MAPI");
ns.Logon(vtOptional, vtOptional, vtTrue, vtTrue);
folderOutbox = ns.GetDefaultFolder(4);
itemsMessages = folderOutbox.GetItems();
...
}
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I had some c (not c++) files which I put into a win32 dll project and compiled. The h file looks like:
KLEINRAYC_API int
RAY_KLEIN_CC
(params_t * params);
and the .c file has the same thing in it:
KLEINRAYC_API int
RAY_KLEIN_CC
(params_t * params)
{
}
I compiled this and used the resulting .lib and .dll files in another project (where I did #include for the .h file and linked to the .lib file in project settings). However the linker says:
error LNK2001: unresolved external symbol "__declspec(dllimport) int __cdecl RAY_KLEIN_CC(struct CAD_CAC_params *)" (__imp_?RAY_KLEIN_CC@@YAHPAUCAD_CAC_params@@@Z)
Now I had done the exact same thing with another dll except the files in that one were .cpp (not c) and that doesnt cause any problems.
What do I need to do with this .c dll to make the linker happy?
Thanks,
sb
|
|
|
|
|
The solution is to change files in the project you're using the DLL in.
Try using extern "C" keyword in all declarations in the DLL header file of the new project. This marks all functions and variables inside the DLL to use C-linkage. The default is to use C++-linkage, and it will cause problems with C DLL's, like you've seen.
Does it compile properly now ? Any new errors ?
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
That was exactly the solution!!! I was worried I would have to go the loadlibrary route. Many thanks,
sb
|
|
|
|
|
How can develop the multiple clipboard using c++ (like Word...)?
Thanks
|
|
|
|
|
|
Hi,
I'm creating an MDI application in MFC but I need to display different views which correspond with some user setting. But I can't figure out how to display two different views in the same frame window. So I want to display either view A or view B, not both at the same time. Is this even possible?
|
|
|
|
|
Try using splitter windows
|
|
|
|
|
But won't the user be able to move the splitter back and forth?
What I exactly want is to have view A be visible with some combo menu selection, and view B being visible with another combo menu selection
|
|
|
|
|
If that's the only difference between both views, try loading the contents of the combo box at runtime!
Then this would be the case:
Step 1: Create the window and one or more CDoc's. (Keep the window invisible)
Step 2: Load the contents of the combo box dynamically (probably in OnInitialUpdate) according to your specifications.
Step 3: Show the window.
Good luck!
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
This is for SDI, but can be adapted to SDI
the basic idea is to create all views and hide all but the one visible. The Doc/View architecture already takes care of managing multiple views (if used correctly)
Clickety[^]
or maybe our friend[^] can help
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
To build an MDI application with two views
1. Build an MDI application by using MFC AppWizard. AppWizard will create a skeleton MDI application with a single view.
2. Add a new class derived from the CView class.
3. Add debug and nondebug versions of the GetDocument function.
Use the GetDocument functions from your existing view class as a model.
4. Include the header file for the document class in the source file of the new view class.
5. Place the command handlers in the CChildFrame class.
It is easier to access the view or the document from CChildFrame rather than from the view class. Use the CFrameWnd::GetActiveView and CFrameWnd::GetActiveDocument functions to access the views and the document.
6. Add a handler for the OnDraw event of the new view class.
At this point, you must decide whether you want users to select the type of view at application startup, or whether you want to have your application start with a default view. In either case, the user can select another view at run time.
void CMainFrame::OnWindowItalics()
{
if (0 == m_pItalicsTemplate)
{
m_pItalicsTemplate = new CMultiDocTemplate(
IDR_XXXXTYPE,
RUNTIME_CLASS(CXXXXViewsDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CItalicsView));
}
CMDIChildWnd* pActiveChild = MDIGetActive();
CDocument* pDocument;
if (NULL == pActiveChild ||
(pDocument = pActiveChild->GetActiveDocument()) == NULL)
{
TRACE0("Warning: No active document.\n");
AfxMessageBox(AFX_IDP_COMMAND_FAILURE);
return; // command failed
}
CFrameWnd* pFrame = m_pItalicsTemplate->
CreateNewFrame(pDocument, pActiveChild);
if (NULL == pFrame)
{
TRACE0("Warning: failed to create new frame.\n");
return; // command failed
}
m_pItalicsTemplate->InitialUpdateFrame(pFrame, pDocument);
}
|
|
|
|
|
After a serialization problem which occured because of changes in sp6, I now ran into another problem with regard to localized resources.
With sp5 I could create my application using US English resources in appwizard and then change into any language I wanted for any resource I needed from the properties dialog of each resource.
Now, whenever I make the change, I get garbled letters!!!
Anybody else ran into this? Any way around it?
Have no fear of perfection - You will never reach it
|
|
|
|
|
Does anyone have experience of using HP_HEADERSORTARROW? I am assuming that it should be used with DrawThemeBackground. I have found that it is not supported in any of the standard XP styles, so I am having to draw my own header arrow. Onw thing I would like to know is how to use it, so I can have code in there which uses it when available.
This though means that if the text doesn't fit next to it then the arrow draws over the top of it. I don't really want to draw anything I don't have to, ie text, background, just to get the arrow.
What I'm really after is an XP-styled sort-header control.
Any ideas?
"The way of a fool seems right to him, but a wise man listens to advice" - Proverbs 12:15 (NIV)
|
|
|
|
|
OK, I've done a bit more searching, and found out that I can use HDF_SORTUP and HDF_SORTDOWN. See this[^] and this[^].
"The way of a fool seems right to him, but a wise man listens to advice" - Proverbs 12:15 (NIV)
|
|
|
|
|
I can't seem to find an official way to add new keywords to the C++ highlighting engine. Are there any unofficial tricks you'd like to share?
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|