|
I want to save a bitmap image in Visual C++ 2003.I use the save method of the bitmap class of Gdiplus this way:
Gdiplus :: bitmap mybitmap;
mybitmap.save (L"C:\myFolder\",&bmpClsid);
But I get a win32Error.
Thanks in advance.
|
|
|
|
|
Did you try with CImage class? it has save method.
|
|
|
|
|
I want to use GDIPlus:: Image.
|
|
|
|
|
MozhdehQeraati wrote: mybitmap.save (L"C:\myFolder\",&bmpClsid);
file path error?
something like L"C:\\myFolder\\image1.bmp"
|
|
|
|
|
i Test with this format but get win32error.
|
|
|
|
|
Hi,
Did u start the GDI + engine?
ULONG_PTR m_gdiplusToken;
GdiplusStartupInput gdiplusStartupInput;
GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL);
Bitmap *pBitmap = Bitmap::FromFile(/*File name*/);
CLSID Clsid = {0};
GetEncoderClsid(L"image/bmp", &Clsid))
CString strFilePath = "C://1.bmp";
pBitmap->Save(strFilePath.AllocSysString(),&Clsid);
GdiplusShutdown(m_gdiplusToken);
Prasanth M V
Software Engineer.
|
|
|
|
|
I would like to know the value of win32 error.
|
|
|
|
|
I have downloaded the GINA sample of MSDN and made some changes in order to be able to logon domain with finger print. But I have some problems.
1. Sometimes I see this message while logging on: "There is a time and/or date difference between client and the server." But there is no difference. If I repeat running the virtual machine this message won't appear and rest of the procedure is followed.
2. The virtual machine is a member of a domain but I want to log on locally. What should I pass the "domain" variable to the functions? I have passed "" (empty string) but a message is shown that the user name / password is incorrect. But it isn't the case.
Thanks in advance.
|
|
|
|
|
Hello everyone,
In the following segment, it does not compile because const is qualified on (the whole) type int& not on the near one int, right?
using namespace std;
typedef const int& rcInt;
typedef int& int_ref_t;
int main()
{
rcInt ref = 0;
const int_ref_t x = 0;
return 0;
}
thanks in advance,
George
|
|
|
|
|
George_George wrote: it does not compile because const is qualified on (the whole) type int& not on the near one int, right?
yes,
|
|
|
|
|
Thanks Rajkumar!
My question is answered.
regards,
George
|
|
|
|
|
No,
U are getting error not beacuse of "const", but as it is reference variable.
Does answer make sense????
Prasanth M V
|
|
|
|
|
Thanks Prasanth!
My question is answered.
regards,
George
|
|
|
|
|
so got 2 accepted answers YES aand NO
|
|
|
|
|
Thanks Rajkumar,
Both of them are correct.
regards,
George
|
|
|
|
|
George_George wrote: it does not compile because const is qualified on (the whole) type int& not on the near one int, right?
his question,
rcInt ref = 0;
const int_ref_t x = 0;
both evaluates to a reading const int &x = 0; then how compiler interprets
Prasanth M V wrote: U are getting error not beacuse of "const", but as it is reference variable.
how about rcInt ref = 0; it is also a reference variable.
how the error because of reference variable came here, because in the expression,
const int_ref_t x, const qualifier on reference type (int_ref_t) is ignored and x become the type int &. while compiler interprets rcInt ref = 0, as reference variable of type const int.
|
|
|
|
|
Hi Raj,
I understood from his question that whether "const int_ref_t x = 0; " became error.
int_ref_t x is equivalnet to int& x. Am i right?
Then it will end with error. Does my expalnation make sese??
Thanks
Prasanth M V
|
|
|
|
|
Prasanth M V wrote: I understood from his question that whether "const int_ref_t x = 0; " became error.
No, its not "whether", he know there is a compilation error, his question is whether this is because const is qualified on ( int & ) type, while in the previous statement const is qualified on (int) of reference variable &x.
george_george wrote: In the following segment, it does not compile because const is qualified on (the whole) type int& not on the near one int, right?
Prasanth M V wrote: Does my expalnation make sese??
then what ur "NO" means, does he is not correct that const is qualified on type (int &)
|
|
|
|
|
OK.
Sorry if my statement milead you.
What i meant is that the error is beacause of reference variable, not by const.
Thanks
Prasanth M V
|
|
|
|
|
We use VC++ 6.0 for many years, and now here is VC++ 2005 and comming or arived VC++ 2008. Now the main issue is, how to write your code which will run on VC++ 6.0 and VC ++ 2005, yes I mean the new CRT security features.
see the function that you need to write:
strcpy, wcscpy, mbscpy, _tcscpy, _tcscpy_s. Now, somebody will say that just disable the warning and go ahead. But my question is...
Is There any way that you can write the code which will run equally on VC 6.0 and 2005, I mean w/o much effort, do not ask me to write all that predefined macros, like #if VCPP2005 then this and then that?
Why can not compiler decide that this code is for 2005 and this is for the lower version?
Any good answer??? I mean to Chris Maunder.
Thanks.
|
|
|
|
|
IMHO, the best way to do this is to create #define s that kick in when you are building is VC++6.0 that point back to the older versions of the SDK functions.
For example:
#if _MSC_VER <= 1200
#define _tcscpy_s( D, BS, S ) _tcscpy( D, S );
#endif Something like that will work, but you may get warnings about unused parameters.
This is not that hard to do, because you can find the include file that #define s the TCHAR -variants of the secure versions of the string handling functions and use it to make things easier.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi Experts,
I am trying to get the files and folders name from RecycleBin. But the statement "hr = m_pRecycleBin->CreateViewObject (m_hWnd, IID_IShellDetails, (VOID**)&pDetails);" is returning E_NOINTERFACE.
I could not know what is happening?
My code is:
<br />
CoInitialize(NULL);<br />
<br />
HMODULE m_hShell32 = LoadLibrary(_T("SHELL32.DLL"));<br />
typedef IShellFolder FAR* LPSHELLFOLDER;<br />
typedef IShellFolder2 FAR* PSHELLDETAILS;<br />
LPSHELLFOLDER m_pRecycleBin;<br />
<br />
<br />
<br />
BOOL bReturn = FALSE;<br />
STRRET strRet;<br />
LPMALLOC pMalloc = NULL;<br />
LPSHELLFOLDER pDesktop = NULL;<br />
LPITEMIDLIST pidlRecycleBin = NULL;<br />
HRESULT hr = S_OK;<br />
m_pRecycleBin=NULL;<br />
SHGetMalloc(&pMalloc);
hr = SHGetDesktopFolder(&pDesktop);<br />
hr = SHGetSpecialFolderLocation (m_hWnd, CSIDL_BITBUCKET, &pidlRecycleBin);<br />
if (NULL != m_pRecycleBin)<br />
{<br />
m_pRecycleBin->Release ();<br />
m_pRecycleBin = NULL;<br />
}<br />
hr = pDesktop->BindToObject(pidlRecycleBin, NULL, IID_IShellFolder, (LPVOID *)&m_pRecycleBin);<br />
if (SUCCEEDED (hr))<br />
{<br />
bReturn = TRUE;<br />
}<br />
if (S_OK == pDesktop->GetDisplayNameOf (pidlRecycleBin, SHGDN_NORMAL, &strRet))<br />
{<br />
GetName (strRet);<br />
}<br />
<br />
pMalloc->Free (pidlRecycleBin);<br />
pDesktop->Release();<br />
pMalloc->Release();<br />
<br />
PSHELLDETAILS pDetails = NULL;<br />
<br />
SHGetMalloc(&pMalloc);
hr = m_pRecycleBin->CreateViewObject (m_hWnd, IID_IShellDetails, (VOID**)&pDetails);<br />
if (SUCCEEDED (hr))<br />
{<br />
TCHAR szTemp[MAX_PATH];<br />
SHELLDETAILS sd;<br />
int iSubItem = 0;<br />
<br />
while (SUCCEEDED (hr))<br />
{<br />
hr = pDetails->GetDetailsOf (NULL , iSubItem, &sd);<br />
if (SUCCEEDED (hr))<br />
{<br />
switch (sd.str.uType)<br />
{<br />
case STRRET_CSTR:<br />
_tcscpy (szTemp, sd.str.cStr);<br />
break;<br />
case STRRET_OFFSET:<br />
break;<br />
case STRRET_WSTR:<br />
WideCharToMultiByte (CP_ACP, 0, sd.str.pOleStr, -1, szTemp, sizeof (szTemp), NULL, NULL);<br />
pMalloc->Free (sd.str.pOleStr);<br />
break;<br />
}<br />
iSubItem ++;<br />
}<br />
}<br />
}<br />
if (NULL != pDetails)<br />
{<br />
pMalloc->Free (pDetails);<br />
}<br />
pMalloc->Release();<br />
<br />
|
|
|
|
|
pther wrote:
typedef IShellFolder2 FAR* PSHELLDETAILS;
...
PSHELLDETAILS pDetails = NULL;
hr = m_pRecycleBin->CreateViewObject (m_hWnd, IID_IShellDetails, (VOID**)&pDetails);
type is IShellFolder2 and query for IID_IShellDetails, although this is not the error, returning E_NOINTERFACE means the interface is not supported by the object,
looking into IShellDetails, gives the information, IShellDetails is superseeded by
IShellFolder2 in newer version of windows,
change to
hr = m_pRecycleBin->CreateViewObject (m_hWnd, IID_IShellFolder2, (VOID**)&pDetails); that make sense to the type u defined
|
|
|
|
|
I tried with "hr = m_pRecycleBin->CreateViewObject (m_hWnd, IID_IShellFolder2, (VOID**)&pDetails);"
But problem is remain same.
It is also returning E_NOINTERFACE.
|
|
|
|
|
What is the "scope" of a mutex? (you know, when preventing multiple instances)
Is it "active" for multiple users?? i mean, lets say an app creates a Mutex to mark it's residency....if a second user executes an app...and it attempts to "OpenMutex()" is it successfull??
Also What's the Scope of Atoms??? (across multiple users)
offtopic : how long does it take for an article to be verfied by CP staff?
-st0le [st0le'n'stuff softwarez!]
http://st0lenc0des.googlepages.com/
modified on Tuesday, February 19, 2008 2:13 AM
modified 20-Oct-19 21:02pm.
|
|
|
|
|