|
I haven't involved separate threads in the application. I've tried creating a ListCtrl in a formview, tried adding a ListCtrl into a CView, tried using a CListView... but still no luck.
The thing is, I can see the header when I have it in Report mode, and Spy++ picks up on the windows messages for it. But even calling IsWindow on it returns false.
What gets me is it's a CListView with no modification whatsoever. Oh well, I'll try more in the morning.
Shutter
|
|
|
|
|
What is the value of m_hWnd at the time you get the ASSERT failure?
Is it NULL? You haven't created the window.
Is it 0xDDDDDDDD? You have deleted the CListView object.
Is it 0xCDCDCDCD? I don't know how this could be. But it is interesting. (It would mean m_hWnd had not be initialized.)
If it is something else, what is it?
--------
There are 10 types of people in this world. Those who know binary and those who don't.
|
|
|
|
|
It comes back null. But isn't the ListView supposed to create it?
|
|
|
|
|
Nothing happens by magic. Sometimes the framework creates windows for you. Sometimes you need to create them yourself. In this case it appears you need to create the window yourself.
You have the MFC source. Read it. Debug it. Learn it.
--------
There are 10 types of people in this world. Those who know binary and those who don't.
|
|
|
|
|
I want to select a row in a List Control and then delete it by pressing a deletebutton in my dialog based program. How do I do that? Please help me, I tried so many things but it doesn't work!
|
|
|
|
|
One solution is to first determine what rows are selected. When the user presses a button, look through the selected item database and call DeleteItem(). Keep a count as you delete each item and subtract the item index in the database from the count. One reason is because as you delete an item, the the indices of items after the deleted item decreases by one.
Kuphryn
|
|
|
|
|
I started programming a "simple" DLL with dynamic linking from the main application via LoadLibrary , GetProcAddress (and the rest).
Somewhere I make a trivial fault, which so far is difficult to correct.
Everything goes well, but when the function is exected, i get the next message.
Debug Error, File chkesp.c, line 41
The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
This should give a clue, but it did not help me so far.
To my understaning both my application and dll are compiled/linked with __cdecl as standard, so I'm lost now (but hope not for that long)
Bert....
|
|
|
|
|
Have you tried following the function call through in the Debugger. A reasonable knowlodge of assembler would help here.
Do you really need to dynamically load the DLL with LoadLibrary() and if so why? If it is a) because you don't want to waiste time loading until it is required, or b) you don't know if it exists, then using /DELAYLOAD with an SEH exception handler is a much better way to go.
See: MSJ, December 1998 Win32 Q&A. http://www.microsoft.com/msj/1298/win32/win321298.aspx[^]for a good article on /DELAYLOAD.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
assuming you're exporting C functions (not C++ stuff) it might help to add ' extern "C" ' to the function declarations :
DLL's header:
extern "C" WINAPI void MyFunc(...);
DLL's implementation:
#include "DLLs header.h"
...
void WINAPI MyFunc(...)
{
}
-c
|
|
|
|
|
|
Specialisation. Write a general one which asserts false and then a specialisation that takes the base class.
I believe the member functions will then be fine, because it will know that it's of that base type.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
|
I got confused.
I have a template class
template <class T> class x
{
..
}
now I create a specialization
template <> class x<BaseClass>
{
..
}
The specialized class will know abot the base class; but if I use the main class on another type, will the overridden members of the specialized class work?
I am going to try it anyway, but would be nice to know, if I am wrong about it before I go through the whole thing.
Thank you once again.
My article on a reference-counted smart pointer that supports polymorphic objects and raw pointers
modified 29-Aug-18 21:01pm.
|
|
|
|
|
is there any addin or standalone tool for Visual C++ 6 Standard to integrate Code-Optimization?
|
|
|
|
|
VC6 already does code optimization. Is there some problem with that?
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I suspect he wants a code profiler. method call counts, cpu utilization per method, per method stack etc.
something like OptimizeIt for java code. Is there a nice integrated one for VC++ or .NET for that matter ?
|
|
|
|
|
here is one thru the magic of google !
http://www.codework.com/glowcode/features.html
has anyone used it ?
|
|
|
|
|
See Intel's VTune. Excellent tool.
|
|
|
|
|
I've done a simple SDI-application which displays information from a database. Now I'd like to create a detail-view. For this I create a new dialoge. But how can I get the m_pSet from C...View to get the data?
Actually I added a recordset ptr in CDetailDlg and give the var by
detaildlg.m_pSet = m_pSet;
detaildlg.DoModal();
this works. But I think there should be a better way.
|
|
|
|
|
I don't know why I define any new character pointer in my program.When ever I do it when debugger reach to it,I recieve unhandled error,in line like this:
char *pszIn = new char[size];
Any idea? This happend not from beginig.It happend after some place.
Mazy
No sig. available now.
|
|
|
|
|
Mazdak wrote:
char *pszIn = new char[size];
Mazy, you have defined size somewhere or passed it in as a parameter, right?
-Nick Parker
|
|
|
|
|
Yes,whats the problem with that?
Mazy
No sig. available now.
|
|
|
|
|
Mazdak wrote:
Yes,whats the problem with that?
Nothing, but if you didn't you would have a problem.
-Nick Parker
|
|
|
|
|
I have even problem with somwthing like:
char* attachbody= new char[];
Mazy
No sig. available now.
|
|
|
|
|
Mazdak wrote:
char* attachbody= new char[];
This will not work, you have to specify the size of the char array inside of the array brackets.
-Nick Parker
|
|
|
|