|
What is the regexp to find (in VC++ 6.0) all occurencies of MyVariable = and not MyVariable == ? Seems like MyVariable* =\~= does not work.
~RaGE();
|
|
|
|
|
MyVariable =[^=] should do the trick.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
MyVariable =[^=] should do the trick.
Thanks, but nope, I had already tried that, and it's surprisingly not working...
~RaGE();
|
|
|
|
|
How doesn't it work? I tested it before I replied and it worked perfectly for me. If there's more than one space between MyVariable and the '=' then it won't work, but then you'll just need to use '\:b*' instead of ' ' in the rule.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I know that, but it did not work either.
~RaGE();
|
|
|
|
|
How didn't it work? Did it match the 'MyVariable ==' like it's not meant to, or did it not match the 'MyVariable =' like it's supposed to
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
I'm writing a simple game in win32/gdi, and I want to allow the user to modify the frame rate with a horizontal slider control. How do I set it up? I've found information on how to do so in MFC, but don't want to use MFC in my application for performance purposes.
Any help much appreciated.
Blackmesa.
|
|
|
|
|
Hi:
How could I know if my windows is English version or the other language version(such as Chinese ,German ...)?
I use GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,LOCALE_IDEFAULTLANGUAGE ,szPath,6),
but when I test it in English version and Chinese version windows system,it both returns "0804",Why? How should I do?
Thanks
benben.
|
|
|
|
|
Use LOCALE_SLANGUAGE instead of LOCALE_IDEFAULTLANGUAGE . Your buffer will need to be a bit bigger too
[edit] I used LOCALE_USER_DEFAULT instead of LOCALE_SYSTEM_DEFAULT so that it works if different users have different languages [/edit]
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
|
You're welcome
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi all, please help me.
I am trying to load a bitmap using LoadImage . I have attach the code . Please create a bitmap of size 32*23 and save it to 256 colors.My Display pallette setting is in 16 million colors.
This is working fine in 256 color setting.
32*32 is the image width and image height.
OnDrawFunction()
{
typedef unsigned short UINT16;
UINT16 *MyDisplayBuffer = (UINT16*)GlobalAlloc(GPTR,32*32*2);
m_hBitmap = (HBITMAP)LoadImage(NULL,"C:\\Bitmap1.bmp", IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE);
CBitmap bmp;
bmp.Attach(m_hBitmap);
BYTE* DisplayBuffer=(BYTE*)GlobalAlloc(GPTR,32*32);
int Update = 0;
int color =0;
CDC memdc;
memdc.CreateCompatibleDC(pDC);
SelectObject( memdc,m_hBitmap);
bmp.GetBitmapBits(32*32,DisplayBuffer);
for(int y =0; y < 32; y++)
{
for(int x =0 ; x< 32; x++)
{
int index = x + y *32;
color= DisplayBuffer[Update];
MyDisplayBuffer[index] =color
Update++;
}
}
CDC dcDisplayMemory;
CBitmap bmp1;
dcDisplayMemory.CreateCompatibleDC(pDC);
bmp1.CreateCompatibleBitmap(pDC,32,32);
dcDisplayMemory.SelectObject(&bmp1);
bmp1.SetBitmapBits(32*32 *2,MyDisplayBuffer);
pDC->BitBlt(10,20,32,32,&dcDisplayMemory,0,0,SRCCOPY);
}
Thanks in Advance
|
|
|
|
|
This is a very long-winded way of doing it. Why don't you just do this:
HGDIOBJ hBitmap = LoadImage(NULL, _T("C:\\Bitmap1.bmp"), IMAGE_BITMAP,
0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
CDC memDC;
memDC.CreateCompatibleDC(pDC);
HGDIOBJ hbmOld = SelectObject(memDC.m_hDC, hBitmap);
pDC->BitBlt(10, 20, 32, 32, &memDC, 0, 0, SRCCOPY);
SelectObject(memDC.m_hDC, hbmOld);
memDC.DeleteDC(); This should work nicely
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
No i can use that function directly
Thanks
|
|
|
|
|
|
Are you talking about static arrays or dynamic?
[EDIT]
Static arrays are limited by the size of the stack which is usually 4 MB (I think). Dymanic arrays are limited by the largest addressible block on the heap which is less than 2GB and depends on what addresses your program / dlls load at..
[/EDIT]
John
|
|
|
|
|
John M. Drescher wrote:
Are you talking about static arrays or dynamic?
Static, but now I release I need a 64-bit PC DAMMIT!!!
I'm trying to do an analysis of a "transformation" to see how many instances of a unsigned int exists, hence the need for a "32-bit" sized array. I thought about going bitwise (just to get an off or on state) too, but still no luck.
O well back to the abacus/tickertape/punchcards/etc. And they say PC are Turing complete....(ok thats debatable, with hard work anything can be done).
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
How about a sparse array? I assume you will have no where near 4 GB of data?
John
|
|
|
|
|
John M. Drescher wrote:
How about a sparse array?
WTF is that? Seriously
John M. Drescher wrote:
I assume you will have no where near 4 GB of data?
I just need the "space" to see if what I am attempting to do is viable or not. In fact, the input is only 16bits.
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
|
|
Looks like you're allocating an array on the stack. That probably won't work because the stack size is limited. To get an array that big you'll have to allocate the array dynamically.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
With a simple CListBox I can SetCurSel() then from another routine
pWnd = GetDlgItem(IDC_LIST_BOX);
pWnd->PostMessage(WM_LBUTTONDBLCLK);
and in the handler for double click I can GetCurSel() and all is well.
If I get fancier with a CListCtrl (In Report style)
and programatically set a row to selected,
when I pWnd->PostMessage(WM_LBUTTONDBLCLK); to the ListCtrl
in the double click handler there is no longer a selected item
nItem = pMyListCtrl->GetNextItem(-1,LVNI_SELECTED); returns -1 but anytime before the
PostMessage() it is returning the correct selected row.
Anyone have a clue about this?
-kry
|
|
|
|
|
Sending a WM_LBUTTONDBLCLK like that won't do anything. This is because you haven't specified the position where the mouse is double clicked (look at the documentation for the WM_LBUTTONDBLCLK message). It appears to work for a list box, because a list box never removes the selection. If a click doesn't hit anything, it doesn't change the selection. However, for a list-view control, if a click doesn't hit anything, then the selection is removed, hence GetNextItem(-1,LVNI_SELECTED) returns -1.
Hope this helps,
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Thanks Ryan!
I've implemented the following and it is working great!
// Setup a post message with mouse x&y pointed to the selected item
pListCtrl =
(CListCtrl *)pThis->GetDlgItem(IDC_LIST_OPTION_SOURCES_REPORT);
pListCtrl->GetItemRect(pThis->m_OptionSourcesIdx,&rect,LVIR_BOUNDS);
lParam = MAKELPARAM(rect.left,rect.top);
pListCtrl->PostMessage(WM_LBUTTONDBLCLK,0,lParam);
I see you also were most helpful to others that night answering posts all night long! Great job - you efforts are most appreciated!
-K
|
|
|
|