|
From the docs:A virtual list-view control maintains very little item information itself. Except for the item selection and focus information, the owner of the control must manage all item information. Since the checkboxes are implemented using the state image list, when you put the list into virtual mode, the list no longer keep the state image info itself.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Hallo C++ world,
I would be appreciate your help!. I've a class with a CMap<int,int,cmyobject,cmyobject&> member variable. I have to store in it aprox. 8000 CMyObject elements. But after the 4600th element I get a CMemoryException.
I tried with a CArray<cmyobject,cmyobject&> variable. Here can I store only 1500 elements.
Can anyone tell me how can I work around this problem using a MFC collection.
With kind regards,
Reinaldo
Reinaldo Casamayor
|
|
|
|
|
Reinaldo Casamayor wrote:
But after the 4600th element I get a CMemoryException.
What is the text of the exception? Use either GetErrorMessage() or ReportError() for this.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
A CMemoryException typically indicates that new failed. MFC redefines the global operator new .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi,
I'm calling CListCtrl CustomDraw from a dialog, and I'm getting in trouble when I try to retrieve the column number that is currently being drawn ( I get a column number like 1242244).
What I make is:
<br />
void CRolesDlg::OnCustomdrawRoles(NMHDR* pNMHDR, LRESULT* pResult )<br />
{<br />
(...)<br />
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;<br />
<br />
int iCol = lplvcd->iSubItem;<br />
(...)<br />
}<br />
And I get that strange iCol number , any ideas about why this happens ? It's a bug from MFC ? A bad casting ?
Greetings
Braulio
|
|
|
|
|
You left out a lot of code there... are you checking the draw stage? Returning the right CDRF_* flags to get notified of the draw stage for subitems?
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Hi Michael,
The full code of the method is:
<br />
void CRolesDlg::OnCustomdrawRoles(NMHDR* pNMHDR, LRESULT* pResult )<br />
{<br />
<br />
NMLVCUSTOMDRAW* customDrawItem = reinterpret_cast<NMLVCUSTOMDRAW*>(pNMHDR);<br />
<br />
<br />
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;<br />
<br />
int iCol = lplvcd->iSubItem;<br />
int iRow =0;<br />
switch(lplvcd->nmcd.dwDrawStage)<br />
{<br />
<br />
case (CDDS_SUBITEM):<br />
if(lplvcd->iSubItem == 1) {<br />
AfxMessageBox("");<br />
}<br />
break;<br />
<br />
default:<br />
*pResult = CDRF_DODEFAULT;<br />
<br />
} <br />
}<br />
I tried several things...
|
|
|
|
|
Hi Michale,
I'm following you article "Neat Sutff to do in List Controls Using Custom Draw", now things are going better
I hate to do things like this with MFC/ATL... when guys making sh*t with Visual Basic can do it in five minutes
Thanks for your help, Bye !
Braulio
|
|
|
|
|
I am using the VC++ date/time picker control. I want to select a date and then calculate the total seconds from 01-Jan-1980 until the selected date. Also I want to store this as an unsigned long int.
Do you know of a simply way to do this?
|
|
|
|
|
Store each of the dates in a COleDateTime object. Assign the difference to a COleDateTimeSpan object.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have very little VC++ experience. Could you give me more details on how to do this?
thank you
|
|
|
|
|
Yes, but I'd rather point you here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cdatetimectrl.3a3a.gettime.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_coledatetime.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_coledatetimespan.asp
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Does anyone know of a free (or one off payment) library for creating PDF documents that can be used from C/C++ programs? The only ones I managed to find so far are royalty based or can only be used from other languages such as PHP.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
How about this one?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I'm not sure haow to qualify the textbox-append statement. The following statement:
myapp1::Form1::ioBOX.Appendtext("x");
Gives this error:
error C2228: left of '.Appendtext' must have class/struct/union type
type is ''
----------------------------------------------------------------------
Any ideas?
----------------------------------------------------------------------
//MY CODE - error near bottom
#pragma once
extern "C" int magiccalc(void);
namespace myapp1
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
magiccalc();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::TextBox * ioBOX;
private:
void InitializeComponent(void)
{
this->ioBOX = new System::Windows::Forms::TextBox();
... ...yadda yadda
}
public:
static void TOioBox(int outnum)
{
ERROR----> myapp1::Form1::ioBOX.Appendtext("x");
}
};
}
extern "C"
{
void showme(int wrapnum) // My wrapper for C
{
myapp1::Form1::TOioBox(3);
}
}
Thanks
|
|
|
|
|
You'd need to use an instance of Form1 , not the class itself, because ioBOX is an instance member.
Your syntax would probably look something like:
pForm1->ioBOX->AppendText( S"x" ); Note that C++ is case-sensitive and that the AppendText method takes a System::String* .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
try:
this->ioBox->AppendText()
DO NOT USE THE dot operator (.)
since you are using a pointer you must use the -> operator.
|
|
|
|
|
Hello !
My name is Cristi and I have a big big problem.
I want to get the plug and play informations from a printer connected via parallel port (or usb). Using DeviceIoControl with IOCTL__PAR_QUERY_DEVICE_ID is great in Windows 2000 or XP, but on Windows 95,98 and Me it doesn't work at all. I tried defining myself this IOCTLs with CTL_CODE macro but in vain.
I need to query directly the device and not the driver.
Please, if anyone knows, tell me how can I obtain the plug and play information on an operating system like Windows 95, 98 or ME
You can write me at funnycreeps@go.ro
Thank you !
|
|
|
|
|
Sorry I can't post any example code, but try looking in the SetupAPI functions. Specifically:
SetupDiGetClassDevs
SetupDiEnumDeviceInfo
Remember, even if you win the rat race, you're still a rat.
|
|
|
|
|
I am currently working on a MFC application with a document/view architecture. CRichEditCtrl objects are placed on the main view as child controls according to user input. The user is allowed to scale the size of the entire view from the main menu. This is done by setting the mapping mode to MM_ANISOTROPIC and calling the SetWindowExt() and SetViewPortExt() functions with various values depending on the type of scaling wanted. These settings are modified in OnPrepareDC() within the View object.
When a user goes from a 100% scaling to a 200% scaling, the text within the CRichEditCtrl objects does not scale. But if a CRichEditCtrl object is placed on a view with no text and the view is scaled, then the text-promt is scaled correctly. When the user then enters a letter - the contents is scaled to its usual size.
The mapping mode of a CRichEditCtrl is set to MM_TEXT. My question is then: Is there any way for me to change this mapping mode, and where would I do this so that scaling is possible?
Thanks!
andigra
|
|
|
|
|
visual C++6
when i write
DDX_Text(pDX, IDC_EDIT10+4, VAR);
where VAR is a member variable, it puts the VAR value in IDC_EDIT24 not IDC14 as i expected, and when i write:
DDX_Text(pDX, IDC_EDIT5+2, VAR);
it reads it as IDC_EDIT7;
in the same way, it reads
4+1 = 15 !!
5+4=19;
10+7 = ??
anyone can help plZ?
|
|
|
|
|
What are the numeric values of IDC_EDIT10 , IDC_EDIT24 , IDC14 , IDC_EDIT5 , and IDC_EDIT7 ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
It looks like the controls were not added to the dialog in the same order as they are numbered. Each IDC_EDITxx is associated with a numeric value which is incremented after each assignment to prevent reuse of a number.
If IDC_EDIT10 is associated with 33405, for example, the expression IDC_EDIT10+4 evaluates to 33409, which is apparently associated with the identifier IDC_EDIT24, not IDC_EDIT14. You can recreate the controls on the dialog in the correct order to fix this, or find another way to refer to specific controls. Or stick around - someone else may have a better solution.
Will Build Nuclear Missile For Food - No Target Too Small
|
|
|
|
|
You can adjust the numbers in the Visual C++ resource editor by going to properties, then putting '=x' after the name, where x is the number you want it to have (e.g. 'IDC_EDIT10=1000', without the quotes).
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
No better solution I believe... This one problem you need to avoid when using group radiobuttons.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|