|
I'm working on an MDI application. Now, I have this side bar which displays certain information about a document. Each time I switch to a different document I handle the view change message in the corresponding view and from there I update the sidebar.
This worked great. But some new feature in the program demands I put in an extra view for each document/frame (a CListView to be exact). In the toolbar the user can switch between these views.
Now the problem arises, that once the view changes, I get a new message in the sidebar saying the document has switched, whereas in real, the document hasn't switched at all. I was wondering whether there would be a different way to detect if the user went to a different document
|
|
|
|
|
hi,
how i include status bar in model or moduless dialog box(Child Window).plz help me.
Thank you.
nevis
|
|
|
|
|
Can't you do it like this?
Make a CStatusBar member in your dialog
In OnInitDialog() call m_wndStatusBar.Create( this)
|
|
|
|
|
Hi,
I have a MSHFlexGrid-like control that often needs to be redrawn. Sometimes the redraw flickers and sometimes it doesn't.
It seems to flicker when rows OR cols are out of the direct view, thus enabling the scrollbar.
Why does this problem occur and what can I do about it?
I didn't know there was significant diffence between redrawing with and without a scrollbar?
tnx for your help!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
I did work with MSHFlexGrid a lot last year, but unfortunately I don't have any source code with me right here and right now. However, I remember that there was an option where you could let the control draw itself automatically. Now I don't know if you have enabled that option and at the same time you are redrawing the grid manually as well. But that would be my first and only guess, because I never had a flickering problem.
// Afterall, I realized that even my comment lines have bugs
If the sun were to blow up, it would take us 7-8 minutes to realize it.
|
|
|
|
|
hello,
I've got a simple question, some time ago I've wrote an application that creates a binary search tree and now I need it to be used into my win32 appliaction, since importing dll function is not difficult, how do I import structures? I've included in my project the bst.h file that contanins all the definition but at link compiler I get errors... as no bst_node struct is found...... my question is : How I tell the compiler to import a structure from a dll?
for all the funcions that needs to be exported I inserted
__declspec( dllexport )
but it doesn't work with str.
Thanks!
|
|
|
|
|
I have better idea for you,
Create A class instead of Structure and and made it variable public accesible.
and now export/import class using the AFX_EXT_MACRO.
note:for this you have to craete the MFC extention Dll
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
thanks, but I'm not familiar with MFC, I've never done anything with it...thanks for the advice btw!
|
|
|
|
|
I produce a document in MS word.
I added tables and I would like to add Rows to those tables by using
Rows.Add(VARIANT* BeforeRow) command
as fallowed but I could not do it.
How can I do it?
Thank you in advance.
m_Tables=Document.GetTables();
m_Selection=m_Table.Cell(2,6);
m_Selection.Select();
m_lpcstr="somestring";
m_Selection.SetText(m_lpcstr);
VariantInit(m_Var);
m_Var->vt=VT_VARIANT;
m_Var->pvarVal=(VARIANT*)2;
// or
m_Var->vt=VT_I4;
m_Var->lVal=2;
m_Table=m_Tables.Item(4);
m_Rows=m_Table.GetRows();
cnt=m_Rows.GetCount();
m_Row=m_Rows.Item(2);
m_Row.Select();
m_Rows.Add(m_Var);
|
|
|
|
|
Ive a CListCtrl
I would like to do the opposite of an InvalidateRect on a section.
i.e. I want to redraw the entire control EXCEPT a certain region (rectangle)
how does one go about this?
cheers
bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
ValidateRect()
"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!
|
|
|
|
|
|
Hello dear programmers,
Please help me with this one ...
I'm having trouble copying a worksheet in VC++ (MFC).
I'm accessing an Excel object and trying to manipulate it.
So far, some function that i've used was working fine except the copy function of Worksheet class. There's no error during compilation, but at runtime a message is displayed stating that "Copy method of worksheet class failed."
By the way, I am using MS Office 2000.
Thanks in advance.
|
|
|
|
|
I wanaa to start timer on clicking button Btn_Start
and here i will disable button Btn_Start
(GetDlgItem(BTN_START ))->EnableWindow (FALSE);
SetTimer( 21, 1000 * 60 * 180, NULL);
as my calculations 1000 * 60 * 180 = 3 hours or 180 mint
is it ?
after expiry of 180 minuts in ON_TIMER Event
I will Enable Start Button
GetDlgItem(BTN_START ))->EnableWindow (TRUE);
KillTimer( 21 );
But it not complete its time of 180 mint ,,
it enable it early ,,,,
Y??
any reason
thanx
|
|
|
|
|
not sure what you're on about
but are you catching the OnTimer event?
and making sure you deal with only the correct timer event (21)
cheers
bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
Wts is timers life time ,, means i wanaa say its maximum limit to set it..
if i set a timer for 24 hours ,, will work
or SetTimer (...) have any time range for timer
thanx
|
|
|
|
|
mate, i have no idea what you're on about
you have not provided enough information for anyone to give you any decent answer
bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
According ot MSDN,Maximum limit is 0x7fffffff or 597 hr. for setting Timer
-----------------------------
"I Think It will Work"
Formerly Known As "Alok The Programmer" at CP
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I have no idea what "wts" and "wanaa" mean. If you are looking for the max value for SetTime(...), look at the function prototype.
SetTimer(
HWND hWnd ,
UINT nIDEvent,
UINT uElapse,
TIMERPROC lpTimerFunc);
It looks like uElapse is of type UNIT, so probably the max number of milliseconds is UINT_MAX.
Details on UINT_MAX can be found at msdn.microsoft.com
|
|
|
|
|
Set timer interval to 1000 (1 second) when creating timer.
You will need to create a member data and then increment it in the timer:
CMyDialog::OnTimer(...)
{
m_seconds++;
// then you can calculate m_seconds and do whatever
// other code
}
|
|
|
|
|
You should use the value returned by SetTimer for KillTimer.
From MSDN
=========
Return Value from SetTimer(...)
The timer identifier of the new timer if the function is successful. An application passes this value to the KillTimer member function to kill the timer. Nonzero if successful; otherwise 0.
|
|
|
|
|
sir i am having one static link library file,i want to create an application by using that library,plz give me the steps which i have to follow in order to use the library
|
|
|
|
|
In my program, i m using CDaodatabase for database connectivity. i then use CDaorecordset to entry/modify data in the database.
My question is::
I do not use DSN anywhere in my program. Does CDaodatabase handle DSN internally. Wat is the better implementation - using DSN or using CDaoDatabase implementation? and wat is the main diff between the two?
|
|
|
|
|
CDaoDatabase constructs a CDaoDatabase object. The path to the database will have to be provided and connection can be opened with Open() method.
|
|
|
|
|
can u point out the difference between connecting vis CDaodatabase and connecting via DSN?
|
|
|
|