|
Hi,
I want my MyView to appear at x,y = 1,20 and be 1280
pixels wide and 800 high when it initially appears.
I believe this is the code to move and size it ...
<br />
CFrameWnd* pParentFrame = GetParentFrame();<br />
ASSERT_VALID( pParentFrame ); <br />
pParentFrame->MoveWindow( 1, 20, 1280, 800 );<br />
... but what method should I put this code in?
If I put in MyView::OnDraw everytime the View
needs to be re-drawn it moves and resizes. I
just want it start and 1,20 initially.
|
|
|
|
|
You can set the initial size/position in PreCreateWindow() .
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
ok i'd like to do either one of the following:
1) have like 4 or 5 different views (an text view should be able to be splitted in 1 or 2 or 4 panes or such) and be able to switch between those views
this i have done except for the splitter, and since splitterwnd isn't a View, i can't AddView it, and since the insidep views of the splitter ARE views, i dont know how to handle those, can someone help??
2) have one splitter which can split 1, 2 or 4 panes, and be able to change between a text view and a couple of other views... this seems easier but then again, i have a button bar control that changes the views, and i'd like if anyone could help me figure out how to manage that
also the problem is that there's a lot more views now, and i'm a complete mess with figuring out how to deal with those
really, im in search of an example of view-switching w/ splitters or an MFC pro to give me some help w/ figuring out how to manage the views in some of these cases
and i have already tried various MSDN samples, the two SwitchToView examples on CodeProject, etc. but have had no luck because of the splitter
- Roman -
|
|
|
|
|
Hello,
How can i get the list of files from a path ?
for example: C:\Ali
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
In MFC you can use CFileFind class to fill the list using FindFile, FindNextFile methods.
In WIN32 use the API functions FindFile and FindNextFile.
Pavel
Sonork 100.15206
|
|
|
|
|
Thanks alooot
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have list of a big object.The approximate elements of this list is expected to the tune of 10,000,000-99,000,000.
Now if I have to use only part of this big list in another object.
Would it be advisable to use a list of pointers to this list section or use a list of the index values of the section?
It sounds confusing !!
Inshort how much memory does a pointer takes? Is it dependent on the size of the object being pointed to?
How much memory does a pointer need? like an integer needs 1 byte etc....
|
|
|
|
|
Anonymous wrote:
how much memory does a pointer takes?
in Win32, the pointer itself takes 4 bytes (32 bits).
I'm not the droid you're looking for.
|
|
|
|
|
How big are the instances?
Needs this big list to be whole in memory?
Have you considered using a database?
Will be the elements deleted or reordered at runtime (the pointers or indexes could become invalid by concurrent access)?
The indexes would be unefficient if you implent the list as a linked one.
Anonymous wrote:
Inshort how much memory does a pointer takes?
It depends on HW platform - on Intel's IA32 it's 4 bytes.
Anonymous wrote:
Is it dependent on the size of the object being pointed to?
No, it's only adress in memory.
Anonymous wrote:
How much memory does a pointer need? like an integer needs 1 byte etc....
size of an integer depends on platform and type. Size of int type depends on platform. You can use types as BYTE, WORD, DWORD ... of deterministic size.
|
|
|
|
|
In 32-bit windows (Win95+) an int takes 4 bytes (32 bits), and in the same environment a pointer also takes 4 bytes. (a pointer is nothing more than an unsigned int pointing to a memory address)
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Anonymous wrote:
I have list of a big object.The approximate elements of this list is expected to the tune of 10,000,000-99,000,000.
If this was to be "I have a list of big objects", and not "a big object", it means the object(s) at hand can only be (on avg) less than 20 bytes (incl. overhead the object can probably be no larger than 12-16 bytes). That's not such a large object.
However, it seems you have a devilish large number of instances of such objects!
Now if I have to use only part of this big list in another object.
Would it be advisable to use a list of pointers to this list section or use a list of the index values of the section?
In Win32 it wouldn't matter, since you'd need a 32-bit entity to express an index>64K, and that's the size needed to express a 32-bit pointer (where are you from to not know this?).
In reality, in Win32, it wouldn't matter at all what you did - you'd be out of memory (address space) before you could do anything sensible with that amount of data.
My suggestion is you either memory-map it in smaller units, or use a computer architecture designed to handle this amount of data (SGI, Cray and Tandem comes to mind).
|
|
|
|
|
I have an ClistCtrl in my dialog.How can I get the texts of item an its subitem when user click on an item?I overriden NM_DBLCLK but I can't get the texts of them!
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
Why do you even mention duouble-click when you say you only want the selection? How about selchange (or similar)?
|
|
|
|
|
Nope,I want when user double click on an item.Whats the way for that?
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
From what I can understand from MSDN Library, loadXML of IXMLDOMDocument return a S_FALSE (I think it was) if the load failed, but it also has a VARIANT_BOOL varible as a parameter which also return FALSE if the load failed. I'm confused...
What is the difference between the HRESULT value and the VARIANT_BOOL value?
Which one should I check?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
A VARIANT_BOOL is the Automation version of bool . Its possible values are VARIANT_TRUE and VARIANT_FALSE . In the case of loadXML() , the bool tells you whether the load succeeded or failed. If you need to know why it failed, then you can check the HRESULT .
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
|
In VC6 there is Resource symbols... command in View menu, should be something similar in VC.NET. Or you can define a menu resource with the commands.
|
|
|
|
|
I want to find out that how much memory my program is consuming at certain point of execution. How can i find it ???? Actualy the application i developed, is multithreaded and at many occasions, memory is selected from the heap and returned back. I want to find out that how much memory (complete i.e stack+ heap+ etc ) is under consumption by my program. Plesae tell me ???
|
|
|
|
|
CTRL+ALT+DEL and look in the process list of the windows task manager for your program? There is a tab "Memory usage"...
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
GetProcessWorkingSetSize might help.
|
|
|
|
|
Hello,
I ran into the following problem in my Unicode project. I have a FileName of the type unsigned short* and I'm willing to extract the extension and compare it. I use the following code:
==
unsigned short* FileExt = new unsigned short[10];
int FileNameLen = wcslen(FileName);
for(int x = FileNameLen; x >= 0; x--)
{
if(FileName[x] == '.')
{
// Get the extension
wcsncpy(FileExt, FileName + x + 1, FileNameLen - x - 1);
break;
}
}
FileExt = _wcsupr(FileExt);
if(FileExt == _T("U") || FileExt == _T("DLL"))
{
return 1;
}
else if(FileExt == _T("UNR"))
{
return 2;
}
else
{
return 3;
}
===
First of all, it ALWAYS returns 3, none of the other IFs are triggered for some reason.
Second, if I view the FileExt after the extraction; if the extension of the file is only ONE charachter, it adds a strange other char to it for no apparent reason...
Can anyone tell me what I'm doing wrong?
Thanks,
- Fahr
|
|
|
|
|
Try this:
_TCHAR *FileExt = new _TCHAR[10];
int FileNameLen = _tcslen(FileName);
for(int x = FileNameLen; x>= 0; x--)
{
if(FileName[x] == _T('.'))
{
_tcsncpy(FileExt, FileName + x + 1, FileNameLen - x - 1);
break;
}
}
_tcsupr(FileExt);
if ((_tcscmp(FileExt,_T("U")) == 0) || (_tcscmp(FileExt,_T("DLL")) == 0))
{
delete []FileExt;
return 1;
}
else if (_tcscmp(FileExt,_T("UNR")) == 0)
{
delete []FileExt;
return 2;
}
else
{
delete []FileExt;
return 3;
}
First, I replaced the 'unsigned short' with _TCHAR. You're using the tchar.h macros elsewhere, so this will make the code work whether you compile for MBCS or UNICODE. Second, the first if condition wasn't quite right; I changed the character constant from '.' to _T('.'). The '.' is an MBCS character always, even if you are compiling for UNICODE. The statement FileExt = _wcsupr(FileExt) will make the FileExt value upper case, but it may also change the value of FileExt (which you probably don't want). Next, the conditions where you compare the extracted extension weren't right. Using FileExt == _T("U") compares the pointer to the extension value to the pointer to a constant string. You want to do a string comparison here, hence the _tcscmp calls. I also added the delete 's before the return 's so that this wouldn't leak memory.
Software Zen: delete this;
|
|
|
|
|
Ok, since I'm compiling only unicode I stuck with the wcs commands (Unicode is required for this, I'm not ever going to recompile it in MBCS). If there's a good reason for me to use the _TCHAR and _tcs commands instead, please tell me
The code DOES work now with the compare calls and the not writing back after uppercasing, but the 1-letter-extension problem still remains for some reason, after a one-letter extension it adds a 135-char... I don't get why...
As for the delete[]s, what to do in such a case if I want to RETURN the FileExt? I can't delete it before the return. And also, what to do with static variables? I assume I can't delete those either...
Thanks,
- Fahr
|
|
|
|
|
You have a couple of problems. First, the correct type for Unicode characters is WCHAR (yeah, it's the same thing as unsigned short due to a typedef, but using WCHAR will make the code easily readable by others). Then you're comparing strings with == which is not correct for C-style strings.
There's already an API for finding the extension, then once you have that use _wcsicmp() to do case-insensitive comparison.
int LookAtExt(LPCWSTR wszFilename)
{
LPCWSTR wszExt = PathFindExtension ( wszFilename );
if ( 0 == _wcsicmp ( wszExt, L".U" ) || 0 == _wcsicmp ( wszExt, L".DLL" ) )
return 1;
else if ( 0 == _wcsicmp ( wszExt, L".UNR" ) )
return 2;
else
return 3;
} You can also use a string wrapper class like wstring or CString (which has a handy CompareNoCase() method) to make the code a little neater.
--Mike--
When 900 years old you reach, look as good you will not. Hmm.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|