|
in my project there is a function called ExportandZip().it is working normally in debug mode.but in relese mode it is giving an error saying that "there is no source line for debugging information"what might be the reason.please let me know?
kir_MFC
|
|
|
|
|
|
See Debugging Release Mode Problems[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Sounds like the .pdb file is out of synch. Are you really wanting to debug in release mode? Can you delete the .pdb file and rebuild your project?
"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
|
|
|
|
|
Hai!
I am taking a image from a location, converting into byte array and displaying it back on my dialog by converting into bitmap image!
HBITMAP hBitMap;
hBitMap = (HBITMAP) LoadImage (NULL, \
"c:\\Documents and Settings\\Desktop\\Image\\bitmap1.bmp", \
IMAGE_BITMAP, SM_CXICON, SM_CYICON, LR_LOADFROMFILE);
CBitmap bmp;
bmp.Attach((HBITMAP)hBitMap); // handle I got from LoadBitmap
BITMAP bitmap;
bmp.GetBitmap(&bitmap);
int size = bitmap.bmHeight*bitmap.bmWidth*bitmap.bmBitsPixel/8;
BYTE *lpBits = new BYTE [ size ];
// Here i convert the image to byte array
::GetBitmapBits((HBITMAP)hBitMap,size,lpBits );
// Here i get the handle to the picture control on my dialog
HWND hImage = this->GetDlgItem(IDC_STATIC_IMAGE)->GetSafeHwnd();
// I Call the following function to paint the converted byte array
SetRawBitsToImage (hImage,bitmap.bmWidth,bitmap.bmHeight,lpBits ,32);
//The defination of the above function is
// hwnd = handle to the image control
// W = width of the raw bits Image
// H = height of the raw bits Image
// lpBits = pointer to the raw bits image
// BitCount = 32,24 etc ( depend on the bit count ) defualt =32
void CMyTryImageDlg:: SetRawBitsToImage (HWND hwnd,int W,int H,BYTE *lpBits, int BitCount)
{
HDC hDC = ::GetDC(hwnd);
::SetWindowPos(hwnd,0,0,0,W,H,SWP_NOMOVE);
BITMAPINFO bi;
memset(&bi,0,sizeof(BITMAPINFO));
bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bi.bmiHeader.biWidth = W;
bi.bmiHeader.biHeight = H;
bi.bmiHeader.biPlanes = 1;
bi.bmiHeader.biBitCount = BitCount;
bi.bmiHeader.biCompression = BI_RGB;
bi.bmiHeader.biSizeImage = bi.bmiHeader.biWidth*bi.bmiHeader.biHeight*BitCount/8;
::SetDIBitsToDevice(hDC,
0,0,
W,
H,
0,
0,
0,bi.bmiHeader.biHeight,
&lpBits,&bi,DIB_RGB_COLORS);
::ReleaseDC(hwnd,hDC);
}
// But nothing is getting displayed? why? Is there any mistake in code?
// I donot have knowledge in images
Thanks!
|
|
|
|
|
Where exactly does it seem to fail, did you try stepping thorough the code with the debugger to see what happens?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Yes,
Actually inside SetRawBitsToImage (), there is SetDIBitsToDevice (), it must return no of rows scanned, but it returns zero, I tried with GetLastError (), but it returns zero, stating no error, i tried while debuggging to see the value od hdc , it stated "Unused:Expression cannot be solved"!!
Thanks!
|
|
|
|
|
I tried to run your code and see what happens (in a completely new dialog-based project) but for some reason if i try to load a bitmap either from resource or from file with LoadImage or LoadBitmap i get back NULL and zero for GetLastError or either "the parameter is incorrect" or "there is not enough storage to execute the requested command" (not literally quoted)... so anyways, you know you might get negative heights for a bitmap if it is stored upside-down, this nice feature can make one's life ...less enjoyable... so maybe try checking out the heights...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Why the flip do that at all? You've loaded the image into a bitmap - why not just display that with BitBlt[^] or StretchBlt[^]?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Actually this is a sample to check "How to display image from an byte array?"
In my actual requirement, I will be having an byte array, i have to display image from it?
I was just trying withe the function , but nothing gets displayed !!
Any other simple technique to display Byte Array to image on my dialog box !!
Please its very urgent!!
thanks !
|
|
|
|
|
You code doesn't make sense.
As I said again and again you should at least know how the image data is stored in your buffer before even attempting to display it.
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]
|
|
|
|
|
|
hello,
After i build my project and run it i get the following error :
Debug assertion failed
Program: C:\Documents and Settings\tasmin\Desktop\Ref Projects\FINAL CBIR\NggolekiGinambaran\Debug\NggolekiGinambaran.exe
File: f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\appcore.cpp
line: 380
i don have a "f" drive in my system. i'm not able to understand wat this means and refers to.
please help.....
tasmin
|
|
|
|
|
What about 'Rebuild all'?
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]
|
|
|
|
|
Try and debug to check the point where you get this assertion.
If you don't find a solution try cleaning and building your code and then run it.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
i tried the option
// initialize CWinApp state
ASSERT(afxCurrentWinApp == NULL); // only one CWinApp object please
pModuleState->m_pCurrentWinApp = this;
ASSERT(AfxGetApp() == this);
this is exactly where it stops .... but why is it referring to "f" drive in the error, which i don have at all ... should i have to change some property setting or some thing
|
|
|
|
|
tasmin iqbal wrote: i don have a "f" drive in my system. i'm not able to understand wat this means and refers to.
The f drive was on the machine that built the MFC DLLs that come with Visual Studio. The complete path to the source code got embedded in the assertion when the MFC DLL was built.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
thanks for the response,
The f drive was on the machine that built the MFC DLLs that come with Visual Studio. The complete path to the source code got embedded in the assertion when the MFC DLL was built.
can u please tell me how to solve this issue ....
tasmin
|
|
|
|
|
The first thing you need to do is learn how to ask a question with enough detail that someone can think about answering it. For example, what version of Visual Studio is the error from?
Secondly, you need to learn to use Google - the assertion that's failing is ASSERT(AfxGetThread() == NULL) (I have psychic debugging capability - don't ask). Googling[^] that leads to several pages indicating that a) you have more than one object derived from CWinApp, b) you're calling your application objects constructor multiple times, or c) you're using multiple MFC DLLs with inconsistent results.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Have you looked at line 380 of appcore.cpp to see what the assertion is?
"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
|
|
|
|
|
i have a report style CListCtrl.
How do i retrieve the text from the individual cell.
Actually I have been able to get the selected row but seem to be having problems trying to get the row,column combination.
this gives me the row:
int nSelected = m_handselection.GetNextSelectedItem(x);
I have searched and might have either overlooked or could not find anything to give me the column.
|
|
|
|
|
GetItemText[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Yes.
CString GetItemText(
int nItem,
int nSubItem )
I can get the the nItem which is the row i have clicked.
How do I get the nSubItem?
|
|
|
|
|
FISH786 wrote: CString GetItemText(
int nItem,
int nSubItem )
CString GetItemText(
int nItem,
int nSubItem )
Did you see the definition. Don't you spot the return value from the function.
Spoonfeeding Uhh!
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Not. really. I did get the row, but can't get the column.
I used
nItem = m_myListCtrl.GetNextSelectedItem(pos);
but could not find anything simmilar to GetNextSelectedItem() to get the Column.
Like I said I don't know and could not find what to use to get the column.
Was asking for help only.
Thanks In advance.
|
|
|
|