|
Hi all,
I've a questione about use CTreeCtrl. In my application I've a set of objects that represent a tree. I'd like use CTreeCtrl to organize those objects in a tree. I don't want implement a tree structure and then use a CTreeCtrl to visualize it, but I want use CTreeCtrl to maintain (each Item of CTreeCtrl has a DataItem that contain reference to a my Object)and visualize tree structure.
Can I use CTreeCtrl, add Item and its DataItem and when I visualize the structure create a Frame that contain CTreeCtrl? When I close Frame, can I again add new Item and then visualize CTreeCtrl again?
Thanks
|
|
|
|
|
I need to know how to connect to a running instance of Internet Explorer.
I want to monitor the click in any website.If suppose a link for a file is clicked,is should return the link to my application.
If any one can help me regarding this.pl. mail me in detail regarding where i can find info reg. the same..
Thank u
|
|
|
|
|
In my application, i added these 3 lines:
IWebBrowser2* m_pIE = NULL;
IConnectionPointContainer* pCPContainer;
HRESULT hr = m_pIE->QueryInterface(IID_IConnectionPointContainer, (void**)&pCPContainer);
But when i execute the program, there's an acces violation in pCPContainer!!
Why??
|
|
|
|
|
Given The 3 lines of code you have given. The reason is because m_pIE is still NULL. If by chance the code you posted had already given a pointer value to m_pIE then the reason for the access violation is that an effective use (See Effective COM by Sells, Brown, Box) of COM says if you get a pointer and it isn't null and you are going to assign an object to you must release the previous pointer value and then assign. So. QueryInterface most likely is trying to do
<someclass>::QueryInterface(..., LPVOID* pVoid)
{
if (pVoid != NULL)
{
pVoid->Release();
pVoid = NULL;
}
pVoid = static_cast<iconnectionpointcontainer*>this;
// ... more stuff.
}
If you had initialized pCPContainer to NULL in the declaration then the problem would not occur, given the information you have supplied.
Just my 2 cents.
|
|
|
|
|
Hi, all,
maybe somebody knows hwo to work with non-windows devices like printer under WinCE via IR-port using IrDA, IRLMP, etc. The problem is that pronter receives all packages, but inserts -1 at the beginning of each block. This results to garbage in output.
Alex
|
|
|
|
|
I know this insn't quite the place to ask this, BUT there isn't really a message area I could properly put this question / comment!
I've developed a Windows app that runs a .bat batch file. When the batch file is finished I want the DOS box to close automatically, so I just put "exit" as the last line. This didn't work in Win9x (if did in NT) . So I asked a co-worker of mine that only uses Windows under sufferance and would much rather use DOS. Solution to my problem - the last two lines of the batch file must be...
echo off
cls
and when the cls command is run, the DOS box closes
Is this a bug or a feature. If it is a feature, can someone please explain it to me?
|
|
|
|
|
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
|
|
|
|
|