|
The (overabused... ) Singleton design pattern [^] can easily modifed to fulfill such a requirement.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I am just giving you simple way, try it.
class resritct
{
public:
restrict(){}
void show(){ cout<<"restricted class"; }
};
void main()
{
for(int i=0;i<3;i++)
{
resrict r;
r.show();
}
}
sampath-padamatinti
|
|
|
|
|
I think the OP would be more interested than me...Anyway do you really think that delegating the responsibility of restricted object creation to the class consumer(s) makes the trick?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I want to tile the 4 dialogs in the window, in my MFC application
|
|
|
|
|
Elsie wrote: I want to tile the 4 dialogs in the window, in my MFC application
Calculate the composite width and height of your dialogs and make sure the client portion of your window is exactly that size. As you create each dialog move it to the appropriate quadrant of the window.
|
|
|
|
|
You can dynamically create 4 dialogs, here is to create a dynamically child dialog:
<br />
CRect rect;<br />
CChildDlg *pDlg=new CChildDlg();<br />
<br />
pDlg->Create(IDD_ChildDlg,NULL);<br />
pDlg->GetWindowRect(rect);<br />
<br />
pDlg->MoveWindow(10,20,rect.bottom,rect.left,TRUE);<br />
<br />
pDlg->ShowWindow(SW_SHOWNORMAL);<br />
pDlg->UpdateWindow();<br />
pDlg = NULL;<br />
|
|
|
|
|
hi everybody!
i want to use "SetWaitableTimer" api,but i don't know how to set "pDueTime". for example,if i
want to set "pDueTime" a value "2009-10-20 13:34:10",what value should i set to "pDueTime".
|
|
|
|
|
Use SystemTimeToFileTime[^] and convert the time that you need represented using the SYSTEMTIME[^] structure to a FILETIME[^] structure. You can now convert the FILETIME to a LARGE_INTEGER[^]. The documentation for FILETIME tells you how to.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)
|
|
|
|
|
No, useless.
Use directly RTL apis.
|
|
|
|
|
Reference?/Example?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
I have a project in which C-ISAM DB is used , now client want to have Oracle RDBMS and
C-ISAM both the DB support for the project i.e an environment variable will deside weather
to go for the C ISAM or RDBMS. Currently C- ISAM is implemented we need to implement RDBMS
support using OCI APIS. Do any body have the sample code of who to achieve this.
Problem is how we convert the data in C which is in structures into the compatiable string
for OCI calls.
REgards
Amit
|
|
|
|
|
HI all,
i m using a ListCtrl,FindItem use to find a item but its works only for first column.its not find the item even its present in other column.
i want to search it in whole list with use of FindItem.
please exaplain me how can i do this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
I once did this by using GetItemText in a nested loop.
Don't know of any other method, but the time it took when compared to FindItem was almost similar.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)
|
|
|
|
|
You will have to use getItemText(row,column) and you will have to loop it starting from 0 to number of columns for each row.
For eg : you have 1 row and 3 columns so it wil go some thing like this
for each row : for (UINT iCount = 0; iCount <3 ; iCount++ )
{
CString strRet;
strRet = GetItemText (rownumber,iCount);
}
Implement accordingly to you code .......
Regard,
Kushagra
I hate coding but I luv to develop
|
|
|
|
|
I already answered this here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
1. no sort (desc) option
2. can not select date on advanced search - the date browser has no OK button (it is a bug - my OS is win2k, english), so date from ... to ... can not be changed.
3. after doing advanced search, I go to last page because of no desc sort (total 40 pages), but year on last page is the same as first page: 2005 - date on to of from .. to ... is today, 2009.
search of the forum worked perfectly before, how does it become this style now?
|
|
|
|
|
The search is temporarily broken. I noticed this yesterday and I've now reported this at the suggestions forum.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
not from yesterday - I dare not use search for long time - I can not find my last post before today in 20 minutes.
|
|
|
|
|
I don't have problems searching for posts on the forums. I'm talking specifically about article search. Further more, this has nothing to do with the C++ forum and if you face issues finding messages, etc., please use the suggestions forum for that. Do not create threads here reporting issues!
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
A CWebBrowser2 and a CEdit are on 2 pages of CTabCtrl of a dialog (MFC).
When user clicks different page (TAB item) of CTabCtrl, CWebBrowser2 and CEdit are shown/hidden respectively.
But whence CWebBrowser2 is hidden by its ShowWindow(SW_HIDE), it is hidden for forever and can not be shown again by its ShowWindow(SW_SHOW).
Is it something wrong in my code or CWebBrowser2 just this way - if so, any solution?
BTW: SetVisible(...) of CWebBrowser2 is not working according to my test.
|
|
|
|
|
i got a similar problem, and wanted to record the work around i did to acheive this. hope the OP must have got the solution for this problem by now.
i observed that, when we hide the CWebbrowser2 object, its hwnd is getting desroyed, and hence is throwing a crash, when tried to show it back.
there are two possible workarounds.
1.make its position as 0,0,0,0, using move window-to hide it. and revert its actual position back when you want to hide it.
ctlWebBrowserM.SetWindowPos(NULL,0,0,0,0,SWP_SHOWWINDOW);
2.create a pointer variable, when you wanted to show it, and display it. and then delete the pointer accordingly, when you want to hide it.
|
|
|
|
|
Hello,
I have created a CRichEditCtrl window with borders. When I run the application in debug mode and apply break point in the function that creates the window the border is seen on window .
But when the break point is not applied in the function the border is not seen.
I have written the following code to create the window
CRect Rect(0,20,20,40);
CRichEditCtrl::Create(WS_BORDER|WS_VISIBLE|WS_CHILD ,Rect, this,1);
What is difference when i apply breaks and I dont ?
Pritha
|
|
|
|
|
VC has many bugs - more than our program's.
the key point is if all are fine in release version, don't worry so much about debug.
when I develop my program, I start from release, every thing is fine except it can not be run in debug from some day unknown.
|
|
|
|
|
hello,
thanks for your reply.
but the code that I have written appears the way I want in debug version but it is different in release version.
pritha
|
|
|
|