|
- Manually edit your
.rc resource file and add the following to the definition of your dialog template:
IDD_TEST_DIALOG DIALOGEX 0, 0, 185, 92
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "Test"
FONT 8, "MS Sans Serif"
<font color="#ff0000">CLASS "MYDIALOGCLASS"</font>
BEGIN Of course you can replace "MYDIALOGCLASS" with whatever name you please.
- Register the new class somewhere before the creation of the dialog (
InitInstance is a good place):
WNDCLASS wc;
GetClassInfo(NULL,"#32770",&wc);
wc.lpszClassName="MYDIALOGCLASS";
AfxRegisterClass(&wc); - Enjoy!
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hey, it works. Thank you very much!
CK
|
|
|
|
|
Made a cd writing application and when it was creating the ISO I had a modeless dialog box, it was there for about 15 minutes and it crashed
It doesnt crash when its just there for a few minutes
anyone seen this before???
|
|
|
|
|
I have apps with modeless dialogs up constanty - the problem is with your code, modeless dialogs do not have a time limit.
Have you tried debugging and seeing where it crashes ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Modeless dialogs can stay around for as long as it is required provided the program doesn't do any nasty thing to them. I'd say you've got a bug here --try to locate the lines of your code where you issuing a delete pModelessDlg (where pModelessDlg is the variable you use to hold a pinter to the dialog) and set breakpoints on these lines to determine if they're executed when they shoudn't.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Its not getting deleted before its finished,
The pointer to HWind is NULL
Thanx guys
|
|
|
|
|
If it's NULL, then DestroyWindow has been called ( which is the correct way to delete a modeless dialog ).
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Hi,
How can I update the view of my flexgrid control at run time? I want to display different query output passed to the remote data control connected to the flexgrid, at runtime.
Please Help
|
|
|
|
|
You can use Update() or(refresh(),I'm not sure which one)for flexgrid controller,or you can use one of these functions for controller of it's Adoc.
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
My code is this....
m_Rdc.SetSql ("Select * from emppers");
m_Rdc.Refresh ();
m_Flex.Refresh ();
m_Rdc is the member variable of type RemoteDataControl and m_Flex is of FlexGridControl.
But this is not working. Is there any other way to do this.
Pls Help.....
|
|
|
|
|
My app loads data into a buffer at startup all of the same type of record, but variable length.
To make the data more readable i'm going to display it in differenct ways. The tree will have 2 root items each of which will use the same data, but displayed differently. One is structured the other is chronological.
Anyways how would you suggest I send the current item info to the corresponding ListView...?
Chronological will send all the data over to the list view.
Structured will send only relevent info into the listview.
There doesn't seem to be a GetIndex() that would map to an array of data items. How should i go about doing so...?
I'm thinking get the current HTREEITEM and iterate the buffered array of data items for a match and send the info then over to the listview...
Any ideas...?
Thanx muchly!!!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
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
|
|
|
|