|
|
Where do you find that function?
It's not documented anywhere in the MSDN Libaray...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Try to "Search" Tab in MSDNL. =)
ps: I've faced this function when I've been programming SnapIn.
ps2:here is the local address in my hard disk: (but I'm not sure that URL will be correctly displayed in forum):
mk:@MSITStore:C:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2000OCT\1033\period99.chm::/html/VC99A01.htm
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Found it
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hi Andres,
You A2OLE isn't good for use in long strings ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
If you use a standard stacksize and convert more than 1 mb with the ATL macro's, you get a stack overflow error, and your app. crashes...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
So, if my data was more 1 MB then i must use _alloca() ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
No, it means you should change stack size. (in linker's options)...
ps: it's a never-ending thread =)
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
I don't think changing stack size is such a good idea.
If you change data you don't know the size of, at compiletime, you never know if your program works...
ps: it's a never-ending thread =)
Yep
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Nope, the ATL conversion macro's uses _alloca(), which allocates on the stack.
If you want to convert, say 5 mb, you cannot use theese macro's, but have to do it in another way, where you can allocate your memory on the heap...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
A2OLE allocate memory from stack ?
Or do you mean SysAllocString for BSTR strign ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
A2OLE allocate memory from stack?
Yes
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Good, so how can i allocate memory from heap for A2OLE ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi all.
What is Requery() ???
Is it for refresh recordset ?
So, when i add/new/delete/edit each record, i must use it ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
G'day Hadi,
Requerying a recordset is functionally similar to closing and re-opening the recordset without some of the overhead.
It's useful for those situations where you open a recordset which is sorted on a particular field. Now, say you add some records to the set. These new records 'appear' at the end of the recordset and not necessarily in their properly sorted position in the recordset. Just call Requery() and all of the records will be re-sorted.
I hope this makes sense.
Steve
|
|
|
|
|
Hi steve.
Thank you for useful answer ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
hi,
I like to know how can the save dialog can appear when i click on the close button to close my application.
Thanks
Ehsan
Ehsan Behboudi
|
|
|
|
|
I do it in an MDI App in my MainFrame OnClose handler like this:
CWinApp* pApp = AfxGetApp();
POSITION posTemplate = pApp->GetFirstDocTemplatePosition();
while (posTemplate)
{
CDocTemplate* pTemplate = pApp->GetNextDocTemplate(posTemplate);
POSITION posDocument = pTemplate->GetFirstDocPosition();
while(posDocument)
{
CDocument* pDoc = pTemplate->GetNextDoc(posDocument);
if (pDoc)
{
CGrausPaintDoc* pGPDoc = (CGrausPaintDoc*) pDoc;
if (!pGPDoc->m_bSaveSinceLastChange)
{
CString s;
if (pGPDoc->m_Filename.GetLength()>0)
s.Format("%s - save before close ?",pGPDoc->m_Filename);
else
s = "Untitled - save before close ?";
DWORD response = AfxMessageBox(s,MB_YESNOCANCEL | MB_ICONQUESTION);
switch (response)
{
case IDYES:
pGPDoc->OnSaveDocument(pGPDoc->m_Filename);
case IDNO:
pGPDoc->m_bSaveSinceLastChange = true;
pGPDoc->OnCloseDocument();
break;
case IDCANCEL:
return;
}
}
}
}
}
Most of this code is just to step through all the open documents - if you have an SDI app, you just need to get the Doc *, check a flag you set for changes (users will hate being asked to save if they have not done anything to the document ) and call OnSaveDocument. You'll note I also allow the user to press cancel - if they are being prompted they should get a chance to decide not to close the program.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Wasn't standard MFC implementation enough? And what's difference between m_bSaveSinceLastChange and CDocument::SetModifiedFlag/IsModified?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I presume you're telling me MFC has a flag built in that does the same thing ? The difference then would be one of control, but I admit to having vague recollections of the flag you're talking about and not knowing about it at all when I implimented the code I posted.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Just call CDocument::SetModifiedFlag(TRUE) when your document changes and all saving/filename prompting will be done by MFC. It's already there.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hello all,
I am trying to capture desktop wallpaper into memory device context, but it wasn't successful. Here are the steps I did.
1: create a DC for the screen and create a compatible memory DC to screen DC
2: get screen resolution for bitmap width and height
3: create a bitmap compatible with the screen DC with width and height obtained from step 2
4: select created bitmap into memory DC as a drawing surface
5: create clipping region in the memory DC
6: paint the desktop pattern to the memory DC with PaintDesktop(HDC hdc) API function
7: copy the bitmap in the memory DC on to the clipboard, I got a black image when pasting it to WordPad.
Could you please give me some pointers for this problem? Did you spot any problems in the steps I performed? I can tell that PaintDesktop() didn't paint the desktop pattern into my memory DC. I really got stuck. Thank you very much for your help.
|
|
|
|
|
HKEY_CURRENT_USER\Desktop\Wallpaper will give you the path to the wallpaper file, then it would be easy to use ::LoadImage ( assuming a bmp ) to load it into a DC and copy it across to another if desired.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
PaintDesktop worked OK with memory device context in NT 4. In Windows 2000 it fails. The funny thing is that you can call PaintDesktop with HDC obtained using ::GetDC or CClientDC and it will work, even on Win2000.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi there
how can i change the dialog dsplayed in the dialog bar while runtime. i want to change the dialog when the user hits a button.
how can i realize this in MFC...
thank you
|
|
|
|