|
of course can, do it like insert an edit box
|
|
|
|
|
Hi all,
an MFC application, MDI. VC7. the wizard has generated few classes for me. and one of them is the main frame CMainFrame (CFrameWnd). If there are no children, the user can see light gray background. How can i customize this background (draw a bitmap)?
When i do ON_WM_PAINT ->
OnPaint(void)
{
CPaintDC dc(this);
// try to draw into dc
}
no effect! still standard light gray background!
how do i cutomize the way background drawn?
regards,
alex
debug - is my life style
|
|
|
|
|
|
wow!
thank you!!!
that't exactly what i looked for!
regards,
alex
debug - is my life style
|
|
|
|
|
I anyone be knowing where can be finding a code for rule editor liking the one in Outlook Express for email filter. Is nice way to building conditions and rules, and would like use of such thing.
Thank,
Quzi
|
|
|
|
|
Hi !
I'm trying to understand what is a XML-GUI....I tried to do a google search but couldn't find any relevant link.
Does anyone know a good site I could look at or could explain me what's a XML-GUI (I know what is a GUI, but cannot figure out what XML has to do with it !).
Thanks !
Jerome
|
|
|
|
|
lets just say that i think my comp sci 1 teacher bought his phd over the internet, cause i didnt learn too much. This is our first assignment for Comp Sci 2 and i'm pretty lost.
heres the problem:
Write a C++ program that will process the user’s full name (i.e., first, middle, and last name –> Joe Bob Allen is an example) and display the name in various ways. There is only one word allowed for the first name and one word allowed for the last name, but the middle name can consist of multiple words. The maximum length of the full name is 75. The maximum length of the first name is 25. The maximum length of the last name is 25.
For the little i do know, i would think it would be easiest just to create a loop that breaks off words at the spaces in the string. We dont actually have to output the middle names, so i'm guessing there would be another loop that starts at the end of the string and works its way up (to get the last name).
Any help would be much appreciated
|
|
|
|
|
Use strtok () function.
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
Hi,
I think u should make a structure for name
struct MyStructType
{ char First[25];
char Middle[25];
char Last[25];
};
with this way u can easily maintain all..
Data type can be CString...
OK!Good Bye..Have a Nice Life..Bye..Sumit Kapoor
Never consider anything Impossible before trying to solve that..---Sumit Kapoor---
|
|
|
|
|
CString str1,str2,str3,str("first mid dle last");
int n,m;
n=str.Find(" ");
m=str.ReverseFind(' ');
str1=str.Mid(0,n);
str2=str.Mid(n+1,m-n);
str3=str.Mid(m+1);
AfxMessageBox(str1+"\n"+str2+"\n"+str3);
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
crimsonclear wrote:
lets just say that i think my comp sci 1 teacher bought his phd over the internet, cause i didnt learn too much. This is our first assignment for Comp Sci 2 and i'm pretty lost.
It's usually not a good idea to blame your shortcomings on someone else.
crimsonclear wrote:
Write a C++ program that will process the user’s full name...
In this context, "process" is too ambiguous. What do you mean by it?
I think you can take it from here:
strchr(string, ' ');
strrchr(string, ' ');
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi,
I have an MDI application. I want to know the correct method of clsing such applications. The code I've used is following:
CMainFrame::OnButtonExit()
{
CleanUp();
OnClose();
}
Is this correct?I am experiencing some strange behaviour when App exits.
Shd I use SendMessage(WM_CLOSE,..) instead? What is the cleanest way of exiting such a program. What is the order in which all the main windows of the program r destroyed?
Thnks in advance
|
|
|
|
|
PostMessage ( WM_CLOSE ) should do it, since that's the same thing that happens when you click the Close button.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0.1! | RightClick-Encrypt
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
Hi there,
I'm using a multimedia timer in my program. The timer is going off ok but one of the actions triggered by the timer is a call to CWnd::GetParentFrame() which is eventually giving a debug assertion on line 879 of CWnd, the bit that goes:
CHandleMap* pMap = afxMapHWND();
ASSERT(pMap != NULL);
I've used GetParentFrame heaps of times before, so I guess the problem must be something to do with either the timer or something caused by the timer. Does anyone know what can make afxMapHWND() return null?
|
|
|
|
|
MFC has different HWND Maps for Different Threads
If a window is created in one thread and the CWnd * ptr is used in another thread ASSERT Failure will occur , not sure if this is the problem here but
Try to use the HWND instead of CWnd
might work
Hope it Helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Just a question
void main(void)
{
int i;
for(i=0;i<100;i++)
{
Check(1);
}
}
void Check(int i)
{
char szMsg[100];
}
if the Check function will be called 100 times, will the szMsg be
1) created and disallocated 100 times as well
2) created once and remained till the Main ended
3) created once and not freed at all
4) created 100 times and not freed at all
if the answer is 1 or 2, then what is the difference / advantages if i use malloc or LocalAlloc instead? will there be performance problem?
I am doing a project on embedded device and memeory managment is crucial.
I thanx anyone who gave me expertise answer.
|
|
|
|
|
Short answer: 1
But note that it is created on the STACK and not on the HEAP (like malloc would).
In an ideal world this wouldn't take any time at all (the SP has to be adjusted anyway) but (and I'm not 100% sure about this) the compiler might decide that the memoryblock needs to be zeroed out which ofcourse takes time.
By using malloc instead you would be going through the memorymanager which tracks the allocated blocks which is pretty slow.
The fastest way (IF the compiler clears the block) would be to declare the block static.
And if the paths that I have followed/have tread against the flow/there is no need for sorrow
I am coming home
Return, Crüxshadows
|
|
|
|
|
In Window CE devices, Will there be any difference in creating on the stack and heap?
I have a current program that sometimes during usage by client, will cause the program to crash.Went through the codes and debugging, still cannot find the bug. It only happens randomly but particularly at a specific places where there is a lot of loading of GUI on the screen.
Hence, i need to fine tune all this problems, hopefully an upgrade on the program won't cause this program. I am also trying the try-except method to prevent exception error.
|
|
|
|
|
Another factor to consider is the limited amount of stack available; by default, you have 64KB of stack, which has to encompass all of your thread's execution. If you run out of stack, Windows CE will raise a Stack Overflow exception. You shouldn't try to catch this - it indicates a serious problem. If uncaught, the thread will be terminated.
You should really only use the stack for short-lived items and in leaf functions (functions that call no other functions). Using the stack for anything that will have a long lifetime (e.g. your main frame window) isn't a good idea.
|
|
|
|
|
According to the C++ language definition, the variable szMsg is allocated on entry to the Check() function, and deallocated on exit.
Typically, and in the Windows environment, local memory used in this way is from the stack. Stack allocations and deallocations are inexpensive, since they usually amount to moving the stack pointer by the size of the value.
In the embedded environment, however, things may be different. Depending on the CPU architecture, local memory may be managed via a heap or some other structure. The cost of local memory depends upon the CPU and how the compiler is implements it. PIC microcontrollers, for example, typically only store return addresses on the stack. Local memory is managed via a heap or statically through call graph analysis.
Software Zen: delete this;
|
|
|
|
|
In microcontollers (8051), the code segment and data segment is embedded in to the chip, while Stack and heap can be on RAM.
Hope it helps.
|
|
|
|
|
Hey all.
I have my main app. On the main dialog window, there is a progress bar. I am writing a file archiving utility that uses someone elses ZIP class to zip up the files. Some of the files, however are extremely big, so when the "add" portion of their class gets called, it just sits there for 30 seconds without showing the user anything. I actually have the .h and .cpp from the class, so I can make modifications to it. I found the place where it loops through and adds the file to the zip file. What I would like to be able to do is update a progressbar on the main dialog window during this loop. I have no idea how I would tell the ZIP class that there is a progress bar on the main dialog. Any ideas?
Thanks in advance!
|
|
|
|
|
Put the "zipping" code in a worker thread, and modify the code to post an "update" message to the primary thread. In the primary thread's response to this message, update the progress bar.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I have a program that's using a lot of cpu (that is the meaning) now i want to stop this progress when a key is press'd like the ESC(27)key, what do i need to do to get this working ??
|
|
|
|
|