Hi all, I have a program that does all kinds of graphical stuff. It calls classes from classes, etc. On the deepest level, something may change which requires the mainroutine to redraw the image. Currently, I pass all these classes a pointer to the parent class, and call "m_Parent->SendMessage (XL_REDRAW)". In the main class, I catch this message and perform the necessary drawing actions. However, this causes the program to crash in the release version. Everything goes well in the debug version however. Please note that the subclasses are no windows in their own right, but are basically just called from the parent class and may in turn again call sub classes themselves. Anyone any idea why this approach does not work? (and of course most of all: how to solve this) Thanks in advance William
Wim Engberts
Posts
-
SendMessage crashes -
To be modal or not to be modalJames, Thanks for your answer. I have now indeed introduced a flag, which is set in an overridden DoModal routine. Works just fine. Thanks, William
-
To be modal or not to be modalHi all. In an earlier question I indicated that I generate child dialog by means of "Create". However; when defining a new entry I prefer to use a modal dialog for a number of reasons. This means that - for example - in the OnOK routine, I can have a modal dialog or not; which means that I need to react differently. Anyone have any idea how to find out if the dialog is modal or not? I could of course set a flag myself (since I know how I am creating the dialog) but isn't there a neat way of doing this? Thanks in advance William
-
Child keeps covering parentThanks a lot. This does indeed solve the problem. William
-
Child keeps covering parentThanks a lot; this solved the problem. William
-
Child keeps covering parentHi there all, Ik create a child dialog using CDialog->Create, followed by ShowWindow. Works just fine. I can now again activate the parent window, while the child is still alive. However: The child still covers the parent even if the parent is active and the child is not. There is no way that I get the parent to overlap the child when it is activated (I know that this can be the hard truth in real life, but I would like my computer to do what I want)! How do I do such a thing? Thanks in advance, William
-
Cannot remove directoryYou are absolutely right! Never thought I'd need that after FindNext returned FALSE! Thank you very much. William
-
How to Perform Logical operationHi Shah, Following routine should do the job: int StrToBinary (LPCTSTR szString) { int nBit = 1; int nResult = 0; int i; i = strlen (szString); while (i > 0) { if (szString[--i] != '0') nResult |= nBit; nBit *= 2; } return nResult; } Good luck William
-
Add Scroll bar to a Static control-(pls reply)Why don't you declare it directly as a scrollbar? CScrollBar *temp = new CScrollBar; temp->Create (NULL,.......); In that case you would have all the normal scrollbar's access. William
-
Cannot remove directoryHi all, In a program I use "RemoveDirectory (LPCTSTR szName)" to remove a directory. However, this never seems to work. GetLastError () claims that "the process cannot access the file because it is being used by another process", which is not the case. I have no problem in removing the same directory from either a command-line or from the explorer. I am sure that the directory is empty (this is done in a preceeding bit of code in the same program). Anyone any ideas? Thanks in advance, William
-
Display thumbnail in DialogHi all, I have a little dialog-based application that maintains information on paintings. On the dialog where I show/edit the information pertaining to an individual painting (like the filename of the painting's image, a title, a date etc) I would like to show a thumbnail of the image. These images can be either jpeg, bmp or gif files. Anyone have any suggestions on how to do this? Thanks in advance William
-
problem with frame levelsBrad, Thanks for your reply. I unfortunately do not yet have anything of this all on-line, it still resides on my d: disk (which I cannot open to the outside world) I would be happy to send you a zipfile with the complete content 357 kb). If you would like me to do that, then please send me an email to: wim.engberts@centric.nl to which I can then reply with this zipfile. Thanks in advance William
-
problem with frame levelsBrad, You are absolutely right. What I am trying to do is to have page as follows: +---------------------------------------------------------------------+ | header frame | +---------+------------+---------------------------------+------------+ | | Menu frame | Main image and info frame | | | blank | | | blank | | frame | | | frame | | | | | | +---------+------------+---------------------------------+------------+ | footer frame (just to leave some space at the bottom) | +---------------------------------------------------------------------+ All these frames remain the same, but for the main image and info frame. Based on selections from the menu buttons in the menu frame, I select different html pages in that frame. One of those is a page with a number of thumbnails on which the user may click. When he does that, I would like to show the full image pertaining to that thumbnail, using this lightbox mechanism. And again: it does work, but it only works in this main image frame whereas I would like it to work on the full window. regards, William
-
problem with frame levelsBrad, To be complete, I also give you the main "index.htm", from which the html that I just posted is called: Margo Engberts The call to "Aquarel/index.htm (which I posted earlier) is done when the menu-item "Aquarel" is selected from menu.htm: Margo Engberts
Hope this will help. Regards, William
-
problem with frame levelsBrad, Of course: Aquarel
[](images/Schilderij I crop.jpg "Blauw<BR>Aquarel 2003 ca. 125x85") [](images/Schilderij II crop.jpg "Rood<br>aquarel 2003") [](images/Schilderij III crop.jpg "Engel<br>aquarel 2005<br>met 24kt bladgoud")
In itself, this works just fine. The only problem is that this html file is within a frame (which is within another frame within yet another frame) and that the function of "lightbox" is only within the current frame, where I would like it work within the entire window and to center the image on the entire window. Regards, William
-
problem with frame levelsHi Brad, I do not mind at all of course. The other guy's solution can be found at: http://www.huddletogether.com/2006/01/10/lightbox-js-update/#comment-1638 Regards, William PS: I just checked this link: it does not directly point to the relevant comment; the comment I am referring to is comment #220 by Sean K. William
-
problem with frame levelsHi all, I am a newbe to the html/java scene. I am trying to build a website that shows paintings. I found a nice java popup mechanism called "lightbox" This obscures the screen and displays the chosen image over it. Hoever, my site uses frames and when I do that, the display is only relative to the current frame and not the entire screen. In the FAQ list for lightbox, there is someone with a solution to that, however I do not understand what he is doing there. As I see it, I should either het the javascript to run under the main window rather than in the current frame, or I need to be able to pass a reference to the top window to the java script. Could anyone help me in how to achieve something like that (as I said: I am an absolute novice in this area, but I do have a vast experience in programming in general and C/C++ specifically) Thanks in advance, William
-
Disconnect data exchangeDavid, This is indeed what I do, however, I would like both controls to do their data exchange with the same CString variable, since I always show only one of the two (either the CEdit or the CComboBox), depending on the mode that I have selected for the dialog. I am now experimenting with a double DDX_Text in the DoDataExchange routine (referring both controls to the same CString). This compiles fine and it also seems to work properly. However, when starting the classwizard, I get an error. So far I have been able to go around this by putting the second DDX_Text outside of Microsoft's automatic data map (so putting it behind the "//}}AFX_DATA_MAP" line). So far, this seems to work properly. Regards, William
-
Disconnect data exchangeHi to you all, In a Dialog, I use an Edit element to enter a key value for new objects. I use the same dialog somewhere else to select one of the objects and I then replace this CEdit element with a CComboBox from which the value can be selected. I would likt to use the same CString variable. In the current version, this CString is connected to the CEdit object in the DoDataExchange by a DDX_Text(pDX,.....). I would likt (in the OnInitDialog routine) to disconnect this CString from the CEdit element, and reconnect it (with a new DDX_Text probably) to the CComboBox element. Is there a way in which one can disconnect the data exchange? Or should I take the DDX_Text for this element out of DoDataExchange and put it in OnInitDialog altogether? Anyone have any suggestions? Thanks in advance William
-
Get and set file date and timeThanks, That was indeed the one I forgot about. Regards, William