|
try
cout << *e << endl;
instead.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
|
How can I send mail with win32? Not with MFC.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Search for articles on SMTP.
|
|
|
|
|
In addition to SMTP, search for (Simple) MAPI, and CDO.
|
|
|
|
|
hi, i'm trying to display bitmaps using Raw RGB values. I don't know how to create a bitmap using RAW RGB values in c++ though.
I'm new to c++ so if you could help me out it would be a great help.
|
|
|
|
|
Search codeproject for using DIB sections. Other than that I have no idea what you are talking about.
Trust in the code Luke. Yea right!
|
|
|
|
|
The control/class is available for VC++6 or VB6.
Thanks
DJ
|
|
|
|
|
you may use MicroSoft MAPI controls!!
Take help on Microsof MAPI controls.
or
you may user outlook API's / Office API's to send the mail. But it will be confined to outlook only.
Vikram
|
|
|
|
|
I'm creating a few thread pool classes in which I want to be able to suspend/pause a thread that is waiting for work to do. [the different classes are basically different methods of handling high workload or simple static thread-pools etc that map down to a single interface for access. Btw, if there's any novel ways that you have, I'd be glad to know them too, so I can expand the Interface implementations.]
The SuspendThread/ResumeThread method is what I currently have implemented as doing that, but I cannot find any information on performance relating to using these functions, particularly frequent calls to them. I saw some data about it and the .Net implementation, which said that its SuspendThread and ResumeThread weren't all that safe to use due to unknown-stop points [though so far to me it seems it operates right in the raw Win32 version.. though I havent run many tests]
|
|
|
|
|
I did some reading in the MSDN library and it seems I could use WaitMessage and post messages to the thread to awaken it and also have work to queue [such as passing the address to a job instance as one of the message values]
Does this sound reasonable and would have good performance as opposed to any other method? To me it looks like no kernel objects are used [besides the thread itself] which seemed to be the biggest hit in performance of methods.
|
|
|
|
|
You should rarely, if ever, use SuspendThread/ResumeThread. It creates a system that is entirely unpredictable and which will be prone to all sorts of problems, including synchronization problems.
Generally, you should use either i/o completion ports and/or events with WaitForMultipleObjects inside the thread (one event should be a shutdown event so you can signal the thread to clean up and shut down.)
|
|
|
|
|
Thanks. I found a Thread class that implemented an Interrupt function and found that it used APC queuing, which I didnt think about before. I didnt get to see it's code though because it was a big-ol-library that was for sale. But i looked on MSDN and found that Queueing an APC function would break alertable wait functions, such as SleepEx [which i used]. I implemented an Abort function which the APC function calls a cleanup function inside the "job" so that things can get cleaned up. I also implemented a simple Interrupt function which the APC function does nothing i.e. Foo() { } so that all it did was break the sleep.
[Since I was using member functions I had to wrap the function in a way that a static function was given the 'this' ptr and that was used in accessing the cleanup function, etc.
|
|
|
|
|
Can someone tell me how to convert COleFont to CFont? I really don't know much about OLE objects.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Hi all.
I have a DialogBar which I've added to my SDI application. I create the Dialog resource with some text areas and buttons in Resource View and add it to the application, docked at the bottom. All is well. However, the buttons are grayed out as though they're disabled. I can get a handle to the CButton at runtime and it does indeed think its enabeled. Checkboxes, radio buttons, list boxes, etc. all seem to work without looking disabled. What's the deal?
Code that adds the dialog bar, in CMainFrame::OnCreate :
if (!m_wndTransBar.Create(this, IDD_TRANS_BAR, CBRS_BOTTOM, IDD_TRANS_BAR)) {
TRACE0("Failed to create translation bar\n") ;
return -1 ;
}
|
|
|
|
|
Have you added handlers for your toolbar to the mainframe class
ON_COMMAND_RANGE(ID_DYNAMIC_START, ID_DYNAMIC_END, OnDynamicCommand)ON_UPDATE_COMMAND_UI_RANGE(ID_DYNAMIC_START, ID_DYNAMIC_END, OnUpdateDynamicCommand)
???
Brian
|
|
|
|
|
Aha! Didn't know that just not adding a handler would cause it to draw disabled. Thanks much for the help.
- Matt
|
|
|
|
|
Can anyone please tell me why this isn't working? It compiles fine and runs, but the close button doesn't get "greyed out".
#include "stdafx.h"
#include "CELL v2.h"
#include "windows.h"
#include "tchar.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
using namespace std;
CWinApp theApp;
char buf[100];
void CloseMenu(){
wsprintf(buf,_T("CELL"));
SetConsoleTitle((LPCTSTR)buf);
HWND hwnd=NULL;
while(NULL==hwnd)
hwnd=::FindWindowEx(NULL,NULL,NULL,(LPCTSTR)buf);
SetConsoleTitle (_T("CELL"));
HMENU hmenu=GetSystemMenu(hwnd,FALSE);
DeleteMenu(hmenu,SC_CLOSE,MF_BYCOMMAND);
}
int _tmain(int argc,TCHAR* argv[],TCHAR* envp[]){
int nRetCode=0;
if(!AfxWinInit(::GetModuleHandle(NULL),NULL,::GetCommandLine(),0)){
cerr<<_T("Fatal Error: MFC initialization failed")<
|
|
|
|
|
You might just need to redraw the frame. Try manually switching to another window then switching back to your console to see if it's really getting grayed out or not. If you want to do it from code (the code I posted you yesterday had this call in it):
::SetWindowPos( hwnd, NULL, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_DRAWFRAME );
Chris Richardson
You can stash and you can seize
In dreams begin, responsibilities U2 - Acrobat[^]
Stop being PC and accounting for everyone and his momma's timeframe. Just enjoy your - Rohit Sinha in the content-challenged thread
|
|
|
|
|
I'm trying to get values out of the registry, using CRegKey, and I'm able to get number and string values from the registry, but when ever I try to QueryValue a binary value the QueryValue fails. I can't seem to get it to work no matter what I try.
Thanks in advanced
There's always one more bug.
|
|
|
|
|
What's the return value from RegQueryValueEx()? Post code.
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Well, I was using the MFC class CRegKey. The problem is more I dont know what type of variable to use that the QueryValue function would put the binary data into.
For example, to get a string, i do this:
<br />
CString str;<br />
if( key.QueryValue( str.GetBuffer(pwcount), branch, &pwcount)==ERROR_SUCCESS )<br />
{<br />
str.ReleaseBuffer();<br />
return str;<br />
}<br />
and to get a number, i do this:
<br />
DWORD dwValue;<br />
CString str; <br />
if( key.QueryValue( dwValue, branch)==ERROR_SUCCESS )<br />
{<br />
str.Format("%i", dwValue);<br />
return str; <br />
}<br />
In both of those example key and branch are sent to the function and I'm pretty sure the problem doesn't lie within them. I'm really just not sure how to get the binary data into a variable.
Maybe going the non-MFC route would be better?
Thanks,
Steve
There's always one more bug.
|
|
|
|
|
It would help if you knew how the data was written to the registry. That way, the same format can be used to retrieve the data.
In one of my apps, I write some binary data using the following:
long lColumns[20];
...
lResult = RegSetValueEx(hKey, "Columns", 0, REG_BINARY, (LPBYTE) &lColumns[0], sizeof(lColumnIds));
If I was to try and pull that data out without any knowledge of how it was written, I'd be in for a lot of work. Since I do know the format, I can simply use:
dwBufferSize = sizeof(lColumns);
lResult = RegQueryValueEx(hKey, "Columns", NULL, NULL, (LPBYTE) lColumns, &dwBufferSize);
CRegKey is a neat class and all but I stopped using it a few years ago because I couldn't guarantee it would work in all necessary environments. Read the MSDN article Q190686 for details.
|
|
|
|
|
I am using a virtual list control, in the message LVN_GETDISPINFO i am setting the text but how can i set the ItemData.
ON_NOTIFY(LVN_GETDISPINFO, ID_LIST, GetDispInfo)
void CWndEx::GetDispInfo(NMHDR* pNMHDR, LRESULT* pResult)
{
LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
LV_ITEM* pItem= &(pDispInfo)->item;
if (pItem->mask & LVIF_TEXT)
{
//Comes here
}
if(pItem->mask & LVIF_PARAM)
{
//NEVER COMES
}
}
When i call m_ListCtrl.GetItemData(nRow) it allways returns 0 and never comes to the GetDisplayInfo function. Do you set the ItemData some other way or just handle getting the ItemData in your own function?
Any Ideas?
|
|
|
|
|
I don't believe you can set the item data using callbacks. Only the text and image index can be set that way. You would set the item data either whenever you add the item to the control (InsertItem) or with SetItemData after it's added.
|
|
|
|