|
hi..
if you know that coordinate's of pixel,you can use this function.
COLORREF GetPixel(
int x,
int y
)
like this..
COLORREF color;
color=GetPixel(10,10);
int red=GetRValue(color);
int blue=GetBValue(color);
int green=GetGValue(color);
Good Work...
|
|
|
|
|
Thanks
It was the first useful reply on my questions on this forum.
Thanks again
|
|
|
|
|
Sure you can turn off the precompiled header option but, unless this file is also used by a 'C' project some where, all you need to do is changed the extension and #include then stdafx.h file at the top of the file.
INTP
|
|
|
|
|
You must either add
#include "stdafx.h"
at the top of your c file, or change the c file "Settings" -> "Precompiled Headers" to "Not using precompiled headers".
Cheers,
Andy
|
|
|
|
|
In my VC++ project i had to add a .c file that just had this data
int cycleTableSize=3;
int camData[] = {0,1,2,3,4,5,6};
I am getting the error
fatal error C1010: unexpected end of file while looking for precompiled header directive
What am i doing wrong ?
|
|
|
|
|
In the Project/Settings dialog box (Alt+F7), select the .C file in the list on the left. Then select the C++ tab, Precompiled Headers category. Select the Not using precompiled headers radio button.
Otherwise, you'll need to add #include "stdafx.h" to the top of the .C file.
|
|
|
|
|
|
Go to project Settings, Alt+F7, and in the right pane, select the file, then select the C++ tab and in the precompiled header category, select not using precompiled header.
This should solve your problem.
cheers
Daniel Cespedes
"There are 10 types of people, those who understand binary and those who do not"
"Santa Cruz de la Sierra Paraiso Terrenal!"
daniel.cespedes@ieee.org
|
|
|
|
|
|
I posted a message board similair to it but I just don't understand can anyone tell me how to CLEAR the recent file list in detail..
<marquee>Universal Project
|
|
|
|
|
You've asked this same question twice before, but have not indicated if the suggestions have helped, or what you have tried/not tried. Show us some code of what is not working and we can guide you through it.
|
|
|
|
|
Hi guys,
Does anyone how to create a pointer to the document class while you are in the mainframe class.
Raj
|
|
|
|
|
GetActiveDocument() does that!
|
|
|
|
|
Use: AfxGetApp()->m_pDocManager
Here is an modified example that may help:
void MyApp::InvalidateAllViews()
{
POSITION pos = m_pDocManager->GetFirstDocTemplatePosition();
while( pos )
{
CDocTemplate* pTemplate = m_pDocManager->GetNextDocTemplate(pos);
POSITION pos2 = pTemplate->GetFirstDocPosition();
while( pos2 )
{
CMyDoc* pDoc = (CMysDoc*)(pTemplate->GetNextDoc(pos2));
if( pDoc )
{
POSITION pos3 = pDoc->GetFirstViewPosition();
while( pos3 )
{
CMyView* pView = (CVMyView*)(pDoc->GetNextView(pos3));
pView->Invalidate();
}
}
}
}
}
INTP
|
|
|
|
|
Hi,
I have the code from CodeProject on Framegrabbers which is written in VC++ (MDI).....
it displays the video in the view class, how can I display the video in a dialog?
Ehsan Behboudi
|
|
|
|
|
Hi,
I have a (read-only) Rich Edit box and I need both bold and normal text in it, as it displays helpful information about my app under various titles (so I want the titles in bold and the main text not in bold). I've seen this done, but I have no idea how to go about having one long string containing different format.
At the moment I am just using SetDlgItemText to set the text in the Rich Edit box...
Any help much appreciated.
Oh, and I'm using the straight WinAPI SDK with _no_ MFC, btw.
Many thanks,
KB
|
|
|
|
|
You'll need to select the appropriate text with the EM_EXSETSEL message. Then, you can set that selection's font using the EM_SETCHARFORMAT message.
|
|
|
|
|
Thanks! Works perfectly.
Thanks again,
KB
|
|
|
|
|
With CFrameWnd I can simply insert status bar by CStatusBar x(this) in OnCreate. But with CWnd it doesn't work. What else have I to do?
|
|
|
|
|
hi..
firstly you should define indicators names,like that.
static UINT indicators[] ={ID_SEPARATOR};
then you must add "ID_SEPARATOR" to string table on your project.Lastly You must write this code in OnCreate.
m_wndStatusBar.Create(this);
m_wndStatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT));
it is not enough what you had only created for that.
Good Work.
|
|
|
|
|
Why indicators...you don't have to set them when constructing a status bar....the problem is: it's working with CFrameWnd, with CWnd it is not.
|
|
|
|
|
Hi,
I am working with the common CFileDialog and I want to set the initial "File name:" editbox to something like "myfile.txt".
I know I can do this with the lpszFileName of the CFileDialog class when constructing, but I would like to set it using the OPENFILENAME structure instead. To be honest, this LPTSTR thing is really bugging me now and I am determined to get it to work...but I do need some help
I have tried to set lpstrFile, but the app crashes. This is how I have tried to set it so far :-
//it crashed when I did this
CString theString( "This is a test" );
LPTSTR lpsz = new TCHAR[theString.GetLength()+1];
_tcscpy(lpsz, theString);
my_file_dlg.m_ofn.lpstrFile = lpsz;
//so I tried this and again it crashes
CString str("myfile.txt");
LPSTR ptr = str.GetBuffer(11);
my_file_dlg.m_ofn.lpstrFile = ptr;
Thank you for any pointers or guidance.
Michael
|
|
|
|
|
Have you looked at the CFileDialog constructor?
CFileDialog dlg(TRUE);
char szFile[MAX_PATH] = "myfile.txt";
dlg.m_ofn.lpstrFile = szFile;
dlg.m_ofn.nMaxFile = sizeof(szFile);
dlg.DoModal();
|
|
|
|
|
That worked just fine.
Now I feel a little humble (i.e stupid) as to how easy the solution was.
Thanks for your help. I think I need to take a break
Michael
|
|
|
|
|
lpstrFile is also used to return your user's selected file(s). The reason your app is crashing is because the buffer you are supplying is too small. Also, you have to set the nMaxFile member to the same size as your buffer. According to MSDN, the buffer should be at least 256 characters.
TCHAR buffer[256] = {0};
_tcscpy(buffer, _T("MyFile.txt"));
my_file_dlg.m_ofn.lpstrFile = buffer;
my_file_dlg.m_ofn.nMaxFile = 256;
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|