|
Brilliant!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
1. See the comments in MSDN on operator new[^].
2. Not that I am aware of, as I have never run into this problem.
It may well be that you are going in the wrong direction with this issue. You need to go back to your application and try to determine why you are running out of memory, rather than trying to find out how much may be available.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
I have 4 CWinThread objects which are wrappers for 4 CAsyncObjects I commented out the creation of these objects and still I get an out of memory when trying to do the create for the modeless dialog box
I am going to start post to see if there are any plug-in to the Visual Studio debugger which track Heap storage
Thanks
|
|
|
|
|
You have changed your explanation of the problem from your original post; where did this modeless dialog come into the equation? As I said above, you really need to spend some time going through your code to find out where (and why) you are using all this storage.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Sorry I was getting exceptions and wasn't sure truth is I didn't check the return codes
I just did some reading in a Book MFC internals and there is a section there about memory leaks using the CMemoryState functions
I am going track the heap memory I use
Thanks
|
|
|
|
|
OnSize(UINT nType, int cx, int cy)
{
IsWindow(xxx.GetSafeHwnd())
{
}
}
|
|
|
|
|
What does this mean and why have you posted it to me?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I have a working static splitter frame and need to retrieve pane based on CFormView.
I am getting assertion in GetPane MFC (4.0 / VC 6.0) function , and only on this type of splitter pane.
Plain CView works fine.
I did search on similar problems and it looks like the CFormView is the problem.
Any suggestion how to fix this?
Please no “ upgrade to xxxx”, not an option.
CWnd* CSplitterWnd::GetPane(int row, int col) const
{
ASSERT_VALID(this);
CWnd* pView = GetDlgItem(IdFromRowCol(row, col));
ASSERT(pView != NULL); // panes can be a CWnd, but are usually CViews
return pView;
}
Your help is as allways appreciated.
Cheers Vaclav
|
|
|
|
|
|
Hello
This is my first post, so excuse me if its in the wrong place, I need to reference a public class within a c# dll, Let me set the scene,
lets call the c# dll 2 and the c++ DLL 1, Within dll 1 i have an int main(void) and I have referenced DLL 2 in the project, I have referenced the namespace in DLL 2 thus using namespace startProc, within that I have two classes the class i wish to get to is called Processstarter, within there there is a public static void run(args1,args2)
When i try and access run from within the in main(void)I get an error "Error c3861:Run: Identifier Not found", Please forgive me as I'm new to C++, I prefer c# instead.
Does this make sense what I'm trying to do?
All i want to do is call a method in a class in a namespace in a c# dll.
Help!!!
|
|
|
|
|
|
gs_murphy@ntlworld.com wrote: Does this make sense what I'm trying to do? No, you cannot call C# code from C++ unless you have built it as managed code. Also, having a main() function in a DLL makes no sense.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
hi,
I have a VC++ application accessing MSSQL database via web services. I need to generate some summary reports and I thought of using Crystal Report. But I could not add a Crystal Report Object template into the VC++ project, there is no template to choose from in the Add->New Item. How should I go about to add Crystal Report in my VC++ project? I could add a Crystal Report in a new C# project, the Crystal Report template could be found in Add->New Item->Reporting.
I have searched the internet but could not find any information pertaining to this query? There were similar questions being asked, but not answered.
Greatly appreciate if anyone can provide me some advice or point me to some sites where I can get a kickstart. I have been stucked for about a week... and I need to generate the report real soon...
Thanks!
|
|
|
|
|
Once I've test myself an application with Crystal Report 6 (is the version that I have at my job) ... and goes pretty well ... if you send me an email, I will send you a demo project ... is about four files that I couldn't put here ....
|
|
|
|
|
I try follow code :
private:
float Plus(float a, float b){return a + b;}
float Minus(float a, float b){return a - b;}
float Multiply(float a, float b){return a * b;}
float Divide(float a, float b){return a / b;}
float SwitchWithFunctionPointer(float a, float b, float(*PointToFunction)(float,float));
and implementation:
float CTestBeginnerView::SwitchWithFunctionPointer(float a, float b, float(*PointToFunction)(float,float))
{
return PointToFunction(a,b);
}
void CTestBeginnerView::OnHelpTestfunctionpointer()
{
float f = SwitchWithFunctionPointer(4,8,&Plus); }
I get this error :
error C2276: '&' : illegal operation on bound member function expression
can you explain me why ? I reproduced the example from here[^]
|
|
|
|
|
high-level answer: the example was C, but you're writing C++.
low-level answer: you have written the functions as members of a class. in general, you can't do a plain pointer to a class member function.
one possible solution is to simply move those functions out of that class.
another possible solution is to make them static members of your class.
static float Plus(float a, float b){return a + b;}
|
|
|
|
|
Thank you very much, now it goes well ... best wishes !
|
|
|
|
|
Simply put, it's because you tried to get the address of a (non-static) member function.
It should work if you either:
- declare CTestBeginnerView::Plus as static
- remove the code from a class
Look-up thunking for a more in-depth discussion of the times that (1) is employed.
Here's a good discussion for now: Pointers to Member functions
|
|
|
|
|
1.declare CTestBeginnerView::Plus as static
is obviously my mistake, I try to point to an function that was not static ...
|
|
|
|
|
|
That was truly helpful.
|
|
|
|
|
Does anybody know some packages or developmental kits I could download, so I could create a bootable software in C or C++. A few links would be nice, thanks.
Simple Thanks and Regards,
Brandon T. H.
Programming in C and C++ now, now developing applications, services and drivers (and maybe some kernel modules...psst kernel-mode drivers...psst).
Many of life's failures are people who did not realize how close they were to success when they gave up. - Thomas Edison
|
|
|
|
|
Brandon,
If you are still working on this nuclearBoot[^] bootstrap project... then you should forget about doing this from a MBR bootstrap. How exactly do you plan on mounting NTFS/FAT32/exFAT drives? Do you realize that you would need to implement your own filesystem parsers? At such a low level... you would be dealing with raw disk sectors unless you plan on parsing these file systems yourself.
If I were you I would take a look at BusyBox[^] and use that for your project. It can be customized to do everything you want...
1.) It is customizable and bootable.
2.) It can mount NTFS,FAT,FAT32,Ext2/3/4 and more...
3.) You easily could move/delete/backup files from your application.
4.) You could fill a drive with zeros by doing 'dd if=/dev/zero of=/dev/sda bs=1M'
5.) You could fill a drive with randomness by doing 'dd if=/dev/urandom of=/dev/sda bs=1M'
6.) Everything is open source! You could modify or improve the source code.
Best Wishes,
-David Delaune
|
|
|
|
|
hi every one ,
UINT scaningFile(LPVOID lpvoid)
{
CmovProgress *parent = static_cast <CmovProgress *>(lpvoid);
CRepair_Pana Repair;
h_parentWnd = parent->GetSafeHwnd();
closefile = TRUE;
Repair.RepairMov(g_sourcePathofReferencefile,parent->GetSafeHwnd());
InterlockedExchange (&bexecution, FALSE);
SetEvent(g_hWorkEvent);
parent->PostMessage(WM_DESTROY, 0 , 0);
return 0;
}
this my thread from here am calling the core class member function Repair(CString sz_path,HWND h_wnd) in this i have one more sub function.
when am trying to display message box in Repair function with handle
::MessageBox(h_wnd,_T("Please select a healthy movie file "),_T("Information"),MB_ICONINFORMATION); it coming Active state but same thing which i do for the sub function saving (HWND h_wnd) it coming in inactive state this not getting close on clicking one time its take two to three click to get close
Help out of this .....
Best Regards
SARFARAZ
|
|
|
|
|
Why is the owner (the first parameter of ::MessageBox(..) ) important
and may not be NULL ?
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|