|
Its a feature.
In win9x (and NT) a console is a process that can be shared by more than one application.
When you exit, Windows just detaches your app (the batch file) from the console process, and the next time it updates the console (minimizes, clears, etc) it will check to see if any apps are actually using it. If not, time to go bye-bye.
Sending the cls gets this check started.
|
|
|
|
|
Hi,
does anybody know if the function WaitForMultipleObjects behaves different on Win98 and Win2000/NT.
I have the following lines in my source :
DWORD dwResult = WaitForMultipleObjects( 5, hThread, TRUE, INFINITE);
if ( !(dwResult==(WAIT_OBJECT_0)))
.
.
.
where hThread is an array of handles to 5 threads and the threads have been started in order 0 to 4.
I think I found out that on Win98 the lowest handle-index is returned and on Win2000/NT the handle-index of the last unsignaled object is returned.
That means : Win2000/NT -> dwResult = 4
Win98 -> dwResult = 0
Did anybody recognize the same effect ?
Greatings Mario ///
--------------------
www.klangwerker.de
rocknix@lycos.de
--------------------
|
|
|
|
|
When I try to delete some shortcuts on the desktop the non-standard dialog is appeared. It contains standard text "Do you really want to delete bla-bla-bla" and a new section at bottom: "To uninstall this program go to...". I've saw this feature in Office2k for example.
How can I create such shortcuts?
|
|
|
|
|
Looking at the MSDN-help, I found this function.
virtual CDocument* GetNextDoc( POSITION& rPos ) const = 0;
This is not a pure-virtual, or is it??
Anybody knows what or why this is.
TIA
René
|
|
|
|
|
Rene,
In a word Yes. This is a pure virtual function as it is declared virtual, and trails with "= 0". Any function following these rules is pure virtual. I think maybe what has confused you is that it appears to be "const = 0" when in fact "const" and "= 0" are two different specifiers.
>> virtual CDocument* GetNextDoc( POSITION& rPos ) const = 0;
I believe that the "const" declaration has confused you. Let me try to clarify it for you. The const keyword can be applied in various positions in the function declaration. In this example the const trails the declaration. This means that the function cannot modifiy the object which it belongs to, (CDocTemplate). This is commonly used for "get" type functions where you want a value but do not want the object to change what-so-ever.
It is not a necessary piece of syntax but it is very helpful, because at a glance you can tell that the function cannot legally change object to which it belongs. If you wanted to find out more look it up in the MSDN, it can seem quite tricky especially when applied to pointers!
Hope this helps.
Accept that some days you are the pigeon and some days the statue.
|
|
|
|
|
Hi,
i have a problem since a lot of time, that i can't resolve:
i have an application with 5 buttons, when a button is clicked a dialog
pops up,
one of these buttons pops up a TreeView control who have 8 items, each
item pops up other dialogs, my problem is that when i'm on the tree and
then select another button, and then return on the tree, the dialog of
this tree item don't pops up even when i send one of this macros:
1/TreeView_Select(hTree,hSkillsTree,TVGN_CARET);
2/TreeView_Select(hTree,hItem,TVGN_CARET);
3/SendMessage(hTree,TVM_SELECTITEM,TVGN_CARET,(LPARAM)hItem);
after investigation i think that as i was on the last item seleted, even
if a send on of the above macro,
the TVN_SELCHANGED is not sended..
CAN YOU HELP ME PLEASE.
THANKS
|
|
|
|
|
Not sure I follow you, but if you problem is that you want to reveice selchanged messages when reselecting the currently selected tree item then the following code might help:
void CGenericTextTreeView::OnLButtonDown(UINT nFlags, CPoint point)
{
CTreeCtrl& tree = GetTreeCtrl();
UINT Flags = TVHT_ONITEM;
HTREEITEM h = tree.HitTest(point, &Flags);
if (h!=NULL)
{
tree.SelectItem (tree.GetRootItem());
}
CTreeView::OnLButtonDown(nFlags, point);
}
The problem is that the item you are clicking on is currently selected so no selection change has been made and, therefore no selchanged message is generated.
|
|
|
|
|
Thanks a lot for replying me,
can u translate please the code in pure SDK, i have no MFC knowledge !!!
Thanks Again.....
|
|
|
|
|
it's not excactly what i mean,
my app contains a menu with two item.
the 1st item (MENU_ITEM_1), opens a tree, the second item (MENU_ITEM_2) opens a dialog(1),
when the tree is opened by (MENU_ITEM_1), i made a selection on a tree-item that pops up a dialog(2),
so i select from menu, MENU_ITEM_2 that pops up dialog(1),
my prblm is that when i reselect from menu MENU_ITEM_1, the tree appears but
the appropriate dialog no ( the MENU_ITEM_2 (dialog1) remains ) even if i send a "brute"
TVN_SELCHANGED to the same ITEM.....to enforce the rigth dialog(2)...
this is portion of my code: ( in fact its not a menu but buttons that pops up dialog )
portion of code that catch TVN_SELCHANGED to display a dialog for each item:
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code)
{
case TVN_SELCHANGED:
hItem = TreeView_GetSelection(hTree);
tvi.mask = TVIF_PARAM|TVIF_TEXT;
tvi.hItem = hItem;
TreeView_GetItem(hTree,&tvi);
if ( tvi.lParam == 1 )
{
if ( hSkills == NULL )
hSkills = CreateDialog(g_hInstance,MAKEINTRESOURCE(competences_cles),hWnd,(DLGPROC)Skills_Proc);
else SetFocus(hSkills);
}
...........
portion of code that catch the buttons selection:
case WM_COMMAND:
switch(LOWORD(wParam))
{
// the famous MENU_ITEM_2(dialog1)
if ( HWND(lParam) == (HWND)hJobsButton )
{
ShowWindow(hTree,SW_HIDE);
if ( hJobs == NULL )
hJobs = CreateDialog(g_hInstance,MAKEINTRESOURCE(emplois),hWnd,(DLGPROC)Jobs_Proc);
else SetFocus(hJobs);
}
// ***** MY PROBLEM MENU_ITEM_1(dialog2) *********
// *****************************************
if ( HWND(lParam) == (HWND)hMyResumeButton )
{
if ( hTree == NULL )
{
Create_Default_Tree(hWnd);
SetFocus(hTree);
}
else
{
ShowWindow(hTree,SW_SHOW);
SetFocus(hTree);
//TreeView_Select(hTree,hSkillsTree,TVGN_CARET);
//TreeView_Select(hTree,hItem,TVGN_CARET);
//SendMessage(hTree,TVM_SELECTITEM,TVGN_CARET,(LPARAM)hItem);
}
}
so can u help me please , i can't resolve it since a lot of time... :<
|
|
|
|
|
HI ALL
in programming under dos i use this
int a=5;
int* p=&a;
then (cout p) to print addres
but how i can display address in EditBox
THANKS
|
|
|
|
|
You could do something similar:
[ccode]
#include <sstream>
using std::ostringstream;
void Func() {
int a;
int* p = &a;
ostringstream stream;
stream << p;
SetDlgItemText(IDC_EDIT1, stream.str().c_str());
}
[/ccode]
Walter Gildersleeve
Freiburg, Germany
walter.gildersleeve@pe-gmbh.de
|
|
|
|
|
Hi, does anybody know what the following output-messages means (VC++ 6.0) :
Compile...
prak3.c
(output german version)
Befehlszeilenfehler D2027 : '.\c1' kann nicht ausgefuehrt werden
(D2027 : '.\c1' could not be started)
Fehler beim Ausführen von cl.exe.
This error does not depend on the source-code - it occurs with every file ...
Greatings Mario ///
--------------------
www.klangwerker.de
rocknix@lycos.de
--------------------
|
|
|
|
|
Look up the error code (D2027) in MSDN - there's a list of possible causes in the help.
--Mike--
http://home.inreach.com/mdunn/
Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?
|
|
|
|
|
There's a difference in c1.exe (c-one) and cl.exe (c-el).
Maybe you've made a typo while specifying the linker?
--
Alex Marbus
|
|
|
|
|
Would a cool DHTML article be appreciated at codeproject? Tell me real pronto.
Thanks
|
|
|
|
|
where I can find free e-books about VISUAL C++
|
|
|
|
|
i know web site give you free e-book
www.maxcode.com
you can find the e-books in VISUAL C++ tutorial in maxcode
|
|
|
|
|
HI ALL
I use winapi befor winmain
but somtims i see pascal and apientry
what different between three kinds ...
THANKS
|
|
|
|
|
hi,
PASCAL is used in all exported function declarations,
indicating to the compiler that Pascal rather than C ordering is used for all
arguments (values) pushed onto the stack.
While C commonly uses inverted order, placing the least-significant bytes first on the stack
, Windows uses Pascal ordering that, like Unix, places the most-significant bytes first.
There is another small but crucial difference.
Exported functions are functions that will be called from outside the class or
in the case of a DLL
from other applications outside the unit (library).
In a Windows application where subroutines are called from Windows itself or where a
member function in one class is called from outside the class, even if both belong to the same application,
the Pascal calling order is necessary.
On the other hand, all internal function declarations (functions and subprocedures
called directly from other procedures within the application)
will expect arguments to appear in standard C order and should not be declared using the PASCAL specification.
As far as how argument lists are declared in the procedure definitions, it makes absolutely no difference whether
the Pascal or C calling conventions are used.
These conventions affect only how the arguments are handled internally
that is, on the stack
and do not in any way affect how the programmer constructs the argument lists.
However
APIENTRY will end up defined as WINAPI when you include windows.h
in version 6 , WINDOWS.H now supports the WINAPI macro, which translates to the appropriate calling convention for the target. Use WINAPI where you previously used PASCAL or __far __pascal.
for the actual definitions see windef.h -- Basic Windows Type Definitions
cheers
|
|
|
|
|
I have posted before asking some help on this.
thanks for all the people who have replied.
However, I think I forgot to clarify something.
Input: a directory
output: all files in that directory AND its sub-directory into a .txt file.
I know about the DlgDirlist command in VC++ .. however, how do I dump the listing into a .txt file?
Actually it would be better if this is done in VC++ console programming.. so in DOS.
|
|
|
|
|
How about a shell command?
dir C:\the\directory\you\want /b /s > filelist.txt
--Mike--
http://home.inreach.com/mdunn/
Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?
|
|
|
|
|
Yeah.. I was thinking about that.
Does this command work on NT / 2000 systems?
The reason I didn't go this way was because I don't think it works with NT.
|
|
|
|
|
It works on 2000. I don't have an NT4 system here, though, so I can't say about NT4.
--Mike--
http://home.inreach.com/mdunn/
Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?
|
|
|
|
|
Hallo Leute !!
Ich versuche gerade ein program zu machen in dem ich meine Internetzeiten und kosten eintragen kann.Ich verwende dafür ein Dialogfeld der Klasse (CDialog);
In diesem dialogfeld habe ich drei Listboxen (CListBox) eingefügt damit es gegliederter aussieht.
1 in dem der Provider eingezeigt wird (CListBox m_boxprovider)
2 in dem die Zeit eingezeigt wird (CListBox m_boxtime)
3 in dem die kosten angezeigt werden (CListBox m_boxkosten)
soweit geht das auch !
Wenn ich jetzt aber einen eintrag in einer der Listboxen anklicke wird dieser selectiert.
Aber da es ja drei Boxen sind bleiben die dazugehörigen Einträge in den anderen Boxen
unausgewählt.
Ich habe mich gefragt in wie fern es möglich ist eine Ableitung der Klasse CListBox
zu erreichen da wenn bei einer Listbox ein Eintrag ausgewählt wird dieser gleichzeitg auch
bei den beiden anderen ausgewählt wird. Da sie ja alle drei CListBox-en sind müsste der Wert der angibt welcher Eintrag ausgewählt ist ja eigentlich nur gleichgesetz.
Kann mir irgendjemand helfen????
Ich zerbrech mir noch den Kopf bei dieser Aufgabe, denn da ich die Einträge per Auswahl durch den Benutzer löschbar machen will kommt es sicherlich zu Schwierigkeiten bei der Bedienung da man ja jeweils die drei passenden Einträge nacheinanderlöschen muss.
Vergisst man aber beispielweise den Eintrag der Zeit zum schon gelöschten Eintrag Provider
ebenfalls zu löschen so bleibt ein Ungültiger Zeiteintrag bestehen da es für diesen ja keine Provider mehr gibt.
|
|
|
|
|
Or via BabelFish:
Hello of people!! I try even program to make in which I mean Internet times and cost enter kann.Ich use for it a dialog field of the class (DIALOG); In this dialog field I have three cunning boxes (CUNNING BOX) inserted thereby it more arranged look. 1 is in-shown in that the Provider (CUNNING BOX more m_boxprovider) 2 in that the time is in-shown (CUNNING BOX m_boxtime) 3 in that to cost to be displayed (CUNNING BOX m_boxkosten) so far goes also! If I however an entry in one of the cunning ruse click now these am selectiert. But since there is three boxes remains the pertinent entries in the other boxes unausgewaehlt. There I have myself in demand in like far it possible am a derivative of the class CUNNING BOX to achieve if with a cunning ruse an entry am selected these gleichzeitg also with the two different am selected. There they all three CUNNING BOXES are would have the value indicate which entry selected are actually only alike. Can somebody help me???? I zerbrech me still the heading with this function, because since I want to make the entries erasable by selection by the user come it surely to difficulties during the operation one the three suitable entries successively-delete in each case there must. One forgets to likewise delete however for example the entry of the time to the entry Provider already deleted thus remains an invalid time entry existing it for this no more Provider gives there.
I'm not sure which is harder to understand....
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|