|
Hello,
I'm making a wizard and on one of the pages the user should select a filename.
I could integrate a button which says 'select filename', make a CFileDialog variable and call DoModal and copy the selected name back into a field, but what I really want to do is display the CFileDialog as the content of my CPropertyPage instead of in a seperate window, of course without the Ok and Cancel buttons.
I searched for any pointers in Google and msdn but couldn't find anything that helps me going in the right direction.
Does anyone of you have any pointers or links to an example?
Wim
|
|
|
|
|
I'm afraid that the answer is that you can't do it. You can't contain any of the common dialogs in a property page, because they're implemented as modal dialogs, not modeless child dialogs. The 'select filename' button that launches a separate CFileDialog is your only option.
(This question is answered in the "Visual C++/MFC Frequently Asked Questions" article by Stingray Software in the MSDN Library, title "How do I embed a common dialog in a property page?")
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
But.. you can embed a common dialog inside another dialog and then call it...
And if you can do so, you'll be able to use the newly created dialog as a property page (This is only a suposition)...
Here's how to do it: (following the sample in the book) and referring to embed the common dialog inside a normal dialog...
- Create a new dialog.
- insert a group control where you'll want to get the common dialog inserted.
- change it's ID to: stc32(=0x045f)
if you cannot do it, contact me, I'll email you a sample (not in a property page but inside a dialog), the conversion should be easy...
Remember... I'm not sure if this work inside a property page, but it seems that it should do it...
Hope this helps...
|
|
|
|
|
I have to perform find operation in an ADO
recordset using complex WHERE clauses.
I have found that Find function doesn't support
complex WHERE clauses.
Which function have I to use ??
Which is the best way to perform Find operations
with complex WHERE clauses ???
Thanks a lot !!!
|
|
|
|
|
Create new recordset using your WHERE clause.
Pavel
Sonork 100.15206
|
|
|
|
|
I've done as you say...
but now I have a problem with WHERE condition...
I wrote:
CADORecordset l_Recordset;
l_Recordset = CADORecordset(p_pDb);
l_cstrSearchString = _T("SELECT * FROM MY_TABLE Field1 = '") + p_rcstrSelName + _T("' Field2 = '") + p_rcstrSelDate + _T("'");
l_Recordset.Open(l_cstrSearchString, CADORecordset::OPEN_TABLE);
When I execute this operations.. it says that there is an error in FROM position...
Can you help me ???
|
|
|
|
|
am i missing something here ? i don't see any where clause in your code :
"SELECT * FROM MY_TABLE Field1=..."
^
|
|
|
|
|
Hello,
I'm not familiar with your CADORecordset class, but two things stands out right away:
1. Your SELECT statement seems to be missing the 'WHERE' and 'AND' keywords.
'SELECT * FROM My_Table WHERE Field1='string1' AND Field2='string2'
There doesn't seem to be any spaces between the field filters.
Make sure that the SQL statement is valid.
2. The CADORecordset::OPEN_TABLE enumerator tells me that you are trying to open the table directly (ADO::adCmdTableDirect). This will fail if you pass an SQL string instead of the table name. Try ADO::adoCmdText, (equivalent in CADORecordset).
---
happy hunting
|
|
|
|
|
Elloh
I work with a CTreeCtrl, one root: #childs en #leafs/child.
Everytime i click on the tree, i validate if we are talking about root, child or leaf. When it's a leaf, i put some text in a textbox. Works all fine.
Made a button 'Update'. When i click on that button, it checks if the current textbox is empty or not. If it's empty i delete the child, when the parent has no childs left, i delete the parent too. This works all fine if i press the button. But i alsoo want the 'onkillfocus' on that button, it does the same action. Done that, not prob.
But when i click on the treelist, the onkillfocus of that 'update' button reacts, then it checks if editbox is empty or not. But the problem is:
the editbox has already been changed because you clicked somewhere else, other information in it. The code of 'Update' action checks the current selection, but it now has changed and it wants to change for example the other leaf. (because i clicked on another leaf on that tree, it changes selection and my routine checks the current selection, need to have the 'old' selection).
Greetings
Jens
|
|
|
|
|
I've written a Wizard based app using MFC6 on Windows2000. If I run (release version)it on Win95 and Win98 everything is fine. If I run it on my PC with Windows2000 it is fine, but if I run it on two other Windows2000 PCs is get an erro messagebox saying....
app.exe - Entry Point Not Found
The procedure entry point SetHandleContext could not be located in the dynamic link library KERNELL32.DLL
Anyone got any ideas what I'm doing wrong please? Thanks
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
Could be something wrong with one of the following dll's.. (Got that from one of the links below)
Winsock.dll
Wsock32.dll
Ws2_32.dll
Ws2help.dll
http://searchwin2000.techtarget.com/tip/1,289483,sid1_gci809680,00.html?FromTaxonomy=%2Fpr%2F5e3
http://www.jsifaq.com/subh/tip3900/rh3919.htm
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hello,
In MDI project, i work with CHtmlView and i want to add scrollbar to my childs windows.
so i do :
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style = WS_VSCROLL | WS_HSCROLL |WS_OVERLAPPEDWINDOW;
m_HScroll.Create(SBS_BOTTOMALIGN ,CRect(0,0,0,0),this,ID_HSCROLL);
}
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
m_HScroll.SetScrollRange(0,50,TRUE);
m_HScroll.SetScrollPos(0,TRUE);
}
When the prorgram start, i have scrollbars in my child window, greats !
I can detect :
void CChildFrame::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
void CChildFrame::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
but when i do a m_HScroll.SetScrollPos(10,TRUE); the ScrollBar don't move it is always in the left.
the user can use the scrollbar (it always stay in left position), i can detect when the user click on it and i can move my view, but i can't move my scrollbar.
if i do m_HScroll.SetScrollPos(10,TRUE); and int toto = m_HScroll.GetScrollPos()
toto == 10 !
but "at the screen" the scrollbar stay in the left.
Have you any idea ?
PS: excuse for bad english
|
|
|
|
|
I think the problem is that m_hScroll isn't actually the scroll-bar that you see in the window. When you set the style (cs.style () in PreCreateWindow to WS_VSCROLL | WS_HSCROLL the window creates its own scrollbars, and you need to use the member functions of CWnd to access them.
For example, to get and set the position of the horizontal scroll-bar
void CChildFrame::some_function(int sb_pos)
{
SetScrollPos(SB_HORZ, sb_pos, TRUE);
int current_pos = GetScrollPos(SB_HORZ);
ASSERT(current_pos==sb_pos);
}
You'll also need to change your OnCreate function:
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
SetScrollRange(SB_HORZ, 0, 50,TRUE);
SetScrollPos(SB_HORZ, 0,TRUE);
}
And take out the m_hScroll from your window.
Hope that helps (and I hope it's right too!)
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
I have only one word to say thank !!!!
now I use the scrollbars which I see .
thx again
|
|
|
|
|
Hello,
My question is simple:
How to blit a 8 bpp gray scale offscreen surface to a primary surface (currently 32 bpp RGB)?
When I blit these surfaces I get the error code: 0x80004001h = E_NOTIMPL = "The function called is not supported at this time"
I know that's a DirectX specific question but if anybody could help me... I will thank him all my life
Hello World!!!
from Raphaël
|
|
|
|
|
I want to add my toolbar and band to explorer. And if click the button of my toolbar, band is shown, and one more click, then band is hidden...
I find ShowBrowser() method, but this method has only show or hide, not toggle...
So, I must know band is shown or hide..
Band's state can change by not only my toolbar button but also menu in explorer...
What can I do in this case?????
@ P.S. I don't know my english can understand you..
Can't speak in English well.. -_-;;;
Thank you for reading, and Thank you very much for
responsing...
Hi
|
|
|
|
|
Hi,
I have an imagelist which i have created using ILC_MASK | ILC_COLOR32 flags abd added XP alpha channel icons to it. The totally transparent section of the icon are fine but the section where it's suposed to be shadowed on the edges is black. Is there a way to solve this
|
|
|
|
|
I want to Create a Frame/view/doc structure On a ActiveX Control,but It will be Found Memory leak! And I Found that the reasons is :
CDocManager* CDocManager::pStaticDocManager;
CPtrList* CDocManager::pStaticList;
How Can I avoid Memroy leak?
the Following is My Code :
BOOL Create()
{
if( m_pFrameWnd )
{
if( IsWindow(m_pFrameWnd->m_hWnd) ) return TRUE;
}
CSingleDocTemplate * pDocTemplate;
pDocTemplate = new CSingleDocTemplate(IDR_MAPTYPE,
RUNTIME_CLASS(CMapDoc),
RUNTIME_CLASS(CMapFrame),
RUNTIME_CLASS(CMapView));
CMapDoc * pDoc = new CMapDoc;
CCreateContext Context;
Context.m_pCurrentDoc = pDoc;
Context.m_pNewDocTemplate = pDocTemplate;
Context.m_pNewViewClass = RUNTIME_CLASS(CMapView);
Context.m_pLastView = NULL;
Context.m_pCurrentFrame = NULL;
CMapFrame * pFrameWnd = new CMapFrame;
m_pDoc = pDoc;
m_pFrameWnd = pFrameWnd;
m_pDocTemplate = pDocTemplate;
CRect rcMap;
GetClientRect(&rcMap);
BOOL ret = m_pFrameWnd->Create(AfxRegisterWndClass(CS_DBLCLKS), NULL, WS_CHILD|WS_VISIBLE, rcMap,this,NULL,&Context);
m_pFrameWnd->ShowWindow(SW_SHOW);
return ret;
}
ZHANGYIFEI
ZHANGYIFEI
|
|
|
|
|
Solve the problem yourself: Trace every object you create and you find your leak.
(You even didn´t mentioned the leak )
Try this @ home. (B&B)
|
|
|
|
|
If nobody could answer it the first time, nobody can answer it after 5 times, 50 times, or 500 times. The only thing posting it more often will achieve is making everybody here less likely to read any of your questions in the future.
The only thing that might help us give you an answer is if you provide more information, not just repost the same thing. For example, which objects leak, what is the Create function a member of...
Oh, and learn what the <pre> tag does, it'll make reading your code a lot easier for the rest of us, and that might also help you get an answer. I promise you that spamming the board won't.
"We are the knights who say Ni" (The Knights Who Say Ni)
|
|
|
|
|
Why, it's the simplicity of the problem. Do the easy things first rather than getting wrapped up in a complicated solution. I see two (2) operator new()'s, where are the corresponding delete's. You haven't discussed this. I assume the example code resides in an object. If you allocate memory off the heap you are responsible for freeing that memory, say in the object's destructor. Describe what you've done to resolve the problem, what objects are being leaked, where you try to release them, etc. There's not enough information to resolve your issue.
|
|
|
|
|
I gave basicaly the same answer 2 days ago, on the 1st post (I think). If he cann't use that or the suggestion I gave him on my replay to his reply. Then forget it.
Trust in the code Luke. Yea right!
|
|
|
|
|
the proplem look easy !but not, and not "new->delete" so easy!why don't try
it by yourself ,look what happen! the code i have offer! I have delete all,but Can't avoid leaks,the reason is MFC two static data member,and this two member is internal use!!
ZHANGYIFEI
|
|
|
|
|
:(I've said before that this is not enough imformation for me to solve the problem. By the looks of things I would need the project, all any of us can do is make sugestions on possible solutions. The rest is up to you.
// These values are inialized in APPCORE.CPP
// If this is part of your code I am supprised
// you did not get a multiple definition errors.
CDocManager* CDocManager::pStaticDocManager;
CPtrList* CDocManager::pStaticList;
Complete list of source files associated with CDocManager:
AFXWIN.H, APPCODE.CPP, APPUI2.CPP, DLLINIT.CPP,
DOCMGR.CPP, DOCMULTI.CPP, DOCTEMPL.CPP
No one ever said debbuging was easy!
|
|
|
|
|
CDocManager* CDocManager::pStaticDocManager;
CPtrList* CDocManager::pStaticList;
those two member is not in my code ,those in MFC code !
I said that those two member appear memory leak!
BOOL Create() //in ActiveX OnCreate Event perform this function!
{
if( m_pFrameWnd )
{
if( IsWindow(m_pFrameWnd->m_hWnd) ) return TRUE;
}
CSingleDocTemplate * pDocTemplate;
pDocTemplate = new CSingleDocTemplate(IDR_MAPTYPE,
RUNTIME_CLASS(CMapDoc),
RUNTIME_CLASS(CMapFrame),
RUNTIME_CLASS(CMapView));
// pDocTemplate in destructor function delete this!
CMapDoc * pDoc = new CMapDoc;// in destructor function delete this!
CCreateContext Context;
Context.m_pCurrentDoc = pDoc;
Context.m_pNewDocTemplate = pDocTemplate;
Context.m_pNewViewClass = RUNTIME_CLASS(CMapView);
Context.m_pLastView = NULL;
Context.m_pCurrentFrame = NULL;
CMapFrame * pFrameWnd = new CMapFrame;// in destructor function delete this!
m_pDoc = pDoc;
m_pFrameWnd = pFrameWnd;
m_pDocTemplate = pDocTemplate;
CRect rcMap;
GetClientRect(&rcMap);
BOOL ret = m_pFrameWnd->Create(AfxRegisterWndClass(CS_DBLCLKS), NULL, WS_CHILD|WS_VISIBLE, rcMap,this,NULL,&Context);
m_pFrameWnd->ShowWindow(SW_SHOW);
return ret;
}
//note :
CMapDoc inherit from COleDocument ;
CMapView inherit from CScrollView ;
CMainFrame inherit from CFrameWnd ;
I don't have CDocManager and it's derive class!
debug output :
Detected memory leaks!
Dumping objects ->
plex.cpp(31) : {72} normal block at 0x01402F70, 124 bytes long.
Data: < @ > 00 00 00 00 00 00 00 00 00 00 00 00 00 11 40 01
doctempl.cpp(64) : {71} client block at 0x01401060, subtype 0, 32 bytes long.
a CDocManager object at $01401060, 32 bytes long
doctempl.cpp(62) : {70} client block at 0x014010B0, subtype 0, 28 bytes long.
a CPtrList object at $014010B0, 28 bytes long
ZHANGYIFEI
|
|
|
|
|