|
|
I have the following problem.
I am trying to implement a list in report style on one of the tab pages of my tab control. When I run the program, the list appears, but the columns I added by using CListCtrl::InsertColumn(..) are not added. I tried the same code without the tab control and adding columns is no problem then. I am calling the InsertColumn method right after I created the child dialogs of the tab control. Has anybody experienced this before? What am I missing?
//my code looks like this:
//m_Listl is the list in the object behind the m_Dialog dialog
m_Dialog[0]->Create(m_DialogID[0],GetParent());
m_Dialog[0]->m_Listl.InsertColumn(0,_T("Item Name"), LVCFMT_LEFT, 110);
Tim
|
|
|
|
|
tims81 wrote: but the columns I added by using CListCtrl::InsertColumn(..) are not added.
Does that mean that InsertColumn() is returning -1 ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
not sure whether InsertColumn() is returning -1 cause i can't use the debug configuration. i think it might be a ctabctrl problem as a simple Editbox on the same page called by the tab control cannot be set either to a certain value from within the program. any clue?
|
|
|
|
|
tims81 wrote: ...i can't use the debug configuration.
Why? Trying to debug a program from the outside-in is not very practical. There are exceptions, of course.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i'm missing some dlls to run in debug config and having problems installing sp6. so i don't have any choice.
|
|
|
|
|
So how about an alternative:
if (m_Dialog[0]->m_Listl.InsertColumn(0,_T("Item Name"), LVCFMT_LEFT, 110) == -1)
AfxMessageBox("InsertColumn() returned -1");
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I may be wrong on this, I'm just not sure, but I think you cannot create then insert. You may have to let the create function execute first.
The best solution would be to move the insertcolumn function to the init dialog function of the tab control dialog box (m_DialogID[0])
Alternatively, move the create function to the constructor for the main dialog, and the insertcolumn to the initdialog function.
|
|
|
|
|
thnx for the reply. here's something weird. i am calling the insertColumn function from the .cpp file of my tab control. after i insert the line "UpdateData(false)" in the ::OnInitDialog of the page displayed by the tab the columns do appear. however i get a message box before executing the program that an 'unsuported' operation was attempted. but if i place the "UpdateData(false)" function anywhere else other than in OnInitDialog it doesn't work anymore at all. any idea what's going on here?
|
|
|
|
|
tims81 wrote: any idea what's going on here?
I would remove the calls to UpdateData() . It is rarely, if ever, needed.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
ok, i just found out - apparently i have to call UpdateData(false) BEFORE I add the columns...
|
|
|
|
|
please guide me for a windows program that neatly displays a circle, a square, and an equilateral triangle in a window.
1) When the user presses an arrow key the square and only the square will move slightly in the direction of the arrow.
2) When the user presses page-up the triangle will grow in size. (It will remain an equilateral triangle, and it's center will not move. )
3) When the user presses page-down the triangle will shrink in size. (It will remain an equilateral triangle, and it's center will not move. )
4) When the space bar is pressed all three graphic objects will change to a new random color.
i wil appreciate if anyone can e-mail me at dearchinar@gmail.com
Chinar shah
-- modified at 2:16 Thursday 18th January, 2007
|
|
|
|
|
cshah2 wrote: dearchinar@gmail.com
Guess what?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Dont need to email we say to you here;)
Do you want to move shapes see CRectTracker class
|
|
|
|
|
Hi,
Can anyone please let me know if we can rename a system dll ( dll presnt in c:\windows\system32 folder, when in use ?
I manually tried renaming, it even got renamed, but does it affect any OS operation in backend? or renaming just dont take effect?
If it can be renamed, can anyone let me know a suitable method for that (in vc6.0) ?
Thanks in advance,
Manasi
|
|
|
|
|
Manasi D wrote: Can anyone please let me know if we can rename a system dll ( dll presnt in c:\windows\system32 folder, when in use ?
Why under the sun will you want to do this?
Manasi D wrote: If it can be renamed, can anyone let me know a suitable method for that (in vc6.0) ?
Nothing special about the file being a DLL, you could just rename it like how you would rename any other file.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Hi I am looking for a ANTS Profiler equivalent to profile MFC/desktop apps, any suggestion?
Thanks.
Norman Fung
|
|
|
|
|
norm wrote: profile MFC/desktop apps
BoundsChecker, AQTime.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi
Wondering if there's any alternative, preferably free (well perhaps I'm asking too much)? I checked BoundsChecker [^]it's:
a. cost money (fair enuf, it's not like developers are making lots of it but ...)
b. Not sure if it works with VS6 (working on acient WIN32/MFC apps and VS6 environment)
Profiler user interface definitely looks good [^]though.
Thanks.
devy
|
|
|
|
|
heyhey,
hope this is the correct forum, cause actually it's a mixture of c++ and opengl question:
I used a 3ds-model-reader (http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=506)
which reads out all vertices correct from the file.
then the normals are calculated and stored.
I want to try my skills with my own lighting calculations but the problem is I cannot read out the normals correctly.
The vertices are no problem, but here's some code:
<br />
{...}<br />
for (int i = 0; i < ModelToDraw.numObjects; i++)<br />
{<br />
if (ModelToDraw.Objects[i].textured)<br />
glEnableClientState(GL_TEXTURE_COORD_ARRAY);<br />
glEnableClientState(GL_VERTEX_ARRAY);<br />
if (ModelToDraw.Objects[i].textured)<br />
glTexCoordPointer(2, GL_FLOAT, 0, ModelToDraw.Objects[i].TexCoords);<br />
glVertexPointer(3, GL_FLOAT, 0, ModelToDraw.Objects[i].Vertexes);<br />
float *pVertex = ModelToDraw.Objects[i].Vertexes;<br />
float *pNormal = ModelToDraw.Objects[i].Normals;<br />
for (int j=0; j < ModelToDraw.Objects[i].numMatFaces; j++)<br />
{<br />
glPushMatrix();<br />
glTranslatef(ModelToDraw.Objects[i].pos.x, ModelToDraw.Objects[i].pos.y, ModelToDraw.Objects[i].pos.z);<br />
<br />
glRotatef(ModelToDraw.Objects[i].rot.z, 0.0f, 0.0f, 1.0f);<br />
glRotatef(ModelToDraw.Objects[i].rot.y, 0.0f, 1.0f, 0.0f);<br />
glRotatef(ModelToDraw.Objects[i].rot.x, 1.0f, 0.0f, 0.0f);<br />
<br />
myGetTriangles(ModelToDraw.Objects[i].MatFaces[j].numSubFaces, ModelToDraw.Objects[i].MatFaces[j].subFaces, pVertex, pNormal, ModelToDraw.shownormals);<br />
glPopMatrix();<br />
}<br />
{...}<br />
well this part of code works well with the glDrawElements-Call at the End but I want to use my own function "myGetTriangles", so here's a little snippet:
<br />
{...}<br />
void myGetTriangles(...)<br />
vector4 a,b,c,d;<br />
<br />
int i;<br />
unsigned short index;<br />
float* _tempArray; <br />
glDisable(GL_LIGHTING);<br />
<br />
for(i=0; i < numSubFaces; i+=3)<br />
{<br />
index = subFaces[i];
_tempArray=(float*)(((char*)k) + index * 12);
<br />
a.x = _tempArray[0];<br />
a.y = _tempArray[1];<br />
a.z = _tempArray[2];<br />
a.w = 1.0f;<br />
<br />
index = subFaces[i+1]; <br />
_tempArray=(float*)(((char*)k) + index * 12);
b.x = _tempArray[0];<br />
b.y = _tempArray[1];<br />
b.z = _tempArray[2];<br />
b.w = 1.0f;<br />
<br />
index = subFaces[i+2]; <br />
_tempArray=(float*)(((char*)k) + index * 12);
c.x = _tempArray[0];<br />
c.y = _tempArray[1];<br />
c.z = _tempArray[2];<br />
c.w = 1.0f;<br />
<br />
_tempArray=(float*)pNormals;
<br />
d.x = _tempArray[0];<br />
d.y = _tempArray[1];<br />
d.z = _tempArray[2];<br />
d.w = 1.0f;<br />
<br />
if (showNormal)<br />
{<br />
glColor3f(1.0, 0.0, 0.0);<br />
glBegin(GL_LINES);<br />
glVertex3f(a.x, a.y, a.z);<br />
glVertex3f(a.x + d.x, a.y + d.y, a.z + d.z);<br />
glEnd();<br />
}<br />
I marked the line which must be wrong! I tried several versions but couldn't fix it, any idea?
I think the problem is simply reading the normal from it's pointer but since the drawing method described at the top iterates through the materials I cannot simply alternate through the bunch of arrays.
This problem is nagging me for days, so any advice would be appreciated. thanx guys great forum!
|
|
|
|
|
Is there an easy way to port project from vc2005 to vc2003?
or at least resource file.
thanks in advance.
|
|
|
|
|
See here[^] if its helpfuls?
|
|
|
|
|
Upon installing Direct SDK I found a folder containing the documentation. Does anybody know how to add these documents to my local copy of MSDN? I'm unable to find any option within the document explorer to add new folders, so I tried copying the folder amongst the others that MSDN uses, but I am still unable to see the contents.
|
|
|
|
|
What version of VS?
DirectX SDKs add themselves automatically to my VS2003 help contents. Platform SDK soesn't
doesn't but I just searched help and found...
"Visual Studio .NET Combined Help Collection Manager" or "VSCC" and there's a page that searches
the available documentation and lets me select which ones I want. I'm about to add the PSDK
so if it brings my system down I may not be back for a while heh
|
|
|
|
|
I am using a system wide hookapi DLL which hooks StartDocA, StartDocW, EndDoc, PrintDlgExA, PrintDlgExW the latter so I can obtain number of copies, page range etc.
My hook DLL works for NotePad, WordPad etc but the problem I have is Word (and I presume the other Office applications) do not appear to use PrintDlgA, PrintDlgW, or the Ex versions to display their Print dialogs and hence I cannot obtain the number of copies, page range etc.
Does anyone know which API Word is using to display the Print dialog ?
Thanks in advance
|
|
|
|