|
You could try looking at "Crystal Edit" and "Brainchild", for syntax coloring, at codeproject. As for Auto-complete, you may what to search www.sourceforge.net.
INTP
|
|
|
|
|
Just found this "Using Scintilla for syntax coloring in MFC" at codeproject.
The article recomends going to www.scintilla.org for information on regular expressions, auto-complete, etc...
Good Luck!
INTP
|
|
|
|
|
I have created a program in VC++(MFC programming) using ListCtrl and MSFlexGrid control(This both have pasted in separate Views). I want to move the focus from ListCtrl to MSFlexGrid control and vice versa. Will anyone help me how to set the focus from List control to MSFlexGrid control.
Ramanan.
|
|
|
|
|
You need the a handle to both the items in one place and them simply say SetFocus.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
Have you tried the SetFocus() member functions for their respective CWnd-derived control wrappers?
i dont think MsFlexGrid has a CWnd derived wrapper, so you could simply send it a WM_SETFOCUS msg.
HTH
|
|
|
|
|
How can I read the file size and based on the size an action will be triggered?
C++/VC++
Any help will be greatly appreciated
|
|
|
|
|
Getting file length:-
DWORD length;
CFile file;
file.Open ("c:\\myfile.dat", CFile::modeRead | CFile::shareDenyNone );
length = file.GetLength (); // Will give you the file length.
Simple... isn't it ?
Regards,
Jijo.
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
Are you looking to execute your code if file size is changed by some other user or application ??
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
When the file gets to certain size I will run another application
|
|
|
|
|
|
Is it possible to grab a certain pixel's color using WM messages?
If so, which WM should I send and what kind of wParam and lParam would I need to send?
Thanks,
~Mike
|
|
|
|
|
you can use GetPixel
COLORREF GetPixel(<br />
HDC hdc,
int nXPos,
int nYPos
);
why do you need SendMessage ?
|
|
|
|
|
Because I need to retrieve pixel colors from an inactive window..
Is it possible?
Thanks
~Mike
|
|
|
|
|
__Cerb wrote:
Is it possible?
not sure...
an inactive window isn't drawn!! .. needs to get the wm_paint to be redrawn..
|
|
|
|
|
What about ::GetDC(HWND hwnd) and ::ScreenToClient(HWND hwnd, LPPOINT lpPoint)
???
is there a way I could use those to get a pixel color?
|
|
|
|
|
Do I need to use ::GetDC, ::GetWindowDC, ::ScreenToClient, ::BitBlt, I really need to figure out how can I retrieve a pixel color from an inactive window.
Thanks a lot, any help greatly appreciated
~Cerb
|
|
|
|
|
if you have the window handle then use GetWindowDC to get the HDC (device context)
then use GetPixel directly...
but the problem is when the window needs repaint.. in this case it amy give you another color,,,
try this first and let us know the results
|
|
|
|
|
Damn, it still won't work.
CString szWndName,szWndClass;<br />
<br />
szWndName = "My window";<br />
szWndClass = "My window's class";<br />
<br />
HWND hwnd = ::FindWindow(szWndName,szWndClass);<br />
<br />
::PostMessage(hwnd,WM_PAINT,0,0);<br />
HDC hDC = ::GetWindowDC(hwnd);<br />
<br />
CString str;<br />
int iPixel;<br />
<br />
iPixel = ::GetPixel(hDC,50,75);<br />
<br />
str.Format("%d",iPixel);<br />
AfxMessageBox(str);
It keeps returning -1, and it should return 263172
Any ideas?
|
|
|
|
|
|
can you tell me what is the purpose of this operation ?
maybe wecan find a way around it...
why do you need to get the color of an in-active window ?
|
|
|
|
|
I created a program using vc to display the Records in the
console.Now I wanted to display the records in windows.
I am using only Win32Api,not MFC's CRecordset...
Will anyone say how to include the flexgrid control in my
Program by using only Win32 API(plz write 1 or 2 lines
of sample code)
|
|
|
|
|
Hi,
I've banged my forehead against this problem for several hours now and I cant' for the life of me figure out why this doesn't work.
All I'm trying to do is use a std::map as a dictionary, like: map<string,string>
Here's the very simple code that just won't work:
#include <map>
using namespace std;
int main(int argc, char* argv[]) {
map<string, string> m;
m["a"] = "b";
return 0;
}
I'm getting these error messages:
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'const std::string'
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2676: binary '<' : 'const std::string' does not define this operator or a conversion to a type acceptable to the predefined operator
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &,const std::_Ptrit<_Ty,_Diff,_Pointer,_Reference,_Pointer2,_Reference2> &)' : could not deduce template argument for 'const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &' from 'const std::string'
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &,const std::_Ptrit<_Ty,_Diff,_Pointer,_Reference,_Pointer2,_Reference2> &)' : could not deduce template argument for 'const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &' from 'const std::string'
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &,const std::_Ptrit<_Ty,_Diff,_Pointer,_Reference,_Pointer2,_Reference2> &)' : could not deduce template argument for 'const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &' from 'const std::string'
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const std::string'
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const std::string'
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const std::string'
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : could not deduce template argument for 'const std::pair<_Ty1,_Ty2> &' from 'const std::string'
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : could not deduce template argument for 'const std::pair<_Ty1,_Ty2> &' from 'const std::string'
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : could not deduce template argument for 'const std::pair<_Ty1,_Ty2> &' from 'const std::string'
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'const std::string'
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'const std::string'
If I change the key to int, like this:
map<int,string> m;
there's no problem doing this:
m[6] = "ashahshd";
But the map<string,string> just won't work.
Please help me, I'm getting desperate!
thanks
Ludde
|
|
|
|
|
luddet wrote:
c:\Program\Microsoft Visual Studio .NET\Vc7\include\functional(139): error C2676: binary '<' : 'const std::string' does not define this operator or a conversion to a type acceptable to the predefined operator
This is the key part. There's no operator< defined for std::string . You can either define an operator for it yourself, or (better for strings) use a hash_map instead of a map (in this case you may have to define a hash function for std::string ).
- Mike
|
|
|
|
|
Hi,
Are you absolutely sure that there is no operator
|
|
|
|
|
Oops, yeah, I missed that. No more trying to answer questions when I'm dead tired
- Mike
|
|
|
|
|