Problem in loading Image,GetLastError 33
-
Hi, I am loading JPG images using follwing code.
image.Load(Image);
HBITMAP hbmp = image.Detach();
if(hbmp == NULL)
{
Error = GetLastError();
}Load function is failing and I am getting error code 33. I am searching in google.But I am not getting any useful information. can anyone help me.
-
Hi, I am loading JPG images using follwing code.
image.Load(Image);
HBITMAP hbmp = image.Detach();
if(hbmp == NULL)
{
Error = GetLastError();
}Load function is failing and I am getting error code 33. I am searching in google.But I am not getting any useful information. can anyone help me.
From
WinError.h
:// // MessageId: ERROR_LOCK_VIOLATION // // MessageText: // // The process cannot access the file because another process has locked a portion of the file. // #define ERROR_LOCK_VIOLATION 33L
:)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hi, I am loading JPG images using follwing code.
image.Load(Image);
HBITMAP hbmp = image.Detach();
if(hbmp == NULL)
{
Error = GetLastError();
}Load function is failing and I am getting error code 33. I am searching in google.But I am not getting any useful information. can anyone help me.
In order to get the actual message from the OS you may use
FormatMessage()
Something like:DWORD dwError = ::GetLastError();
LPTSTR lpBuffer;
CString csErrorMsg;if (::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, dwError,
MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT), (LPTSTR)&lpBuffer, 0, NULL) != 0)
{
csErrorMsg.Format("%s", lpBuffer); //csErrorMsg contains the message
} -
Hi, I am loading JPG images using follwing code.
image.Load(Image);
HBITMAP hbmp = image.Detach();
if(hbmp == NULL)
{
Error = GetLastError();
}Load function is failing and I am getting error code 33. I am searching in google.But I am not getting any useful information. can anyone help me.
hemlat wrote:
Load function is failing and I am getting error code 33.
If
Load()
is failing, you should be callingGetLastError()
after it, notDetach()
."Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons