|
Just a quess but try adding a UpdateData(FALSE); after the last InsertItem
Arjan
|
|
|
|
|
I doesn't change anything because UpdateData usually validates DDX data and not DDX controls.
However, insertions work perfectly as long as I do not use DeleteAllItems. As soon it is called, no further insertions are possible (ie. InsertItem returns a valid HTREEITEM handle, but the tree control client area remains empty, even if I force the control to redraw.)
Looks like DeleteAllItems makes a real mess in the control!
|
|
|
|
|
You're right this is a bug! But you can workaround it.
<br />
m_cTree.InsertItem("Before");<br />
<br />
m_cTree.SetRedraw(FALSE);<br />
m_cTree.DeleteAllItems();<br />
m_cTree.InsertItem("after");<br />
m_cTree.SetRedraw(TRUE);<br />
or just set the tree's scroll property to true.
Arjan
|
|
|
|
|
Thank you, Arjan for the workarounds!
|
|
|
|
|
You just saved me from going crazy over this. Thanks!!!
|
|
|
|
|
hi all!!
i have created a VC++ dialog-based application which uses CDaodatabse, CDaorecordset, mshflexgrid and a pie chart. the application is running fine on my development machine. i then tried to port it on a machine which does not have VC++ installed alongwith the MFC dlls. The application is not opening and it is also not giving ny errors. i tried to then change the code and finally i found that it was not going thru InitDialog(). This is because i had put a messagebox in the constructor of the dialog class which was opening. But i had also put a messagebox in the first line of Initdialog which did not come up. why is this happening. i have no clue. can anyone help?
|
|
|
|
|
Try compile the application is static link mode.
|
|
|
|
|
Try compile the application in static link mode.
|
|
|
|
|
The target machine is probably missing the flexgrid ocx control (and maybe any others your app uses). CreateDialog fails silently so you get no OnInitDialog and no messages.
Just install and register the ocx's your app needs on the target machine. In some cases your user may need a licence to use the control.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
hi
If i either click the RichEdit box or use tab button, the cursor should not get focused on RichEdit box.
Thank you.
|
|
|
|
|
hi...
Can anybody give me any sample dll & script file of install shield...
I'm trying to use DLL in installsheild but it is not accepting DLL..
even UseDLL() function fail to load..
I'll be thankful...
Sumit Kapoor
sumit_kapoor1980@hotmail.com
---Sumit Kapoor---
|
|
|
|
|
Hi,
I'm using the fftw++ header class for the fftw3 fast Fourier transform library in a pet project.
When I include the file fftw++.h in a source file, I get the following warning:
warning C4291: no matching operator delete found; memory will not be freed if initialization throws an exception
The fftw++ header overloads operators new[] and delete[], like this:
inline void *operator new [](size_t size, Complex)
{
size_t offset=sizeof(Complex)-(size % sizeof(Complex));
void *p=fftw_malloc(size+offset);
p=(char *) p+offset;
if(size && !p) cerr << endl << "Memory limits exceeded" << endl;
return p;
}
inline void operator delete [] (void *p, Complex, size_t size)
{
for(size_t i=size-1; i != (size_t) -1; i--) ((Complex *) p)[i].~Complex();
p=(char *) p-sizeof(Complex);
fftw_free(p);
}
What exactly is the meaning of this warning, and how to get rid of it (without using a #pragma directive)? It seems I have to rewrite operator delete[], I tried interchanging the parameters Complex and size_t to make them match the declaration of operator new[] but it didn't solve the problem.
I'm using Visual Studio .NET 2003.
Any input would be appreciated.
Cheers, blackmesa.
|
|
|
|
|
Hi, I want to know how can i add 2 CRecordset Derived class to my application.. I tried to 2 CRecordset class to my application, but when i make pointers to these classes. It gives me runtime error.. Anyone can help me with that??
I just want to open 2 CRecordset classes and each one point to only 1 table. So i can control them sepeartely... Thanks!
|
|
|
|
|
Recently i have gotten into making windows only using CreateWindow and CreateWindowEx functions, no MFC or any other classes, i find that its kinda hard to find code examples that design the windows this way, most use dialogs, designed in the VC++ IDE, or MFC
can anyone point me to some articas or web-sites with code examples that only use CreateWindow(Ex) to make its windows, and controls?
and also, i design my windows for 95/98/ME, and controls that are near the bottom, are very close or past the bottom of the window when the program is run on XP, this is due to the size of the Title Bar/Caption Bar (whatever you want to call it) so is there someway i could adjust this?
|
|
|
|
|
»Archer282« wrote:
is there someway i could adjust this?
AdjustWindowRect(Ex)
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
»Archer282« wrote:
no MFC or any other classes,
I'm curious - why? You stand to gain in terms of reduced development time and increased stability by using MFC (or an equivalent) class library.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
smaller file size, less dependecies, unlike some people i like the "more coding" part
|
|
|
|
|
if this is a commercial application that you have to support you will soon get over the joy of "more coding"
If you just doing it for fun then go for it
|
|
|
|
|
Ravi Bhavnani wrote:
increased stability by using MFC
I would have to disagree
How do I print my voice mail?
|
|
|
|
|
I recently downloaded the TODO files and compiled it, but received an error regarding missing file "htmlhelp.h". Where do I retrieve this file so I can run the application?
Mavin
|
|
|
|
|
You should post your question in the local forum of the subject article.
|
|
|
|
|
Do you know any good articles about storing some dialog values in registry ?
|
|
|
|
|
Check out the MSDN Documentation on the functions
http://msdn.microsoft.com/library/en-us/sysinfo/base/regcreatekey.asp
http://msdn.microsoft.com/library/en-us/sysinfo/base/regdeletekey.asp
http://msdn.microsoft.com/library/en-us/sysinfo/base/regopenkey.asp
http://msdn.microsoft.com/library/en-us/sysinfo/base/regsetvalue.asp
http://msdn.microsoft.com/library/en-us/sysinfo/base/regqueryvalue.asp
if you need help understanding how to use these functions just post again or ask me on msn(archer282@msn.com)
|
|
|
|
|
|
Hi all.
I have a worker thread that calls InternetConnectAttempt() to connect to the internet. At the same time my primary thread has a modeless status dialog that contains a cancel button. What I want to have happen is that when a user clicks the cancel button on the status dialog, the network connection/dial-up dialog that is displayed via the InternetConnectAttempt() call is also canceled.
What I have in my secondary thread is:
m_bIsDialing = TRUE;
Status = Code_That_Calls_InternetAttemptConnect_And_Returns_Status();
m_bIsDialing = FALSE; And in my primary thread I have
void CXXXXX::OnUserPressedCancel()
{
if (m_bIsDialing)
{
CWnd *pDialer = CWnd::FindWindow(_T("#32770"), _T("Dial-up Connection"));
if (pDialer && IsWindow(*pDialer))
{
pDialer->PostMessage(WM_CLOSE);
pDialer->PostMessage(WM_CLOSE);
}
}
} Now I tried this code on the client's laptop computer running XP that he connects to the internet via a cable connection. We were in a restuarant so it was not connected. The problem is that the connection dialog that came up was entitled "Network Connection" (or some such), and I was looking for a dialog entitled "Dial-up Connection".
I would like a clue on one of these two questions:
A.) Is there a better way than using FindWindow to get the window handle to the dialog that pops up when a call is made to InternetConnectAttempt() ?
B.) Can some one give me a list, or tell me where to find such a list, of all the possible dialogs that can or will pop up when InternetAttemptConnect is called? That way I can use that list to build a search algorithm using FindWindow .
Thanks
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|