|
Try that already - its not work.
|
|
|
|
|
Did you rebuild everything after changing the settings? You need to recompile not just relink. You may also need the previous suggestion about a manifest file.
Judy
|
|
|
|
|
I clean all the project and re-build it all again.
Still not work.
|
|
|
|
|
|
AoA
i am new starter for mfc please help me how can i use it.
Abu bakar
|
|
|
|
|
|
i dont know the others, but i can not reach the destiny of the link.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
I don't know why, but I put the correct link. Anyway search the tread "Study materials for C++/MFC" in thif forum, you may find it.
I've start that tread on 22nd October.
I appreciate your help all the time...
Eranga
|
|
|
|
|
hafiz m abu bakar siddique wrote: i am new starter for mfc please help me how can i use it.
Are you refering any book?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
First do you know c++ very well ?
|
|
|
|
|
hafiz m abu bakar siddique wrote: ...how can i use it.
By starting with the basics. On a related note, are you familiar with code development at all?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The following is from MSDN...
//
m_pNewViewClass
CRuntimeClass of the new view to create.
m_pCurrentDoc
The existing document to be associated with the new view.
m_pNewDocTemplate
The document template associated with the creation of a new MDI frame window.
m_pLastView
The original view upon which additional views are modeled, as in the creation of a splitter window's views or the creation of a second view on a document.
m_pCurrentFrame
The frame window upon which additional frame windows are modeled, as in the creation of a second frame window on a document.
//
Here m_pNewViewClass and m_pCurrentDoc is easy to understand.m_pNewViewClass specifies the view class to create a new view. And m_pCurrentDoc gives the document which the new view will attach with.
My question is about the other members.
1/ m_pNewDocTemplate -- how to understand its function and role to create a view?
2/ m_pCurrentFrame -- ?
3/ m_pLastView -- ?
In what situation, the members would be used and for what purpose?
From my side, for example I wanna add another view for a document after default view/doc created by m_pDocTemplate->OpenDocumentFile(NULL/strFile) in an MDI app.
//Demo code
CMainFrame::CreateNewView()//
{
CMyHtmlChildFrame* pHtmlChild=new CMyHtmlChildFrame();//use CRuntimeClass* is also OK
CMDIDemoDoc* pDoc=(CMDIDemoDoc*)(MDIGetActive()- >GetActiveDocument());
ASSERT_VALID(pDoc);
CMultiDocTemplate* pTemplate=(CMultiDocTemplate*)(pDoc- >GetDocTemplate());
ASSERT_VALID(pTemplate);
CCreateContext context;
context.m_pCurrentDoc=pDoc;// use existing document
context.m_pCurrentFrame=pHtmlChild;// new child frame to be upon ??
context.m_pNewViewClass=RUNTIME_CLASS(CMyHtmlView);// new view to be created
context.m_pNewDocTemplate=pTemplate;// use existing document Template??
context.m_pLastView=NULL;// no
if (!pHtmlChild- >LoadFrame(IDI_ICON1,WS_OVERLAPPEDWINDOW ¦FWS_ADDTOTITLE,this,&context))
{
TRACE0("Warning: Couldn 't load frame window!\n");
return -1;
}
//pHtmlChild- >ShowWindow(SW_SHOWMAXIMIZED);
pHtmlChild- >InitialUpdateFrame(pDoc,TRUE);
//pTemplate- >InitialUpdateFrame(pHtmlChild,pDoc,TRUE);
//it worked!
return 0;
}
//
context.m_pCurrentFrame=pHtmlChild;
context.m_pNewDocTemplate=pTemplate;
//
here I can't understand its function in spite that I write it out.
Apprecaited for your kind explanation...
Sam
|
|
|
|
|
Anyone can give any help on this question? I think it is about the basic understanding on CCeateContext structure.
Thanks a lot for any help.
Sam
|
|
|
|
|
Hi All,,
I am getting problem while getting bitmap bits from bitmap in Win32 app.And I got my bitmap data using the same thing in MFC in another app.
I used below code in Win32......
<br />
int iWidth = rect.right - rect.left;<br />
int iHeight = rect.bottom - rect.top;<br />
<br />
HBITMAP new_Bitmap = CreateCompatibleBitmap(m_hrootdc,iWidth,iHeight);<br />
HBITMAP temp_Bitmap = (HBITMAP)SelectObject(m_hmemdc,new_Bitmap);<br />
<br />
<br />
BOOL blitok = BitBlt(<br />
m_hmemdc, rect.left - m_bmrect.left , <br />
rect.top - m_bmrect.top ,<br />
rect.right - rect.left,<br />
rect.bottom - rect.top,<br />
m_hrootdc,<br />
rect.left, rect.top,<br />
SRCCOPY);<br />
<br />
int datasize = iWidth*iHeight; <br />
COLORREF* lpClrData = (COLORREF*)LocalAlloc(LPTR, datasize * sizeof(COLORREF));<br />
datasize = GetBitmapBits(temp_Bitmap,datasize * sizeof(COLORREF), lpClrData);<br />
<br />
Here rect is the some rectangle portion,here I got datasize as some no of bytes but in lpClrData buffer I don,t get anythig.
And now I am using the same thing in MFC like bellow.....
<br />
HDC memDC = CreateCompatibleDC(m_hrootdc);<br />
CDC* pScreenDC = CDC::FromHandle(m_hrootdc);<br />
CDC* pMemDC = CDC::FromHandle(memDC);<br />
<br />
int iWidth = rect.right - rect.left;<br />
int iHeight = rect.bottom - rect.top;<br />
<br />
CBitmap newBitmap;<br />
if (!newBitmap.CreateCompatibleBitmap(pScreenDC, iWidth,iHeight))<br />
{<br />
MessageBox(NULL,CString("CreateCompatibleBitmap failed."),CString("Test"),0);<br />
return;<br />
}<br />
<br />
CBitmap* pOldBitmap = pMemDC->SelectObject(&newBitmap);<br />
pMemDC->BitBlt(0, 0, iWidth,iHeight, pScreenDC, 0, 0, SRCCOPY);<br />
<br />
<br />
CBitmap* pbitmap = pMemDC->GetCurrentBitmap();<br />
int datasize = iWidth*iHeight; <br />
COLORREF* lpClrData = (COLORREF*)LocalAlloc(LPTR, datasize * sizeof(COLORREF));<br />
<br />
datasize = pbitmap->GetBitmapBits(datasize * sizeof(COLORREF), lpClrData);<br />
<br />
<br />
Here I got the data very perfactly in buffer.
Is there something missing in my code in Win32.
Plz reply me.
I will Appreciate your answer.
Thanks in advance.
Ashish Bhatt
|
|
|
|
|
From MSDN:
"This function is provided only for compatibility with 16-bit versions of Windows. Applications should use the GetDIBits function."
|
|
|
|
|
But I am doing the same thing in MFC application as I have shown and i got the result then what is the problem here.
Ashish Bhatt
|
|
|
|
|
ashishbhatt wrote: // Capture screen into bitmap
BOOL blitok = BitBlt(
m_hmemdc, rect.left - m_bmrect.left ,
rect.top - m_bmrect.top ,
rect.right - rect.left,
rect.bottom - rect.top,
m_hrootdc,
rect.left, rect.top,
SRCCOPY);
Every thing seems to be fine. But can you tell me or verify what will be position values passed to BitBlt() function like
rect.left - m_bmrect.left , rect.top - m_bmrect.top etc.
|
|
|
|
|
Ya thanks.
here everything comes right somthing like 0,0 position and 1280,1024 position.
I hope problem is not in these value. Plz check the compatibleBitmap() and also SelectObject() function and ma I passing right bitmap handle or not.
Ashish Bhatt
|
|
|
|
|
Ok,So as you told to try GetDIBits(), I used it but I don't get the result.
I modified the original code as below.....
<br />
BYTE* lpClrData = (BYTE*)LocalAlloc(LPTR, datasize * sizeof(BYTE));<br />
<br />
if(GetDIBits(m_hmemdc,new_Bitmap,rect.right - rect.left,<br />
rect.bottom - rect.top,lpClrData,&m_bminfo.bmi,DIB_RGB_COLORS) == 0)<br />
{<br />
MessageBox(NULL,CString("Failed to get Bits from DIB"),CString("TestRTMP"),0);<br />
} <br />
Above function always return zero.So I don't get the ouotput.
Is there any other thing which I am missing in this code plz suggest me.
Thanks.
Ashish Bhatt
|
|
|
|
|
ashishbhatt wrote: datasize = GetBitmapBits(temp_Bitmap,datasize * sizeof(COLORREF), lpClrData);
Here lies the problem
you are calling GetBitmapBits() with temp_Bitmap instead of new_Bitmap .
|
|
|
|
|
Ya, Thanks.
But Now I am getting little much strange problem.Let me explain little much more abt my application.In my application the function in which this bitmap capture is available calls very frequently with diff diff rectangle position.
Now my problem is that at first rectangle data doesn't come(means I checked color value from the buffer it is black color for every pixel)but from second time it comes the data comes right. Every time data comes right aftere every one rectangle.
I hope it very silly mistake but i am not getting it Here I write code from which I print the Pixel values using setpixel.
<br />
<br />
unsigned char *destData = new unsigned char[iWidth*iHeight*sizeof(unsigned char *)] ;<br />
unsigned char *srcColor = new unsigned char[iWidth*iHeight*sizeof(unsigned char *)] ;<br />
int color = 0;<br />
<br />
for(int x = iHeight - 1; x >= 0; x--)<br />
{<br />
for(int y = 0; y < iWidth; y++)<br />
{<br />
<br />
srcColor[color++] = GetRValue(lpClrData[iWidth* x + y]);<br />
srcColor[color++] = GetGValue(lpClrData[iWidth* x + y]);<br />
srcColor[color++] = GetBValue(lpClrData[iWidth* x + y]);<br />
<br />
::SetPixel(m_hrootdc,x ,y ,RGB(srcColor[color-3],srcColor[color-2],srcColor[color-1])); <br />
<br />
}<br />
}<br />
<br />
Ashish Bhatt
|
|
|
|
|
SIR,
Can u suggest an c coding for the below objective ... please help me out of this problem ..i will forward all the relevant data about the project.. Image processing
Attached is the image on which the processing is to be performed
Take this image. It is in .png format.
It has 52 characters written in it.(26 samll a b c d ………z) and 26 capital letters (A B C ………Z)
From this big image we have to segment the image into 52 small images each representing a single character.
Now we have 52 small images. Each of them represents a character.
After this on every image gabor filter is to be applied. Gabor filter is an orientation selective filter. It has some parameters by changing them we can have a set of gabor filters with different parameters.
On each character image 16 gabor filters are to be applied. This way we will have 16 output images for each image.
For all the sixteen images centroid of each image is to be found out. This will have x, y coordinates . find the normalized area of each image. Now every character has 48 components to define it (16 filter images giving 2 coordinates each and area of each output image give 16x2 +16). This can be represented in vector form.
We now have 52 vectors one vector for each image.
To test : given any 48 dimensional vector find the distance of this vector with all 52 vectors. The vector for which difference between given vector and our set of 542 vectors is least wiil be the answer. This means the given vector represents the character “ a” if suppose the difference between given vector and vector for character “a” is found to be the least.
|
|
|
|
|
Will this[^] helpful ?
Regards,
Paresh.
|
|
|
|
|
hi,
I have a msflexgrid with 2 columns and 25 rows(all with data in it) in my dialog.i'm also having a edit box in the same dialog above the flex grid.now wat i want is..if i type a name or a letter in the edit box the mouse pointer should go to that row that contains the name.
for example if i hav 2 colums(name and rollno)in msflexgrid
if i type "A" in the edit box,thn the mouse cursor should go to the row where that name column contains first letter as "A".Is there any function for getting the mouse pointer to our flexgrid?
Anybody please help mi in this regard.
thanks,
panthal
|
|
|
|
|
|