|
jpg2tga.cpp is not actually part of the library. It is an example program.
However, if you really need such a functionality you could try to modify the code (if possible) to fit your needs.
Another option could be using an external (serial) RAM.
THESE PEOPLE REALLY BOTHER ME!! How can they know what you should do without knowing what you want done?!?!
-- C++ FQA Lite
|
|
|
|
|
Is there a way to retrieve CPrintInfo from a PRINTDLG structure ?
I had tried following code:
PRINTDLG pd;
pd.lStructSize = (DWORD)sizeof(PRINTDLG);
if(AfxGetApp()->GetPrinterDeviceDefaults(&pd))
{
CPrintInfo PrintInfo;
???
}
This CPrintInfo object I want it into a CView constructor ...
|
|
|
|
|
Your code merely creates an empty CPrintInfo structure. You should check the documentation[^] for full details.
|
|
|
|
|
I see ... and there is no solution to retrieve CPrintInfo in C(My)View constructor ?
|
|
|
|
|
The Remarks section on the documentation page states:
CPrintInfo is a structure and does not have a base class.
The framework creates an object of CPrintInfo each time the Print or Print Preview command is chosen and destroys it when the command is completed.
So this control is only available within those two sections of your application, after either menu item is selected. It is possible that you could force this by sending a Print or Print Preview message to your application.
|
|
|
|
|
Richard, is there a way to force printpreview to application, in such a way that user see nothing about it, just for retrieving CPrintInfo ? Could you tell me how ?
|
|
|
|
|
Flaviu2 wrote: Could you tell me how ? Sorry, no, I have never tried such a thing.
|
|
|
|
|
Ok, no pb, I have to digg in ...
|
|
|
|
|
Richard, I still have a question: I had tried to create manually an CPrintInfo object, just like that:
CPrintDialog pdlg(FALSE);
pdlg.GetDefaults();
HDC hDC = pdlg.CreatePrinterDC();
if(NULL != hDC)
{
m_pPreviewInfo = new CPrintInfo;
m_dcPrint.CreateCompatibleDC(CDC::FromHandle(hDC));
m_pPreviewInfo->m_rectDraw.left = 0;
m_pPreviewInfo->m_rectDraw.top = 0;
m_pPreviewInfo->m_rectDraw.right = m_dcPrint.GetDeviceCaps(HORZRES);
m_pPreviewInfo->m_rectDraw.bottom = m_dcPrint.GetDeviceCaps(VERTRES);
m_pPreviewInfo->m_bContinuePrinting = TRUE;
m_pPreviewInfo->m_bDirect = TRUE;
m_pPreviewInfo->m_bDocObject = FALSE;
m_pPreviewInfo->m_bPreview = TRUE;
m_pPreviewInfo->m_lpUserData = NULL;
m_pPreviewInfo->m_pPD = &pdlg;
m_pPreviewInfo->SetMinPage(1);
m_pPreviewInfo->SetMaxPage(2);
m_nPages = m_pPreviewInfo->m_nNumPreviewPages;
m_pPreviewDC = new CPreviewDC;
m_pPreviewDC->SetAttribDC(m_pPreviewInfo->m_pPD->m_pd.hDC);
m_sizePrinterPPI.cx = m_dcPrint.GetDeviceCaps(LOGPIXELSX);
m_sizePrinterPPI.cy = m_dcPrint.GetDeviceCaps(LOGPIXELSY);
m_nPages = m_pPreviewInfo->m_nNumPreviewPages;
if (m_nPages == 0)
m_nPages = 1;
else if (m_nPages > m_nMaxPages)
m_nPages = m_nMaxPages; }
where m_pPreviewInfo and m_pPreviewDC is protected members of CMyCustomPrintPreview:
CPreviewDC* m_pPreviewDC;
CPrintInfo* m_pPreviewInfo;
of the first sight, I had do something wrong on the above code ? Because when I am trying to use m_pPreviewInfo object in CMyCustomPrintPreview::OnDraw, is crashing and I get an access violation on:
_AFXEXT_INLINE UINT CPrintInfo::GetMaxPage() const
{ return m_pPD->m_pd.nMaxPage; }
Thank you.
|
|
|
|
|
I suspect that your CPrintDialog object is going out of scope thus causing this error. You should use new to create it before adding it to your CPrintInfo .
|
|
|
|
|
Yes, that was it ... Thank you. I am go with one step further ... I come beck soon.
modified 26-Sep-14 3:21am.
|
|
|
|
|
Yes, I had created dinamically (with new), but when I am trying to clean up in my class destructor, it crashing ...
CPrintPreview::~CPrintPreview
{
if(NULL != m_pPrintDlg)
delete m_pPrintDlg; }
weird ...
|
|
|
|
|
Are you sure that your CPrintInfo object still exists at this point?
|
|
|
|
|
I am sure that is not null ... is not enough ? How can assure of CPrintInfo existence ?
|
|
|
|
|
It should be enough, but if it has somehow been corrupted, or already deleted then you will get a crash. The only way to check is via the debugger.
|
|
|
|
|
Thank you Richard, deleteing CPrintInfo object is excluded, the destructor is the only place where I explicity delete this object ... I have to dig in ...
|
|
|
|
|
I tried to create a COM component for outlook using article "Building an Office2K COM addin with VC++/ATL". When I register COM, COM added in outlook (display a button in oulook), But If I again open outlook (means 2nd time), COM addin is not there.
What I need to change so that COM functionality should be there untill I unregister the COM component?
|
|
|
|
|
Hi,
I need VC++ code,for copy the particular data from Notepad to another Notepad.
Example, i have lots of data, i need to copy the particular content from Notepad to another Note pad.
Notepad 1:
<Debug: LogRLZ> arg Answer = windows //WINDOWS option will go to excel sheet
<Debug: LogRLZ> arg Answer = patio_doors //patio_doors option will go to excel sheet
<Debug: LogRLZ> arg Answer = entry_doors //entry_doors option will go to excel sheet
Notepad 2_expected Result:
windows
patio_doors
entry_doors
Same kind of datas are available in Notepad.
please provide me the vc++ code.
Thanks
|
|
|
|
|
|
|
Hello Guys.
I have a problem. I have a windows service compiled with various dll's and it includes a project in C++ that contains a reference to Oracle.DataAccess.
The server where that service was installed now has Windows Server 2008 R2 x64. When I try to install the service i get a error in the C++ project. I compiled the project for x64 and now it installs perfectly but when i try to use it i have a BadImage error refering to the Oracle.DataAccess.
I understand that the problem is because the Oracle.DataAccess is x32, but since i can't install oracle x64 in that machine is there anything I can do to make my c++ project run as x64 using the Oracle.DataAccess x32 in the Windows Server x64?
Thanks in advance guys.
|
|
|
|
|
You can NOT mix 32 and 64-bit code in the same process. You either have to recompile your app as 32-bit or install the 64-bit Oracle client.
|
|
|
|
|
Indeed.
I had to install the 64-bit Oracle client.
Now I'm trying to config the application to use 64-bit or 32-bit Oracle client according to the processor type using the configuration in the app.config:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Oracle.DataAccess"
publicKeyToken="89b483f429c47342"
culture="neutral"
processorArchitecture="x86" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Oracle.DataAccess"
publicKeyToken="89b483f429c47342"
culture="neutral"
processorArchitecture="Amd64" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Thanks for your help Dave.
|
|
|
|
|
Hi,
I writing a small application which will notify whenever any windows messages or Dialogue boxes appear with any of the (Error,Information,Warning,Question) Icons.
this is how i am doing..
main()
{
WinHAn = FindWindowA(NULL,"Windows Security");
if(WinHAn != NULL)
{
EnumChildWindows(WinHAn,SearchIcon,(LPARAM) &winIconSearch);
}
}
static BOOL CALLBACK SearchIcon(HWND hwnd, LPARAM lParam)
{
style = GetWindowLongPtr(hwnd, GWL_STYLE);
if ((style & SS_ICON) == SS_ICON)
{
thisHan =(UINT64)SendMessageW(hwnd, STM_GETIMAGE,IMAGE_ICON, 0L);
searchHan =(UINT64) LoadIconA(NULL, (LPCSTR)(IDI_WARNING));
if(thisHan ==searchHan )
{
printf("Icon Found");
}
return TRUE;
}
This is only for Warning messages.But it is not working. can any body tell me what the problem is..
Thanks.
vvk.
|
|
|
|
|
You might add some more output to your program to see which code is reached or use the debugger for the same purpose. E.g. if a window with the title "Windows Security" is found and if such a window contains a static control with an icon.
Your check for SS_ICON is wrong (but this is not the reason for finding nothing). You should use:
if ((style & SS_TYPEMASK) == SS_ICON)
Finally I'm not sure if this can be done this way. While the LoadIcon description states that it may return a handle to an existing resource, this may be only true when the icon has been loaded by the same application.
|
|
|
|