then, I want to know that the first dialog I created is close or still active,
I don't know how to specify that the dialog , which has some mark to specify it, or else , I use the function showMydlg, it will create lots of dialog, I want to show it if it was not created, or create it if it is not showing!
if some one know ,please tell me , it was so trouble thing, that some one use my application, who continuously clicked one button , so many dialog show make me shy!
if you know what I mean , please give me a better way to solve it !
First, the problem with your code is that you have a pointer local to a function (the CMydlg *dlg pointer which is in showDlg). You allocate memory for this pointer but when you reach the end of the function, you don't have any grasp over the pointer anymore. Thus, this will result in a memory leak. Instead of making it local in the function, make it a member of your class (CMyapp). This way, you can control if this dialog is already created (pointer points to a valid dialog class) and you can retrieve the status (if the dialog is visible or not).
And, furthermore, there is no need to make it a pointer, just show/hide it with the CWnd::ShowWindow function.
I know what you mean, you say that I make it a member of my dlg class.
that creating it when I use it ,and assert it , and show it correctly,
But the problem is that :
I create a CListCtrl,
and add many item at it !
You know the ICQ:
I simulate it ,
when I dbclicked one item, show a dlg(this dlg is diffrent by its content),
If I dbclicked the same item, show the dlg I just created!
but if the list has so many items, ex 1000,
shall I prepare 1000 pointer at my application as a member at a class?
so I want to find a way that I want to create it when I want to show it !
just I want to decrease the class member pointer!
If it's no way , I think I only use dlg* mydlg to solve it !
hi i had written the code to block the specific port using packet filtering API,all work fine but "Pfbindinterfacetoindex" execute successfully but did not block the port so i googled and find another API pfbindinterfacetoindex but it still fails the only problem could be here where give index
My project's Classview has become cluttered with a lot of classes and global functions. Many of these are used internally by a component. Is there a way to remove the ones from Classview that I find unnecassary. I am using Microsoft eMbedded Visual C++. Thanks for any help.
You can create folders in ClassView - right-click the project and select New Folder. You can then drag classes into the folder. Unfortunately you can't manage global functions in this way.
An alternative is simply to remove the headers from the project. They aren't required to be part of the project in order to compile - dependency analysis will pick them up. Obviously you should not remove them from source control, if you're using IDE integrated source control.
I am writing a plugin for windows media player.(UI pluging-Setting)
And I am using its wizard to create it. But when the OnPositionChange is called
oldposition and newPosition give a number like -119927078 or 182007653.
Please help me.
-- modified at 9:49 Monday 7th August, 2006
Every new thing you learn,Gives you a new personality.
Sort your items before putting them in the COleSafeArray container, or use Excel's automation features to sort the items after they are stored in the xls file. COleSafeArray doesn't have any built-in sorting functionality.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Blew is my code:
CELinkConfiguratorView is the view of my SDI application,Online() is the handler message of a menu, CCBrowseOnline is the class of a model dialog.
when click the menu,the the DlgBrowse dialog should be poped up,but it didn't pop up sometimes .but it poped up after I press the Alt button on the keyboard. why?how to resolve this problem?
// TODO: Add your command handler code here
CELinkConfiguratorDoc* pDoc = GetDocument();
// Open the serial port
if(pDoc->ComportInfo.ubComInterface == 0)
msg.Format ("*** Error: Can't open com port");
I have a propertypage.I have two edit controls.For the first edit control it should have a range of 5 to 50 and for the second it should be 60 to 100.Whenever the entered data was not in this range I gave an error message and set the focus using SetFocus().I have done this in the OnApply() also.
The problem is I have entered the data in the first control and even after receiving the error message and the focus was set also,I have neglected that and entered the data in the second control.For that also I did the same.Finally in the OnApply() also after neglecting the error messages , the dialog has closed.
My requirement is the focus should not go and it has to rise indefinitely if it is not in the range unless I click cancel.Is my approach correct?Please give me a solution.
Thanks in advance.
Last Visit: 25-Nov-20 16:11 Last Update: 25-Nov-20 16:11