|
(assuming you are using Visual Studio )
before running of to buy a software, use what's available from VC++, first, be sure to run in debug mode, then, use the predefined macro DEBUG_NEW to replace new , and _malloc_dbg to replace malloc .
those 2 things will help you get a better view at what's going on with memory allocation.
If you really want to go deeper and find other potential problems, try either purify or boundschecker , both work well.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
As somebody else already mentioned, the MFC is a good enough for most purposes. By default an MFC app will show leaks when your application exists, but if you want to track memory leaks over a shorter period, you can use the CMemoryState MFC class - which is the what the default behaviour employs.
HTH
Martin
|
|
|
|
|
Hi,
I am building a project (where multiple dsp's Debug Info is set as Program Database for Edit & Continue) using VC++ editor.At the time of linking I am getting a linker error (LNK1201)
LINK : fatal error LNK1201: error writing to program database "prj.pdb" ; check for insufficient disk space
I found the root cause of the problem as below.
" There is a limit of 4096 modules (.obj files) in a PDB file. The file also has a total size limit of approximately 64 MB - From MSDN"
Here my prj.pdb file size exceeds 64 MB. Now my query is, Is there any way to increase the size of this file? Or I have to set the Debug Info as Line Numbers only for some DSP's. So that the size of the file will be decreased.
Thanks in Advance.
Regards,
Pearl
|
|
|
|
|
clean and rebuild the project
or delete pdb file and buld
|
|
|
|
|
Hello,
is it possible to create GDI+ Bitmap objects in an array? Everywhere else are code examples like this one:
Bitmap myPNG(L"gfx/spiral.png");
graphics.DrawImage(&myPNG, 150, 200);
How can myPNG be an array?
Bitmap myPNG[10];
This will produce an error C2512: no appropriate default constructor available.
Any ideas?
Thanks in advance!
|
|
|
|
|
|
rh005 wrote:
How can myPNG be an array?
Use an array of pointers and new each of them separately. Make sure you delete them afterwards though.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I am writing a simple, dialog-based application. I thought to use OnInitDialog to create all the image objects and be able to use them in OnPaint.
This will not work because the objects are discarded at the end of OnInitDialog.
What can I do? (Looks more like a C++ problem and not a GDI+ issue
|
|
|
|
|
rh005 wrote:
What can I do?
Exactly what I said before - use an array of pointers to Bitmap s. Call new on each one of them separately in OnInitDialog() if that's where you want to create them. Just don't delete them until the dialog destructor or something like that.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Sorry, to bother again, but this does not seem to work:
Bitmap *myimages[2];
LPWSTR image_filenames[] = {L"gfx/c01.png", L"gfx/c02.png"};
BOOL CMyDlg::OnInitDialog()
{
...
myimages[0] = new Bitmap(image_filenames[0]);
myimages[1] = new Bitmap(image_filenames[1]);
...
}
void CMyDlg::OnPaint()
{
...
Graphics graphics(dc);
graphics.DrawImage(myimages[0],10,10);
graphics.DrawImage(myimages[1],60,10);
...
}
The images are not drawn. When I put myimages = ... into OnPaint, it works. What am I missing?
|
|
|
|
|
Ok, now I feel really stupid: I did not initialize GDI+ :/ Now it works.
|
|
|
|
|
i am having a problem with displaying a text in editbox in a edit box in a dilog basaed applicatiopn in vc++
ihtesham
|
|
|
|
|
|
There must be a IDENTIFIER for you edit Box like IDR_EDIT1 .
In WIN32 based API
just call this API for setting text in Edit Box
SetDlgItemText(Dialog Handle, Identifier as I told you above, Text to display);
IN MFC
Just add the CString variable for Edit box.
Way to add variable ->
Right Click on Edit Box (in resource view) ->class wizard->member variable
Add a m_str variable from add variable Button.
Now in function where you want to put data into the Edit Box
//first Fill the Variable
m_str="amirzeb";
//this function call will put value in dialog
UpdateData(FALSE);
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
if ur application is dialog based then u may used
GetDlgItem(ID_UR_EDIT)->SetWindowText("what u want to diaplay");
here this function reduces number of varialble declaration and UpdateData() is need not call to refresh ur app.
urs
kiran.s
kiran kumar.s
|
|
|
|
|
HI frnz,
I am beginner.I am in process of doing a Reminder tool in VC++,can anyone help me reg System tray apps..I am able to retrive and Delete a Specific reminder entered but i need that app to keep on running..so i need info reg system tray app..or anyone could help me with Reminder source code as i can understand more
waiting for ur earliest reply
|
|
|
|
|
|
|
hi Alok,
i have a problem...i used ur way of Creating system tray icons ..but whenever i bring my mouseptr to the application Icon(in sytem Tray) ,it get disappeared but the Application is running in Taskbar...what can i do ?? help me
|
|
|
|
|
The usual MDI interface involves Document-View and an MDIChildWnd right? I want to attach the View not on Frame Windows but on Control Bars... For Example i want to put my View on a Control Bar that looks like a the Solution Explorer on Visuall C++ .NET..
Has anyone made a public code for this? or read an article regarding this one?
"the possibilities are endless...."
|
|
|
|
|
Search for docking windows in CP here lot more examples availabel
|
|
|
|
|
Hello Friends,
I am using Rich edit controls in my application and for that reason I am using AfxInitRichEdit() member function for their initialization. So Whenever my application executes a beep sound is played which I don't require it. One of my friend told that the beep sound may be due to AfxInitRichEdit() member function and it is one of the disadvantage. If it is right then please help me regarding this matter How can i stop the beep sound without removing the Rich edit controls.
Thanks in advance.
Neelesh K J Jain.
|
|
|
|
|
Is anybody knows?
c++ : my dream
|
|
|
|
|
Hello Friends,
a beep sound is coming whenever my application is started. I don't want to have this beep sound.
BOOL CMMTRansApp::InitInstance()
{
AfxEnableControlContainer();
AfxInitRichEdit();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MMTRANS_MENU,
RUNTIME_CLASS(CMMTRansDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMMTRansView));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
return TRUE;
}
when I debugged it I had found that When the if condition
if( !ProcessShellCommand(cmdInfo))
is executed the beep sound is coming. The same application is not giving any beep sound for my other application. Please help regarding this matter how to stop this beep sound.
thanks in advance.
Neelesh K J Jain.
|
|
|
|
|
a. does anyone know how to push a frame in the middle of a stream?
b. suppose I have a stream with a given size of frames, now I want to replace the first N frame with other frames, how do I do that and keep the rest of the frames unchanged? (starting to write again from start causing the player to think there are only the new N frames)
thanks,
Guy.
|
|
|
|