|
Please, help me! How can I show Modaless Dialog and stop the treatment of the CView (I have leftView and View) when Modaless´ Cancel button is clicked. Thanks.
|
|
|
|
|
What's a No Modal dudette? DO you mean a modeless dialog?
|
|
|
|
|
yes, I am so sorry. I was thinking in a modeless dialog. Ups!
|
|
|
|
|
am very sorry but your english makes it impossible to understand what you are asking ... is there anyway you can write it better?
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Yeah, I know this is trivial,
But does anyone know how to calculate the orthodox and nonothodox Easter Friday Dates From a Year Value.
I'm thinking it could make a Kool Easter Egg system to implement
Regardz
Colin Davies
Ownguide NZ
|
|
|
|
|
I think you need to know the phases of the moon.
Perhaps we can add a moon tracking service to the OS. You would then be able to divide up the phase into ticks, much as the GetTickCount does ('cept they chose a 49.7 day cycle, for efficiency.)
All we have to do is sync with the great cosmic moon 'puter (running at Cern, I believe) during bootup, then our apps can call GetLunaTicCount to determine the current proximity to the new moon. If there are no LunaTics, its a miracle, and it must be Easter.
|
|
|
|
|
I found this - from Gauss - apparently how its actually done for Easter Sunday:
CString strEaster;
ldiv_t ldResult;
int R1, R2, R3, R4, R5;
int Y = 2001;
ldResult = ldiv(Y,19);
R1 = ldResult.rem;
ldResult = ldiv(Y,4);
R2 = ldResult.rem;
ldResult = ldiv(Y,7);
R3 = ldResult.rem;
ldResult = ldiv((19*R1) + 24,30);
R4 = ldResult.rem;
ldResult = ldiv((2*R2)+(4*R3)+(6*R4)+5,7);
R5 = ldResult.rem;
if(R4 + R5 >=10)
strEaster.Format("April %d", R4+R5-9);
else
strEaster.Format("March %d", R4+R5+22);
Guess you could fiddle to get the Friday. For Greek Orthodox, I guess if you had the full rationale for the formula you could adapt it. Must be more interesting stuff on the web - just thought this was neat - apparently it even takes into account the lunar cycles I was on about. Wow. Gauss rulez.
|
|
|
|
|
How to detect different type of Internet connection (RAS, TAPI, xDSL..)?
|
|
|
|
|
I think it's not easy, if not possible at all.
A starting point could be the InternetGetConnectedState() function, or searching on MSDN.
Paolo.
|
|
|
|
|
Hi All,
How can I create service in Windows 98 ? In Windows NT/Windows 2000 we have CreateService function ? I'm working on WDM Filter driver and I want to pass message to it ? I have done it in Windows 2000 by Creating it as service but how can I create it as service in Windows 98 ?
Thanks,
Puneet
|
|
|
|
|
I am starting to look into writing some TSR programs and haven't found any good articles or examples. Does anybody know of any urls or places where I can learn more about programming them? Thanks in advance,
- Travis
|
|
|
|
|
hey travis
tsr programming ... now that takes me back ... terminate and stay resident apps were a dos thing that let you make the system look like it was multitasking when in fact it wasnt ... in windows you don't really need such things
are you doing dos work? or are you just not understanding the difference with the windows way of doing things?
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
Hi,
I am new to visual C++ programming and I need some help please. How can I access a simple int variable defined in a Document from within a Modal Dialog?
I thank you in advance,
Christos P.
|
|
|
|
|
You need to declare a pointer to the document from your dialog class ( or I suppose you could pass it in the contructor, but what I am about to show you will be more generally useful, so here goes )
To get a pointer to your main window do something like this
CMainFrame* pMain = (CMainFrame*) AfxGetMainWnd();
then in an SDI app you can get the view like this:
CMpAppView* pView = (CMyAppView*) pMain->GetActiveView();
and the doc like this
CMyAppDoc* pDoc = (CMyAppDoc*) pView->GetDocument();
Of course, you may find you need to impliment get/set methods to your data, or declare your dialog to be a friend of your document class. Please don't take the cheap way and make all of your document data public, it is a poor design, even if it is quick 'n' dirty.
If your program is MDI, just insert MDIGetActive()-> before GetActiveView, the rest is the same. And for the sake of completeness, AfxGetApp() returns your CWinApp derived class ( don't forget to cast it ).
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
We have some troubles to make a program creating Child Window in CRichEditView
(for example, CButton using Create function)
We create Thread which can check the ScrollBar's position (position checker) every 0.1second.
It makes Child Window move as much as Scroll moves.
But When we are Scrolling the CRichEditView,
Child Window is not scrolled properly as Whole size is changed for using Backspace, Delete key
although the Text is scrolled.
Becuase the value, CRichEditView's movement, is not informed to ScrollBar accurately.
We need Function to transfer Scroll Pixel value whenever CRichEdiView moves,
Function to return Region which Text occupied or
Function to get ScrollBar's address and handle on the View basis.
Please Let us know how to make a function like that or there is any API having this function
Thank you!!!
mailto:freeflow@netsgo.com
|
|
|
|
|
are you trying to have say a button in the view that moves with a block of text as it scrolls? kinda like a html page?
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Yes. We try to have Button (created using CButton::Create) scrolled as parent View moves in the end like a Html with Submit Button.
|
|
|
|
|
I want to find %cpu usage per process on win9x machines. Some people said that I have to write vxd for that. Do you people think that. Or I have to hack Win Kernel to do this. Please suggest some ideas. Reply me back if you want more info about question.
|
|
|
|
|
How could i find out if a IE window has any toolbars
or if the window is resizable?
Some code example would be good.
And if someone then knows how to find out the same
things with Netscape i would be in heaven.
|
|
|
|
|
I thank it for three weeks
but I don't know...
I racked my brains for an answer but came up with none.
Please comment about this subject...
I want to know simply about this subject maked out MFC
|
|
|
|
|
// ip addres and hostname from this computer
WSADATA wsaData;
struct sockaddr_in sock;
CString strHostname;
int lLen = 255;
WSAStartup(0x0101, &wsaData);
gethostname(strHostname.GetBuffer(lLen), lLen);
HOSTENT * lpHost = gethostbyname(strHostname.GetBuffer(lLen));
memcpy(&(sock.sin_addr), lpHost->h_addr_list[0], lpHost->h_length);
TRACE2 ("Host Name: %s IP address : %s\n",strHostname, inet_ntoa(sock.sin_addr));
WSACleanup();
Hope this will help you
|
|
|
|
|
Aren't you a easier method than it?
Please reply a easier method.
No settlement is remotely possible.(above construction)
In truth, I don't know yet
|
|
|
|
|
hi
your code perfectly correct.
But it is not working in Windows 95. it says WSAHOST_NOT_FOUND.
if i given value of hostname in gethostbyname function as Win95 m/c's name and i run it in Win98, its fetching the IP address perfectly(Win95 m/c ip address).
i don't know why its not fetching in Win95?
these system are all DHCP configured.
please get me if u have any idea
Thanks in advance.
regards
Halid
|
|
|
|
|
Recently I've been designing my document structure. I have to save a list of patients, each with a list of consultations, each with a list of images, each with a list of annotations, etc. My UML looks roughly like this:
CMyDoc
------
[list]CPatient
CString rootDir
CPatient
--------
[list]CVisit
CString firstName
CString lastName
...
CVisit
------
[list]CImageDoc
COleDateTime date
CImageDoc
---------
CWinBmop * bmp
[list]CAnnotaiton
etc. etc.
But this high level of nesting is making things very messy. For instance just to find at which index the currently selected index is, one of my functions is:
int CPatientView::GetVisitIndex(CString name, int parent)
{
CSOFIDoc * pDoc = (CSOFIDoc*) GetDocument();
CObArray * pPatientList = (CObArray*) pDoc->GetPatientList();
CPatient * pPatient = (CPatient*) pPatientList->GetAt(parent);
CObArray * pVisitList = (CObArray*) pPatient->GetVisitList();
for (int i=0; i < pVisitList->GetSize(); i++) {
CVisit * pVisit = (CVisit*) pVisitList->GetAt(i);
if (pVisit->GetPath() == name)
return i;
}
}
Now I'm no system architect, but i reckon that's just too messy and prone to errors and I'm not even at the ImageDoc level!. Anyone give me some broad ideas at how I can make things simpler and neater?
Thanks for any help
|
|
|
|
|
Looks like it's time for you to toss your MFC arrays and lists and use STL ones. This will allow you to to replace the pVistList with an stl::map<cstring,cvist*> and just do a .find(name) to quickly locate the data.
|
|
|
|