|
If I understood your requirements correctly, seems to me like CTreeCtrl::SetItemData and CTreeCtrl::GetItemData can be used to store and retrieve pointers to an array of yours holding the data items.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanx again!
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I am trying to implement a type independant linked list in C++ for use in a C# program. The problem I have is that I have a class ListItemType that holds the data. I need to derive a class from this class in order to hold the lists data. I need to access the members of the derived class with a virtual function that is specifically coded for that class. Is there a way to cast it in C# so that this is possible? Secondly is there a better way to do this? Thanks.
Code follows:
public __gc class ListItem : public Object
{
public:
ListItem(Object *Obj);
void Delete();
bool isUsingSubItems;
int index;
ListItem *pNext;
ListItem *pPrev;
Object *pObject;
};
public __gc class LinkedList
{
public:
LinkedList();
void AddItem(Object *Obj);
Object *FindItem(Object*Obj);//Used to search the root object in each item
virtual Object *FindSubItem(Object *rootObj,Object *Obj) = 0;//Must be
// custom defined each time for the particulars of the list;
Object *GetAt(int index);
int GetIndex(Object *Obj);
void DeleteItem(Object *Obj); //Find a node and delete it
void DeleteList();//delete the whole list
void SetType(Type *type);
int GetNumItems(){return iNumItems;}//
void SetTypeSafe(){bTypeSafe = true;}
bool isTypeSafe(){return bTypeSafe;}
protected:
int iNumItems;
Type *pObjectType;
bool bTypeSafe;
protected:
ListItem *pListHead
ListItem *pListTail;
};
Steve
Not all who wander are lost...
|
|
|
|
|
Does anyone know of a commercial vector graphics library (compatible with MFC/VC++)? I need to use vector icons in a certain format (whichever the library requires) to display in a CView. I have been looking all over the net, but have not found anything decent.
Thanks.
|
|
|
|
|
|
Hi,
I am making a plug-in for a game that I have and I want to be able to get the keyboard input from a dialog box I have created.
The dialog is created with CreateDialog() and I have passed it a CallbackProc parameter. From that callback I can capture all the messages except the keyboard input, which are happening in an edit control. I am really interested in knowing when I press return key in that edit control so I can behave the same way as having pressed the OK button.
Please Help,
Clint
PS. If any of this was unclear let me know because I really want to figure this out.
|
|
|
|
|
Dialogs don't let you process keystrokes...?
I did not know that...
However...You acn probably capture all the messages you desire using SetWindowsHookEx().
Laterz!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
HockeyDude wrote:
Dialogs don't let you process keystrokes...?
I did not know that...
In a dialog based application the focus will always be on one of the child controls and not on the main dialog.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
Nish [BusterBoy] wrote:
In a dialog based application the focus will always be on one of the child controls and not on the main dialog.
I didn't even think of that.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Read this article :-
http://www.codeproject.com/useritems/pretransdialog01.asp
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
Do you have any idea how I would do this without MFC and without any explicit message pump?
The create dialog only takes a handle to a CallbackProc and sends the dialog messages through that. I don't have any explicit access to the message loop (as far I as I know) to be able to intercept the keyboard input on the edit box child window.
I suppose if there is no other way I could explicitly create a thread and message pump to go with a CreateWindow but I would rather not put forth so much effort if there is a simpler way.
|
|
|
|
|
Well if you don't use MFC I assume you'll have something like this :-
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
Now you can put your code just above the call to TranslateMessage()
Regards,
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
The thing is that I don't have a message pump. Just a callback procedure. Is there anyway to collect child window messages into that callback procedure?
|
|
|
|
|
Hello -- so now that I have a good working code -- I want to show it off -- but if I print it out it loses all the pretty color syntax stuff. Here are my ideas:
(1) write a perl script that changes the code to some type of markup language
(2) drop the code in word and run a visual basic macro on it that does a bunch of find and replace runs
but I know that ya'll have a lot of great ideas out there . . . any that would make this little problem simpler?
thanks,
tim
---------------------------------------
Tim Booher
|
|
|
|
|
I always wondered why vc++ didn't supoort color syntax printing..
I think you cou ld save yerself alot of work and use UltraEdit32, which supports many lanuages and can print with color syntax...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
a2ps can pretty-print to color PostScript. If you don't have a PostScript printer, you can output with Ghostscript
|
|
|
|
|
Visit www.boost.org and download regex++ library. There is an example in the library that will help you to convert c++ source files in syntax colored html files.
With best regards,
Ivan
|
|
|
|
|
Go and download SciTE. It's nice little editor that does syntax hilighting, printing, and even lets you copy "pretty" code to the clipboard in RTF format; nice for pasting into code reviews, etc.
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
sweet -- thanks -- I also learned that emacs will allow a "print postscript" which is really nice. thanks for all the help -- I have a lot of options now which are a lot better than my perl script idea.
thanks,
tim
---------------------------------------
Tim Booher
|
|
|
|
|
I have a web-device that is running Windows CE 3.0 embedded. I've made a small webserver like application that allows me to type in it's IP address and view the webpages that I have set up on it.
I'm using a COM wrapper to wrap the low level C code. I instantiate the COM object with server side JavaScript (because there is no support for ASP), and perform the operations on the machine through the COM object.
Finally... Here's the problem: Whenever I call the functions to interact with the machine, the result I always get is 0 (S_OK). Even though I specify one of the parameters as [out, retval]. How do I call COM methods, that you usually pass a pointer to, from JavaScript and ASP, that do not have pointers?
Any help would be appreciated.
There's a fine line between confidence and arrogance.
|
|
|
|
|
joshkoppang wrote:
How do I call COM methods, that you usually pass a pointer to, from JavaScript and ASP, that do not have pointers?
Dunno about JavScript, but in ASP you can pass arguments ByRef. Same as in Client side VBScript
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
Nish [BusterBoy] wrote:
Dunno about JavScript, but in ASP you can pass arguments ByRef. Same as in Client side VBScript
How?
There's a fine line between confidence and arrogance.
|
|
|
|
|
C++
BSTR bsOutRetval;
HRESULT hr = myCOMObj->SomeMethod(&bsOutRetval);
....
SysFreeString(bsOutRetval);
VB
Dim sOutRetval As String
sOutRetval = myCOMObj.SomeMethod();
If you don't grab it, I can explain more.
Michel
|
|
|
|
|
DAMN, I misread the article. Again!
Sorry buddy
|
|
|
|
|
Hi,
How to capture monitor & display it on a Picture control using StretchBlt()
|
|
|
|