|
Hi,
Does anybody have any sample about Automation with Outlook 2000? I need something like:
1) get what messages are stored inside each folder,
2) delete a message
3) read a stored message
and so on...
Thank u very much,
Dirso
|
|
|
|
|
See Q241287 and Q220600 in Microsoft KnoledgeBase
Bye,
Orbital^
...the night is long ... but not long enought to do some real coding ...
|
|
|
|
|
Is there a routine already written and available to convert from a string (or CString object) to a date/time variable (such as a CTime object, SYSTEMTIME structure or FILETIME structure)?
|
|
|
|
|
Take a look at COleDateTime::ParseDateTime()
Dave
|
|
|
|
|
Hello,
I wrote a program that opens DIBs (bitmaps) and saves them as well.
I'd like to be able to snap image/screen cap them, similar to the way Window->new opens a new window with the information from the old window in it. (i.e. a Bitmap in one window will appear in the next if I click window->new.)
Does anyone know how I can get the DIB of that open window? Or where the code that Window->New uses is? I'd like to actually see the code for hwo it is done, so I can write my own window->new. Even if that sounds redudant, it's a good learning thing.
Not to be too pesky, but if anyone knows where the code FileOpen uses is is also, I'd like to know. I'd like to write my own File Open that does the same thing.
Thanks guys,
NickOne
|
|
|
|
|
FileOpen calls stuff from your Mainframe down to your Document class. File|New, if it copies the bitmap, would do it on the internal resource. Getting a DC to the screen and copying the bitmap is how you do a screen capture. Something like CWindowDC dc(NULL);
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
Hello,
MSDN says
void UpdateAllViews(
CView* pSender,
LPARAM lHint = 0L,
CObject* pHint = NULL );
Now this call is in my menuclick event in the doc cpp. Lets say a view class called CViewTwo generated the click. I want view1 to reflect the changes, but not sending class (the CViewTwo class). I think if I dont have a NULL argument, it excludes the update of pSender. I am not sure exactly what will go into CView* pSender. How do I get the pointer to my sending viewclass from the doc click event?
Thanks so much!
|
|
|
|
|
If your doc handles the click, there is no sending view.
You need to handle the click in the view, not the doc, to do what you're asking.
|
|
|
|
|
CDocument::GetFirstViewPosition
MSDN Says it better
Papa
Murex Co.
Papa Charchabil
|
|
|
|
|
jim is right
to do your task the calling should be in view
it can be done in following way
suppose your classes are
CMyDoc
CView1
CView2
now in CView2 class on handler of the click event u can do this
CMyDoc *pDoc=this->GetDocument();
pDoc->UpdateAllViews(this);//passing this as argument excludes the view from which the function is called
pDoc->UpdateAllViews(NULL);//updates all views attached to document including the view from which the function is called(in this case view2)
surbinsho
|
|
|
|
|
Thank you so much for the responses. It works well, but I do have to set the controls newvalues by coding the OnUpdate event of the view thats supposed to reflect the changes. I get the doc pointer both in the sending view (to set the new value for the doc variable , as well as in the receiving view where I get the doc pointer in order to access the newly changed value.
Thanks,
ns
|
|
|
|
|
I'm writing a screen saver using the scrnsave library. I'm having a problem opening an Open Dialog box to browse for files. Here is the code i have right now, I want it to launch the Open Dialog box when a button is clicked on the config dialog(ScreenSaverConfigureDialog).
I've been working on this one problem since yesterday and I can't figure it out. Am I missing something here? any help would be greatly appreciated.
BOOL WINAPI RegisterDialogClasses(HANDLE hInst){
return TRUE;
}
BOOL WINAPI ScreenSaverConfigureDialog(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam){
OPENFILENAME ofn;
char szFile[260];
switch(message){
...
case WM_COMMAND:
switch(LOWORD(wParam)){
case ADD_IMAGES:
//initialize OPENFILENAME(ofn)
memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hdlg;
ofn.lpstrFile = szFile;
ofn.nMaxFile = sizeof(szFile);
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
//displays the box
if(GetOpenFileName(&ofn)){
...
}
break;
}
...
}
}
|
|
|
|
|
el_robert wrote:
I'm having a problem opening an Open Dialog box to browse for files.
Well, you didn't say exactly what problem you are stuck on.
If you just want to browse for a file, and you are working in MFC, I suggest you use CFileDialog. If you need a code sample, just let me know.
If you continue to do the same things you always did, don't be surprised if you get the same results you always got.
|
|
|
|
|
I don't know if this will solve your problem, but you are not passing it a FilterList string. You can do this by adding a line, something like the following, before you call GetOpenFileName():
ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
in response to marshall:
I cant get the dialog to pop up, but i'm also not getting any errors. I am not using mfc because I would have to do workarounds to use it with scrnsave.lib, and I only want to do that as a last resort.
in response to Roger:
I have that in there but it still doesnt work.
thanks to both of you for responding.
|
|
|
|
|
changed:
char szFile[260];
to:
char szFile[MAX_PATH] = "";
and it worked
|
|
|
|
|
A while ago I came across an article on how to enable disabled controls in an application from another application. Does anyone know where the link is?
Thanks
|
|
|
|
|
Please forgive me if this is the same question several times. Maybe there is a common answer to all.
In a SDI MFC project:
I have a handler in the MainFrame class that needs to call a function in the view. How do I do this? Do I have to use a user defined message for this or is there a better way?
What about the reverse - if I want to call a function in the MainFrame class from a member function of the view?
Also calling a func in the app class from view or MainFrame.
This seems simple but I have searched in the FAQ and articles without success.
Thank you
|
|
|
|
|
For an SDI app, the main frame is simply derived from CFrameWnd, so you can call the GetActiveView() member of CFrameWnd to retrieve the current view.
The reverse is easy: there are two relevant global functions here. AfxGetApp() which returns the application object, and AfxGetMainWnd(), which returns the main window of the application (in this case, the main frame).
Dave
|
|
|
|
|
here is what i want to do:
i want to check alive(working properly) and dead(not working well) links in a website by enterig
its url and it would show search results.
|
|
|
|
|
Didnt read it myself but guess its what u need!
http://www.codeproject.com/useritems/linkchecker.asp
Papa
Murex Co.
|
|
|
|
|
I experience the following problem after I have upgraded to MDAC 2.7 RTM Refresh (Build: 2000.81.9001.00): I have a COM component and I am using ODBC API functions to do a bulk copy load (bcp_init, bcp_readfmt, bcp_exec). For some reason, bcp_exec method fails somewhere in the driver's code. In ONLY happens when my COM component is running under COM+. If I don't register the component in COM+ then everything works perfectly! Here is some stack information I am getting when it fails:
Exception: C0000005
Address: 0x1F9CD9A3
Call Stack:
SQLSRV32!SQLGetConnectAttrW + 0x80
ODBC32!MpHeapCreate + 0x7250
ODBC32!SQLGetDiagRecW + 0x2DF
ODBC32!SQLSetConnectAttrW + 0x194
ODBC32!SQLSetConnectAttrW + 0x30
odbcbcp!bcp_exec + 0x60
...
Note, everything worked fine with MDAC 2.7 RTM (Build: 2000.81.7713.00). Microsoft claim they didn't change any code in MDAC 2.7 RTM Refresh, they only changed the build number. However, the fact is something that has worked before suddently stopped working after I have upgraded.
If you have experienced a similar problem or have any clue why this is happening please let me know. I need this urgently. I appreciate any help.
Thanks in advance,
Dmitry
Make things as simple as possible, but no simpler. -- Albert Einstein
|
|
|
|
|
hi .. ive seeked the hlp before and i got a response but still after making those changes im not able to save the bitmap file.)
here is the code which im writing .plz tell me where im doing wrong.Or plz snd me the correct code for dat
thanks
void COpenbitmapDlg::OnButtonBmp()
{
// TODO: Add your control notification handler code here
BOOL COpenbitmapDlg::WriteDIB(LPTSTR szFile, HANDLE hDIB)
{
//----------------------------------------
BITMAPFILEHEADER hdr ;
LPBITMAPINFOHEADER lpbi ;
if(!hDIB)
return FALSE ;
CFile file ;
if(!file.Open(szFile,CFile::modeWrite|CFile::modeCreate))
return FALSE ;
lpbi=(LPBITMAPINFOHEADER)hDIB;
int nColors = 1 << lpbi->biBitCount;
hdr.bfType = ((WORD) ('M' << 8) | 'B'); // is always "BM"
hdr.bfSize = GlobalSize (hDIB) + sizeof( hdr );
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
hdr.bfOffBits = (DWORD) (sizeof( hdr ) + lpbi->biSize +
nColors * sizeof(RGBQUAD));
BYTE* pDib =(BYTE*)GlobalLock(hDIB);
file.Write( &hdr, sizeof(hdr) );
// Write the DIB header and the bits
// file.Write( lpbi, GlobalSize(hDib) );
file.Write( lpbi, GlobalUnlock(pDib) );
return TRUE;
}
////////////////////////////////
// calling the above function here
CString m_sBitmap ;
CClientDC dc(this);
static char BASED_CODE szFilter[] = "Bitmap Files (*.bmp)|*.bmp|JPEG Files *.jpeg";
// Create the File Open dialog
CFileDialog m_ldFile(TRUE, ".bmp", m_sBitmap,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter);
// Show the File Open dialog and capture the result
if (m_ldFile.DoModal() == IDOK)
{
// Get the filename selected
m_sBitmap = m_ldFile.GetPathName();
// Load the selected bitmap file
//MessageBox(m_sBitmap);
HBITMAP hBitmap = (HBITMAP)::LoadImage(AfxGetInstanceHandle(),
m_sBitmap, IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE | LR_CREATEDIBSECTION);
// Do we have a valid handle for the loaded image?
if (hBitmap)
{ CBitmap m_bmpBitmap;
m_bmpBitmap.Attach(hBitmap);
BITMAP bmp;
m_bmpBitmap.GetBitmap(&bmp);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
dcMem.SelectObject(&m_bmpBitmap);
dc.BitBlt(0,0,bmp.bmWidth,bmp.bmHeight,&dcMem,0,0,SRCCOPY);
WriteDIB("C:\\1.BMP",hBitmap);
}
}
}
looking forward from all the gurus of code
|
|
|
|
|
hDIB is a HBITMAP, not a HANDLE.
go here:
http://www.codeproject.com/bitmap/cximage.asp
and see the difference between CreateFromHBITMAP() and CreateFromHANDLE().
|
|
|
|
|
abey kitni dafa question poochay gaa, bataya tha na key tiberian sun ki cd day kar jaa phir sab sawaloon ka jawab mil jaye gaa.
|
|
|
|