|
Like this:
CEditWnd *pBox;
CSldFlexGrid objMyGrid;
long lHeight;
long lWidth;
long lCol;
long lRow;
int nY = objMyGrid.GetRowPos(lRow);
int nH = objMyGrid.GetRowHeight(lRow);
int nXBt = objMyGrid.GetColPos(lCol);
int nWBt = objMyGrid.GetColWidth(lCol,0);
CRect NewListRect(nXBt, nY, nXBt+nWBt, nY+nH);
pBox->MoveWindow(NewListRect);
pBox->ShowWindow(SW_SHOW);
pBox->SetFocus();
I hope that helps.
modified on Thursday, April 17, 2008 11:00 AM
|
|
|
|
|
I am using CPropertySheet class. In this for removing 'Apply' button
on propertysheet someone i.e. my senior written following code. But I
can't mean it.
AFX_OLDPROPSHEETHEADER* psh = dlg.GetPropSheetHeader();
psh->dwFlags |= PSH_NOAPPLYNOW;
psh->dwFlags &= ~PSH_HASHELP;
Plz explain me this code. Means what AFX_OLDPROPSHEETHEADER and
GetPropSheetHeader() does?
|
|
|
|
|
Nikesh Jagtap wrote: my senior written following code. But I
can't mean it.
Why not asking him?
|
|
|
|
|
|
I'm working on a project that involves converting an application developed 10 years ago using VC++ 4.2 running on Windows NT 3.51 to VC++ 2005 running on Windows XP. Suffice it to say this has been a nightmare. The conversion "wizard" seems to leave most of the work undone. After much travail, I've finally winnowed the errors down to one. I've detailed it here (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3188024&SiteID=1&mode=1[^]) on the MSDN C++ forum. Thus far I've gotten no satisfactory answer.
It seems to me that there should be some other people who have had to convert old Microsoft C++ applications developed with 4.2 to C++ 2005 and have encountered similar problems. I assume this is probably some weird Microsoft quirk that can be easily solved by someone in the know. Since this is idiomatic and has nothing to do with logic or programming in any direct way, it requires someone who really knows all of the in's and out's of Visual Studio.
This project is for the U.S. Navy and is high priority so any help will be greatly appreciated.
"I would give the Devil benefit of law for my own safety's sake." - from A MAN FOR ALL SEASONS, by Robert Bolt
|
|
|
|
|
From what I understand, it's a problem with conflicting resource IDs.
use this : http://www.riverblade.co.uk/products/resorg/[^] (from our own Anna-Jayne) to try to see what can be (semi-)automatically done to your resources.
If that does not work, check the resource "includes" to see if there's no unwanted include directive there.
If that does not work either, do it manually, check each resources, each values.
Good luck.
|
|
|
|
|
Maximilien wrote: From what I understand, it's a problem with conflicting resource IDs.
use this : http://www.riverblade.co.uk/products/resorg/[^] (from our own Anna-Jayne) to try to see what can be (semi-)automatically done to your resources.
If that does not work, check the resource "includes" to see if there's no unwanted include directive there.
If that does not work either, do it manually, check each resources, each values.
Good luck.
I downloaded/installed the suggested Riverblade tool and ran. It found quite a few potential conflicts which I fixed.
Unfortunately, it didn't solve my problem. I still get the CVT1100 error. And, when I change the /TLBID value from 1 (suggested by Microsoft help) the error stays the same: "type ICON, name: 1". In other words, no matter what value I insert (I tried 2, 1000, and 39000) I still get name: 1.
As for "no unwanted include directive", I assume you mean an extraneous include file? If not, what do you mean? I did remove what I determined was dead code that caused a compiler error because it had 3 ID's that were not defined anywhere. Apparently, the 4.2 compiler didn't flag this dead code because it was smart enough to determine that it was, in fact, dead and didn't generate any related object. Ergo, there was no reason to flag the error. VC++ 2005 is much less forgiving. Other than that, I haven't found any obvious dead code.
"I would give the Devil benefit of law for my own safety's sake." - from A MAN FOR ALL SEASONS, by Robert Bolt
|
|
|
|
|
Paul Hager wrote: This project is for the U.S. Navy and is high priority so any help will be greatly appreciated.
Makes a change for it being for somebodies homework. I also think it's spelt:
URGENTZ!!!!
I have plenty of resource conflicts if I'm not careful in my own code. When I get them, I just search for the define name, or the number itself and just change it. That doesn't really require much VS knowledge.
Finding out that I'm loading a dialog box with the same resource number in another DLL, *that's* a pain. Fixing it is trivial.
I'd second the pointer to Anna-Jayne's resource organiser[*] though.
Iain.
[*] She's british, so I'm using the correct spelling.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
You have a problem finding out what a "build rule" is and search them in ".rule"-files?
Whatever you may do for tha Navy, please keep it in the US waters, as not to accidentially hitting me with it.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
hello
i want to read sequenece numbers from the packets that are in a dump file. problem is that i hav read the header into byte array. and want to convert the sequence numbers into integer.
my code is
unsigned char buff[2]; buff[0]=header[22]; buff[1]=header[23];
unsigned int t; n=(buff[0]<<24)|(buff[1]<<16);
header is byte array containing header. byet 22 and 23 is sequqnce number and i want to convert it into int. but this code is not working properly.
can anybody help me.
|
|
|
|
|
1/ Read on the posting guidlines - particularly the pre tag. It marks out what is code, and what is text.
2/ You declare t, then don't use it.
3/ You use n, but don;t declare it. Without knowing things like type, we can;t help you much.
3/ buff [0] is a uchar. (buf [0] << 24) is also a uchar - and only has room for 8 bits, and will therefore end up as 0.
4/ Lastly, some help:
DWORD dwResult = 0;
dwResult |= header [22];
dwResult <<8;
dwResult |= header [23;
dwResult <<= 16;
Enjoy,
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Are you sure he wants the original number times 65536 ?
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
|
|
|
|
|
No - but he did do a shift by 24 bits on one byte, and 16 bits on another. Given that I was guessing at his code (ie, taking his word for which was the high byte, etc), it was one of the few bits of solid data he'd actually provided.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
So, if I understand you well, you have an array of two bytes and you want to 'convert' this two bytes into ONE integer ?
If yes, then simply do something like this:
int Value = buff[0] + buff[1] * 256;
Depending on the byte ordering, you will perhaps have to invert them.
|
|
|
|
|
It depends on byte ordering of your packet, i.e
Big Endian:
unsigned int n = (buff[0] << 8) | buff[1];
Little Endian:
unsigned int n = (buff[1] << 8) | buff[0];
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
modified on Thursday, April 17, 2008 8:27 AM
|
|
|
|
|
If I understand correctly, your sequence number you want is in bytes buf[22] and buf[23].
If that's true, you can use a cast to retrieve the value:
unsigned short SeqNo;
SeqNo = *(short*)&buf[22]; Note that if it's only two bytes, it's a short and not an int.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I'm using custom handler for unhandled exception to generate crash dump file in my application (using XCrashReport). The problem is that it does not handle crash when progeram is freezed and user closes it using task manager. Is there a way how to run my exception handler in this case? It is difficult to explain users when they will find drwatson's crash results (and I think it is different in different windows versions).
Thank you.
rrrado
|
|
|
|
|
I do not think that an application can trap being terminated by Task Manager - too much potential for abuse there, IMHO.
One thing you can try is to create your own watchdog . Create a separate thread whoses sole purpose in life is to send a message (like WM_NULL ) to the main message pump every 10 seconds or so using SendMessageTimeout(...) with an approporiate timeout.
If the timeout expires, intentionally crash the application by doing something like dereferencing a NULL . Maybe that will cause the SEH handler to fire and give you more information about the state of the application?
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
win32 - edges on buttons -
I need to show images on buttons in win32,
but I need that borders of buttons, it's edges will be transparent!!
I don't need them!!
plz, help - I can't find the way to do it
|
|
|
|
|
Is it urgent?
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
|
|
|
|
|
If it was an urgent query, that would have been posted on the lounge. I am surprised you didn't know this.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Sorry, I first time in this forum...
|
|
|
|
|
You're welcome. Please give yourself a name by editing your profile and then read the guidelines[^] on how to ask a question.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
He used of MemberID for his or her name.
|
|
|
|
|
Actually it is his real name.
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
|
|
|
|