|
hi,
i got LNK2001 errors.
I created a sample class in flashplayer7 and in that class i created pointer instances of some Directshow interfaces like IMediaControl etc....
When i tried to access the functions from the interfaces it is showing the below linker errors.
error LNK2001: unresolved external symbol "public: __thiscall CFlashPlayback::CFlashPlayback(void)" (??0CFlashPlayback@@QAE@XZ)
CFlashPlayback.obj : error LNK2005: "struct HWND__ * m_hWnd" (?m_hWnd@@3PAUHWND__@@A) already defined in win32camera.obj
Thanks and Regards
Harshadha
|
|
|
|
|
harshadha wrote: error LNK2001: unresolved external symbol "public: __thiscall CFlashPlayback::CFlashPlayback(void)" (??0CFlashPlayback@@QAE@XZ)
You forgot to provide defintion for constructor you declared.
harshadha wrote: CFlashPlayback.obj : error LNK2005: "struct HWND__ * m_hWnd" (?m_hWnd@@3PAUHWND__@@A) already defined in win32camera.obj
It seems that m_hWnd is declared twice in same namespace.
|
|
|
|
|
My error got resolved ..Thanks ...
Thanks
Harshadha
|
|
|
|
|
Hi,
I have to print images from my application.
For doing this, I created a Printer DC and the images is painted using 'StretchDIBits'.
Now the printing is OK.
The problem is of the sheet size.
How can i change the print size according to the different sheet sizes supported by the specified printer?
Please help.
Regards,
Kumar
Krishnakumar
|
|
|
|
|
For print you can use also of PrintDlg and also see this structure DEVMODE on MSDN
|
|
|
|
|
Hi,
Actually i want to know that, whether the printer DC is to be resized according to the paper sizes.
If yes, how can i change the size?
Me already checked with the following code
for( int nIndex = 0; nIndex < nNumPapers; nIndex++ )
{
CString csPaperSize = _T( pPaperNames ); /* Got from GetDeviceCapabilities */
memcpy( pDevModeOutput->dmFormName, csPaperSize.GetBuffer(csPaperSize.GetLength()), 32) ;
HDC hTempHandle;
pDevModeOutput->dmFields |= DM_FORMNAME;
CString csTemp( _T( "" ));
hTempHandle = ResetDC( hDc, pDevModeOutput );
nPixelX = GetDeviceCaps( hDc, HORZRES );
nPixelY = GetDeviceCaps( hDc, VERTRES );
csTemp.Format( _T( "%s : %d, %d" ), pDevModeOutput->dmFormName, nPixelX, nPixelY );
AfxMessageBox( csTemp );
}
but the nPixelX, nPixelY always getting the same for all paper sizes
Regards,
Krishnakumar
|
|
|
|
|
Did you see DEVMODE ? here[^] (dmPaperSize )
|
|
|
|
|
Hi,
The way I change the paper size is given below
pDevModeOutput->dmPaperSize = 0; // It should be set to zero if paper length and width are given seperately
pDevModeOutput->dmPaperLength = pPaperSizes[nSelection].y; // 2970 in case A4
pDevModeOutput->dmPaperWidth = pPaperSizes[nSelection].x; // 2100 in case A4
CString csPaperSize = _T( "" );
memcpy( pDevModeOutput->dmFormName, csPaperSize.GetBuffer(csPaperSize.GetLength()), 32) ;
pDevModeOutput->dmPrintQuality = -1;
pDevModeOutput->dmYResolution = 0;
//pDevModeOutput->dmScale = 90;
pDevModeOutput->dmFields = DM_PAPERSIZE |
DM_PAPERLENGTH |
DM_PAPERWIDTH |
DM_FORMNAME |
DM_PRINTQUALITY |
DM_YRESOLUTION; // DM_SCALE;
// To get the Devmode structure filled
if( !DocumentProperties( NULL, // handle to parent window
hHandle, // handle to printer object
csPrinterName.GetBuffer(csPrinterName.GetLength()+1), // device name
pDevModeOutput, // modified device mode
0, // original device mode
DM_IN_BUFFER// mode options
))
{
return;
}
hDc = CreateDC( NULL, csPrinterName.operator LPCTSTR(), NULL, pDevModeOutput );
nDPIX = GetDeviceCaps( hDc, LOGPIXELSX );
nDPIY = GetDeviceCaps( hDc, LOGPIXELSY );
Actually I don't know the procedure that how to change the paper size. I think some mistakes are there in my code or something is missing. I have to draw a rectangle that is fit into the specified paper size.
Please reply.
Krishnakumar
|
|
|
|
|
|
Hopefully this little cut & paste will help you...
Iain.
szPrintablePixelsMax.cx= ::GetDeviceCaps (hPrinterDC, HORZRES);
szPrintablePixelsMax.cy= ::GetDeviceCaps (hPrinterDC, VERTRES);
szPrintableArea.cx = ::GetDeviceCaps (hPrinterDC, HORZSIZE);
szPrintableArea.cy = ::GetDeviceCaps (hPrinterDC, VERTSIZE);
|
|
|
|
|
Me already tried the below code
szPrintablePixelsMax.cx= ::GetDeviceCaps (hPrinterDC, HORZRES);
szPrintablePixelsMax.cy= ::GetDeviceCaps (hPrinterDC, VERTRES);
it always returns the same value for all sheet sizes.
Regards,
Kumar
|
|
|
|
|
That's not a surprise - its returning the DPI for the printer. There were FOUR lines in the message I posted, and you are looking at the wrong two. Try the other two lines.
Iain.
|
|
|
|
|
As per MSDN, the below code returns the width and height in pixels,
int nX = GetDeviceCaps( hDc, HORZRES );
int nY = GetDeviceCaps( hDc, VERTRES );
Actually i meant that for some of the printers ( HP LaserJet 4250 PCL 5e ), the code gives different values for different sheet sizes.
But the problem is that some of other printers (hp deskjet 3500 series) gives the same values for different papaer sizes.
I am setting the size using the "DocumentProperties" function as below
pDevModeOutput->dmPaperSize = 0; // It should be set to zero if paper length and width are given seperately
pDevModeOutput->dmPaperLength = pPaperSizes[nSelection].y; // 2100 in case A4
pDevModeOutput->dmPaperWidth = pPaperSizes[nSelection].x; // 2970 in case A4
CString csPaperSize = _T( "" );
memcpy( pDevModeOutput->dmFormName, csPaperSize.GetBuffer(csPaperSize.GetLength()), 32) ;
pDevModeOutput->dmPrintQuality = -1;
pDevModeOutput->dmYResolution = 0;
//pDevModeOutput->dmScale = 90;
pDevModeOutput->dmFields = DM_PAPERSIZE |
DM_PAPERLENGTH |
DM_PAPERWIDTH |
DM_FORMNAME |
DM_PRINTQUALITY |
DM_YRESOLUTION; // DM_SCALE;
// To get the Devmode structure filled
if( !DocumentProperties( NULL, // handle to parent window
hHandle, // handle to printer object
csPrinterName.GetBuffer(csPrinterName.GetLength()+1), // device name
pDevModeOutput, // modified device mode
0, // original device mode
DM_IN_BUFFER// mode options
))
{
return;
}
Krishnakumar
|
|
|
|
|
What is the maximum possible size of an INI file in Windows XP to operate with standard windows APIs?
- NS -
|
|
|
|
|
|
NS17 wrote: What is the maximum possible size of an INI file in Windows XP to operate with standard windows APIs?
The maximum valid size for a .INI file is 64 kilobytes (K). Reference[^]
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
If API is used for .INI, then the Maximum limit is 64KB.
Come online at:-
jubinc@skype
|
|
|
|
|
HOWEVER, he explicitely asked for INI Files in Windows XP.
For those who havent noticed: The KB articles list all articles they apply to. In this case, the Windows Series up to Windows for Workgroups.
This might apply to Windows 95/98, but most certainly not to Windows XP.
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Sebastian Schneider wrote: This might apply to Windows 95/98, but most certainly not to Windows XP.
Why would you think it would be any different for XP?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello everyone,
Suppose I have a file created with FILE_ATTRIBUTE_NORMAL attribute. I think it means attribute FILE_FLAG_WRITE_THROUGH is not enabled. Is my understanding correct?
And I think if I do not enable the FILE_FLAG_WRITE_THROUGH attribute, even if flush operation (function call) will not *truly* dump data to disk. Is my understanding also correct?
So, my question is, when will the data be dumped to disk -- only when we close the file?
thanks in advance,
George
|
|
|
|
|
FILE_FLAG_WRITE_THROUGH is an instruction to the OS about how you want it to handle cacheing, it has nothing to do with file attributes.
|
|
|
|
|
Hi Mike,
I heard sometimes people will mention that if we do not enable FILE_FLAG_WRITE_THROUGH mode, data will be not safe (data missing or inconsistency)? Why?
regards,
George
|
|
|
|
|
Imagine if that were true. How often do you add FILE_FLAG_WRITE_THROUGH to CreateFile() calls? I don't think I've ever used it. I imagine that many Windows programmers are like me, and don't use it (if they even know about it). Now think about all the programs those people have written. Do you think all of them have data-loss bugs?
|
|
|
|
|
Hi Mike, I think FILE_FLAG_WRITE_THROUGH will degrade the performance since it needs to sync the OS buffer and disk more frequently. So, I am wondering whether each time when we issue write API (without flush), the content will always be written to the disk?
Why people does not use FILE_FLAG_WRITE_THROUGH? It is a good question. I think the answer to this question is to answer what are the differences between the cases when FILE_FLAG_WRITE_THROUGH is enabled or disabled?
Any comments?
regards,
George
|
|
|
|
|
I wanted to operate the menu selection via space key from the keyboard.
How would I do that?
For Ex. If we select the Menu File->Open. If we hit the Enter key on
Open menu it opens File Dialog. I wanted to do the same operation on
space key.
Raj
|
|
|
|