Click here to Skip to main content
15,927,936 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to check *.OCX register Pin
CPallini19-Jul-07 22:21
mveCPallini19-Jul-07 22:21 
QuestionIOCTL_DISK_GET_DRIVE_LAYOUT problem Pin
Perspx19-Jul-07 20:42
Perspx19-Jul-07 20:42 
AnswerRe: IOCTL_DISK_GET_DRIVE_LAYOUT problem Pin
Matthew Faithfull19-Jul-07 22:27
Matthew Faithfull19-Jul-07 22:27 
GeneralRe: IOCTL_DISK_GET_DRIVE_LAYOUT problem Pin
Perspx20-Jul-07 2:07
Perspx20-Jul-07 2:07 
Questionhow InvalidateRect Works??????? conceptual help Pin
himuskanhere19-Jul-07 20:38
himuskanhere19-Jul-07 20:38 
AnswerRe: how InvalidateRect Works??????? conceptual help Pin
CPallini19-Jul-07 21:36
mveCPallini19-Jul-07 21:36 
QuestionIcon background is black in 16bit color quality - vc++(vs2005) Pin
ksrameshkanth19-Jul-07 20:24
ksrameshkanth19-Jul-07 20:24 
QuestionRegarding printer related notifications Pin
Thanks for all the fish19-Jul-07 19:28
Thanks for all the fish19-Jul-07 19:28 
Hi!

I have a problem in retrieving printer information using FindNextPrinterChangeNotification() function.My code executes properly without any error and exception but all the values in LPPRINTER_NOTIFY_INFO structure are NULL or zero.code as follow


LPPRINTER_NOTIFY_INFO notification;
LPPRINTER_NOTIFY_OPTIONS notifyoption;
notifyoption = (LPPRINTER_NOTIFY_OPTIONS)HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(PRINTER_NOTIFY_OPTIONS) );

notification = (LPPRINTER_NOTIFY_INFO)HeapAlloc ( GetProcessHeap (), HEAP_ZERO_MEMORY, sizeof(PRINTER_NOTIFY_INFO) );

OpenPrinter("HP LaserJet 3200 Series PS",&hprinter,NULL);
if(hprinter == INVALID_HANDLE_VALUE)
MessageBox("printer not available","",MB_OK);

hnotify = FindFirstPrinterChangeNotification(hprinter,PRINTER_CHANGE_ALL,0,notifyoption);
notifyoption->Flags = PRINTER_NOTIFY_OPTIONS_REFRESH;
if(hnotify == INVALID_HANDLE_VALUE)
MessageBox("Invalid handle hnotify","",MB_OK);

DWORD retcode = WaitForSingleObject(hnotify,INFINITE);
if(retcode == WAIT_OBJECT_0)
{
BOOL ret = FindNextPrinterChangeNotification(hnotify,&changeNotify,notifyoption,(LPVOID*)notification);
if(ret !=0)
{
if(notification->aData[0].Type == PRINTER_NOTIFY_TYPE)
MessageBox("printer notification","",MB_OK);

sprintf(msg,"Field=%d",notification->aData[0].Field);
MessageBox(msg,"",MB_OK);
if(notification->aData[0].Field == PRINTER_NOTIFY_FIELD_SERVER_NAME)
{
MessageBox("Printer Name is","",MB_OK);
memcpy(printername,(char *)notification->aData[0].NotifyData.Data.pBuf,notification->aData[0].NotifyData.Data.cbBuf);
MessageBox(printername,"",MB_OK);
}
else
MessageBox("other than printer name","",MB_OK);

FreePrinterNotifyInfo(notification);

}

else
MessageBox("error in executing","",MB_OK);


ivalue of Field and cBuf is NULL
please if anyone can identify the problem..it will be very helpful for me



Thnaks in advance
Smile | :)
AnswerRe: Regarding printer related notifications Pin
Roger Broomfield19-Jul-07 20:32
Roger Broomfield19-Jul-07 20:32 
Questionconst member function Pin
vibindia19-Jul-07 19:19
vibindia19-Jul-07 19:19 
AnswerRe: const member function Pin
Paresh Chitte19-Jul-07 19:27
Paresh Chitte19-Jul-07 19:27 
AnswerRe: const member function Pin
User 58385219-Jul-07 20:23
User 58385219-Jul-07 20:23 
AnswerRe: const member function Pin
CPallini19-Jul-07 21:25
mveCPallini19-Jul-07 21:25 
QuestionADO Fails to Add New Record In Database, Code compiles and runs fine Pin
shivditya19-Jul-07 18:21
shivditya19-Jul-07 18:21 
QuestionAFXDLL Pin
Bram van Kampen19-Jul-07 15:52
Bram van Kampen19-Jul-07 15:52 
AnswerRe: AFXDLL Pin
Mark Salsbery19-Jul-07 17:33
Mark Salsbery19-Jul-07 17:33 
QuestionDynamic Create ActiveX control Pin
eraccn19-Jul-07 14:30
eraccn19-Jul-07 14:30 
QuestionCustom Button Class is Disabling Keyboard Input Pin
Myserverisdown19-Jul-07 14:05
Myserverisdown19-Jul-07 14:05 
AnswerRe: Custom Button Class is Disabling Keyboard Input Pin
mid=574119-Jul-07 15:31
mid=574119-Jul-07 15:31 
QuestionDialog items maximum Pin
Oliver12319-Jul-07 13:26
Oliver12319-Jul-07 13:26 
AnswerRe: Dialog items maximum Pin
Paul Conrad19-Jul-07 15:09
professionalPaul Conrad19-Jul-07 15:09 
AnswerRe: Dialog items maximum Pin
Michael Dunn19-Jul-07 18:17
sitebuilderMichael Dunn19-Jul-07 18:17 
JokeRe: Dialog items maximum Pin
Mark Salsbery20-Jul-07 5:20
Mark Salsbery20-Jul-07 5:20 
AnswerRe: Dialog items maximum Pin
Hamid_RT31-Jul-07 19:09
Hamid_RT31-Jul-07 19:09 
QuestionAlphaBlend a PictureControl [modified] Pin
cruonit19-Jul-07 12:33
cruonit19-Jul-07 12:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.