|
I know we can replace the floating mini frame class for toolbars and other control bars with something like :
m_pFloatingFrameClass = RUNTIME_CLASS(MyFloatingBarFrame);
That changes all mini frames for the application; is there a way to replace the frame for only a few select frames ?
I need to do some customized handling for one controlbar ( when it closes ) that I don't want to do on the other toolbars.
Thanks.
M.
|
|
|
|
|
Hi,
I've just downloaded a delaunay triangulation program from internet and reading the source code. I stumble upon this code:
struct memorypool {
VOID **firstblock, **nowblock;
VOID *nextitem;
VOID *deaditemstack;
VOID **pathblock;
VOID *pathitem;
int alignbytes;
int itembytes;
int itemsperblock;
int itemsfirstblock;
long items, maxitems;
int unallocateditems;
int pathitemsleft;
};
it seems that the program is doing it's own memory management. I wonder why people want to do their own memory management, we have new/delete for C++ and malloc/free for C. What are the advantages/disadvantages of doing our own memory management?
Thanks.
regards,
tep
|
|
|
|
|
In short, knowledge of allocation usage patterns can lead to (significantly) optimized memory allocation/recovery routines.
In general though these optimized routines only shine when you are allocating/freeing many blocks (10's or 100's of thousands at least) repeatedly in a short period of time.
The current malloc/free use lookaside lists and are fairly performant compared with those of the past. There is little _need_ to go beyond these for most programs out there.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
From personal experience in production code, managing your own memory pool can greatly reduce memory fragmentation - we had a process that was only using about 200mb of memory, yet constantly crashed due to running out of memory. We eventually tracked this down to major memory fragmentation - at one stage the largest free chunk of memory dropped to about 15mb!
Implementing memory pooling in the key areas that were constantly allocating and reallocating thousands of tiny objects pretty much eliminated this heavy fragmentation.
|
|
|
|
|
I have a problem using a combobox. I am using SDK, not MFC, but basically the combobox updates and I can use the data in it but the drop down functionality of the combobox does not work. I press the arrow at the right of the combobox and nothing happens - I have to use the arrow keys to select the item I want within the combobox data set.
Do I have to enable the drop down functionality?
Any help would be great
u6ik
|
|
|
|
|
in the resource editor, enlarge the dropdown list to a size bigger than 0
|
|
|
|
|
And even this is tricky ... I do not know how many people just falled in that trap.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
microsoft joke
|
|
|
|
|
If your using CreateWindow(Ex) you have to set the hight to the hight you want your dropdown window to go because a ComboBox has it's integral hight so setting the hight just afects the dropdown not the ComboBox.
ex:
hComboBox=CreateWindow("ComboBox",NULL,dwStyle,0,0,400,200,hWnd,(HMENU)iIdCB,hInst,0);
else
if it is on a dialogbox just drag the middel point as far as you want the dropdown to go
i hope this helped
G_S
|
|
|
|
|
How do you use combobox did you create this control in your program
|
|
|
|
|
I created the box in the resource editor on a Dialog form.
u6ik
|
|
|
|
|
If it's a size problem, either increase the size of the drop-down portion in the resource editor, or see here.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks for your replies. All is working peachy
u6ik
|
|
|
|
|
Hi all,
when some one enters a hex value in a edit box ,say for example 0xffff
,then is there any way by which the value can be retreived as integer itself (not as text)??
when i retreive the data as text and try to convert it using atoi or atof routines the output is always 0.It'd be great if someone through some light on this ......
Thanks in advance
rajeev
|
|
|
|
|
You can use strtol[^] to convert your hexa string into a long. With this function, you can supply the base (which is 16 in your case).
|
|
|
|
|
strtol[] did the job...Thanks for ur help
|
|
|
|
|
Hello everyone,
Thank you for your suggestions in my previous message.It's working.As next step, i want to send my uint8 values here to serial port.For that i added two lines into my code (bold) but i receive this error,
[Linker Error] Unresolved external '_outportb' referenced from H:\INTERFACE\INTERFACE.OBJ
(Interface is the name of my file in which i saved my code and files)
I didnt get the cause of problem,what's wrong?. If anyone has an idea, would be pleased!
#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h> // system()
int transmit (double x);
int i;
system();
outportb(int port, unsigned int);
int transmit (double x)
{ union ifas
{
double d;
unsigned char u8value[8];
};
union ifas member;
member.d = x;
printf("\nmember.d=%d\n",member.d);
for ( i=0 ; i<8 ; i++)
{
printf("\nmember.u8value[%d]=%f\n",i,member.u8value[i]);
outportb(port,member.u8value[i]);
}
return 0;
}
int main(int argc, char* argv[]) //Console
{
double var;
scanf("%lf",&var);
transmit(var);
system("pause");
return 0;
}
Regards,
Cahit
-- modified at 11:37 Thursday 17th August, 2006
|
|
|
|
|
%d format specifier is signed decimal integer. For your double, use %f. For your unsigned ints, use %u
-- modified at 8:35 Thursday 17th August, 2006
Well, actually, since you have chars in your union you should use %c instead of %u.
Cheers
Steen.
"Are you gonna check your makeup when you're done whining?" John Simmons, 05/31/2006
|
|
|
|
|
cahit23 wrote: union ifas
{
double d;
char u8value[8]; //??????????????
};
Use unsigned char for u8value
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I don't know how many C++ guys search for articles.
this is my last article - hope you like the toolbar and give me some suggestions.
See The toolBar [^]
|
|
|
|
|
Hello,
I am not able to find any function which will get me the line no. on which the cursor is present in RichEdit Control in MFC? How to get it? Is there any function to get it? If yes, then what is it?
Thanks,
Software Developer
Sanjay Khapre
|
|
|
|
|
SanjaySMK wrote: line no. on which the cursor is present in RichEdit Control in MFC
Hmm - never needed that.
But does GetSel() followed by LineFromChar() work?
-- modified at 7:58 Thursday 17th August, 2006
Just found it in the Doku for LineFromChar() :
"If [the Parameter] nIndex is –1, it specifies the current line, that is, the line that contains the caret."
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Thanks a lot jhwurmbach, I was trying so many things, but finally found your reply apt and exact. LineFromChar worked perfectly.
Thanks a ton.
Regards,
Software Developer
Sanjay Khapre
|
|
|
|
|
What the function can support this issue?
|
|
|
|
|