|
I have added BN_CLICKED message handler also earlier only But it the button is not enabling.other controls like edit Box,Combo Box etc are enabled.But only the buttons are not enabled.
Thanks
|
|
|
|
|
radhika28 wrote: I have added BN_CLICKED message handler also earlier only But it the button is not enabling.other controls like edit Box,Combo Box etc are enabled.But only the buttons are not enabled.
Are you adding the event handler to the correct class. For eg: you should add to the mainframe class or to the dialog bar class.
|
|
|
|
|
Hi,
I have added the BN_CLICKED message handler in the Dialog Bar class only.But i haven't done this in MainFrame class.Now i have done it.The button is enabled now.
Thanks
|
|
|
|
|
radhika28 wrote: I have added the BN_CLICKED message handler in the Dialog Bar class only.But i haven't done this in MainFrame class.Now i have done it.The button is enabled now.
There is another easy way of doing this. Just override the following function your derived CMainFrame class and you will have all controls in the dialog bar and tool bar and all menu items enabled without writing event handlers...
virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
return TRUE;
} Well this would enable all buttons and menu items but of course you should write event handlers if you want to have something happen.
|
|
|
|
|
radhika28 wrote:
I have added the BN_CLICKED message handler in the Dialog Bar class only.But i haven't done this in MainFrame class.Now i have done it.The button is enabled now.
you can write ON_COMMAND_RANGE, if creating dynamic controls!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
Hi all,
i'am using vc++ in VS2005 , while debugging i'am not able to see View->Debugwindows->Callstack and Memory options in this IDE ,can any one help me in VS2005 how to use these options
mpk1979
|
|
|
|
|
|
mpk1979 wrote: i'am using vc++ in VS2005 , while debugging i'am not able to see View->Debugwindows->Callstack and Memory options in this IDE ,can any one help me in VS2005 how to use these optio
still there .. it might be under debug menu item
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
I want to do some modifications to this project.
The modification that I want to do are change the way of taking data, I want to get numbers and not blue or red dots and I do not have any idea how change it, even with the source code. So please help me
|
|
|
|
|
I want to change my project also. I don't want it to work on the computer anymore, I want it to come out. Can you show me how?
Do you know what I'm talking about?
|
|
|
|
|
Can you be more specific.
|
|
|
|
|
Sure, I want to change de code of the program that i got here, the program is about a Neural Network that recognize patterns based on the number of dots, that you draw in the screen so i want to change that and i want to use numbers as inputs and not the dots
|
|
|
|
|
I have a program that I have written in Visual C++ 6.0 that using the textout command for print to the screen. When I initially send text to the screen everything prints. Later I use textout to update the screen but only part of the update is printed or none of it at all.
If I minimize and then maximize my box then all the text that was sent to the screen is printed and everything is at it should be. What am I doing wrong or do I need to do in order to get the screen updated without the minimize and maximize?
|
|
|
|
|
Without seeing your code it's hard to say. There could be a number of things going wrong, failing to invalidate the rect, drawing in the wrong place, drawing out of order, handle leaks....
|
|
|
|
|
This is routine that I call to initially paint the screen and then to update the screen.
int PaintScrn ()
{
pdash_Line = dash_Line;
memset(pdash_Line,'-',300);
//--------- Line 1 ----------------
TextOut(hdc,Col_1,Line_1,"Code Directory",strlen("Code Directory"));
TextOut(hdc,Col_2,Line_1,":",1);
if(strlen(code_dir) == 0)
{
TextOut(hdc,Col_3,Line_1,home_dir,strlen(home_dir));
}
else
{
TextOut(hdc,Col_3,Line_1,code_dir,strlen(code_dir));
}
//--------- Line 2 ----------------
TextOut(hdc,Col_1,Line_2,"OVL File :",12);
TextOut(hdc,Col_2,Line_2,":",1);
if(strlen(overlay1_name)>0)
{
TextOut(hdc,Col_3,Line_2,overlay1_name,strlen(overlay1_name));
}
//--------- Line 3 ----------------
if(strlen(overlay2_name)>0)
{
TextOut(hdc,Col_3,Line_3,overlay2_name,strlen(overlay2_name));
}
//--------- Line 4 ----------------
TextOut(hdc,Col_1,Line_4,"APP File :",9);
TextOut(hdc,Col_2,Line_4,":",1);
if(strlen(app_name)>0)
{
TextOut(hdc,Col_3,Line_4,app_name,strlen(app_name));
}
//--------- Line 5 ----------------
TextOut(hdc,Col_1,Line_5,"SFL File :",9);
TextOut(hdc,Col_2,Line_5,":",1);
if(strlen(sfl_name)>0)
{
TextOut(hdc,Col_3,Line_5,sfl_name,strlen(sfl_name));
}
//--------- Line 6 ----------------
TextOut(hdc,Col_1,Line_6,"CRT File :",9);
TextOut(hdc,Col_2,Line_6,":",1);
if(strlen(crt_name)>0)
{
TextOut(hdc,Col_3,Line_6,crt_name,strlen(crt_name));
}
//--------- Line 7 ----------------
TextOut(hdc,Col_1,Line_7,"TBL File :",9);
TextOut(hdc,Col_2,Line_7,":",1);
if(strlen(tbl_name)>0)
{
TextOut(hdc,Col_3,Line_7,tbl_name,strlen(tbl_name));
}
//--------- Line 8 ----------------
TextOut(hdc,Col_1,Line_8,pdash_Line,185);
//--------- Line 9 ----------------
TextOut(hdc,Col_4,Line_9,pdash_Line,26);
TextOut(hdc,Col_5,Line_9,"***** BLOCK SIZE *****",strlen("***** BLOCK SIZE *****"));
//--------- Line 10 ----------------
TextOut(hdc,Col_4,Line_10,"** FILE SIZE **",strlen("** FILE SIZE **"));
TextOut(hdc,Col_5,Line_10,"DEC",strlen("DEC"));
TextOut(hdc,Col_6,Line_10,"HEX",strlen("HEX"));
//--------- Line 11 ----------------
TextOut(hdc,Col_1,Line_11,pdash_Line,185);
//--------- Line 12 ----------------
TextOut(hdc,Col_1,Line_12,"Output Flash Filename",strlen("Output Flash Filename"));
TextOut(hdc,Col_2,Line_12,":",1);
if(strlen(flashFile)>0)
{
TextOut(hdc,Col_3,Line_12,flashFile,strlen(flashFile));
TextOut(hdc,Col_4,Line_12,flashFileSizeStr,strlen(flashFileSizeStr));
TextOut(hdc,Col_5,Line_12,flashDBlockSizeStr,strlen(flashDBlockSizeStr));
TextOut(hdc,Col_6,Line_12,flashHBlockSizeStr,strlen(flashHBlockSizeStr));
}
//--------- Line 13 ----------------
TextOut(hdc,Col_1,Line_13,"Output Cert Filename",strlen("Output Cert Filename"));
TextOut(hdc,Col_2,Line_13,":",1);
if(strlen(certFile)>0)
{
TextOut(hdc,Col_3,Line_13,certFile,strlen(certFile));
TextOut(hdc,Col_4,Line_13,certFileSizeStr,strlen(certFileSizeStr));
TextOut(hdc,Col_5,Line_13,certDBlockSizeStr,strlen(certDBlockSizeStr));
TextOut(hdc,Col_6,Line_13,certHBlockSizeStr,strlen(certHBlockSizeStr));
}
//--------- Line 14 ----------------
TextOut(hdc,Col_1,Line_14,"Output Script Filename",strlen("Output Script Filename"));
TextOut(hdc,Col_2,Line_14,":",1);
if(strlen(certFile)>0||strlen(scriptFile)>0)
{
TextOut(hdc,Col_3,Line_14,scriptFile,strlen(scriptFile));
//--------- Line 15 ----------------
TextOut(hdc,Col_3,Line_15,scriptFileTX,strlen(scriptFileTX));
}
return (0);
}
|
|
|
|
|
Can you show a snippet code
|
|
|
|
|
This is the routine that I call to initially paint the screen and then for subsequent updates.
int PaintScrn ()
{
pdash_Line = dash_Line;
memset(pdash_Line,'-',300);
//--------- Line 1 ----------------
TextOut(hdc,Col_1,Line_1,"Code Directory",strlen("Code Directory"));
TextOut(hdc,Col_2,Line_1,":",1);
if(strlen(code_dir) == 0)
{
TextOut(hdc,Col_3,Line_1,home_dir,strlen(home_dir));
}
else
{
TextOut(hdc,Col_3,Line_1,code_dir,strlen(code_dir));
}
//--------- Line 2 ----------------
TextOut(hdc,Col_1,Line_2,"OVL File :",12);
TextOut(hdc,Col_2,Line_2,":",1);
if(strlen(overlay1_name)>0)
{
TextOut(hdc,Col_3,Line_2,overlay1_name,strlen(overlay1_name));
}
//--------- Line 3 ----------------
if(strlen(overlay2_name)>0)
{
TextOut(hdc,Col_3,Line_3,overlay2_name,strlen(overlay2_name));
}
//--------- Line 4 ----------------
TextOut(hdc,Col_1,Line_4,"APP File :",9);
TextOut(hdc,Col_2,Line_4,":",1);
if(strlen(app_name)>0)
{
TextOut(hdc,Col_3,Line_4,app_name,strlen(app_name));
}
//--------- Line 5 ----------------
TextOut(hdc,Col_1,Line_5,"SFL File :",9);
TextOut(hdc,Col_2,Line_5,":",1);
if(strlen(sfl_name)>0)
{
TextOut(hdc,Col_3,Line_5,sfl_name,strlen(sfl_name));
}
//--------- Line 6 ----------------
TextOut(hdc,Col_1,Line_6,"CRT File :",9);
TextOut(hdc,Col_2,Line_6,":",1);
if(strlen(crt_name)>0)
{
TextOut(hdc,Col_3,Line_6,crt_name,strlen(crt_name));
}
//--------- Line 7 ----------------
TextOut(hdc,Col_1,Line_7,"TBL File :",9);
TextOut(hdc,Col_2,Line_7,":",1);
if(strlen(tbl_name)>0)
{
TextOut(hdc,Col_3,Line_7,tbl_name,strlen(tbl_name));
}
//--------- Line 8 ----------------
TextOut(hdc,Col_1,Line_8,pdash_Line,185);
//--------- Line 9 ----------------
TextOut(hdc,Col_4,Line_9,pdash_Line,26);
TextOut(hdc,Col_5,Line_9,"***** BLOCK SIZE *****",strlen("***** BLOCK SIZE *****"));
//--------- Line 10 ----------------
TextOut(hdc,Col_4,Line_10,"** FILE SIZE **",strlen("** FILE SIZE **"));
TextOut(hdc,Col_5,Line_10,"DEC",strlen("DEC"));
TextOut(hdc,Col_6,Line_10,"HEX",strlen("HEX"));
//--------- Line 11 ----------------
TextOut(hdc,Col_1,Line_11,pdash_Line,185);
//--------- Line 12 ----------------
TextOut(hdc,Col_1,Line_12,"Output Flash Filename",strlen("Output Flash Filename"));
TextOut(hdc,Col_2,Line_12,":",1);
if(strlen(flashFile)>0)
{
TextOut(hdc,Col_3,Line_12,flashFile,strlen(flashFile));
TextOut(hdc,Col_4,Line_12,flashFileSizeStr,strlen(flashFileSizeStr));
TextOut(hdc,Col_5,Line_12,flashDBlockSizeStr,strlen(flashDBlockSizeStr));
TextOut(hdc,Col_6,Line_12,flashHBlockSizeStr,strlen(flashHBlockSizeStr));
}
//--------- Line 13 ----------------
TextOut(hdc,Col_1,Line_13,"Output Cert Filename",strlen("Output Cert Filename"));
TextOut(hdc,Col_2,Line_13,":",1);
if(strlen(certFile)>0)
{
TextOut(hdc,Col_3,Line_13,certFile,strlen(certFile));
TextOut(hdc,Col_4,Line_13,certFileSizeStr,strlen(certFileSizeStr));
TextOut(hdc,Col_5,Line_13,certDBlockSizeStr,strlen(certDBlockSizeStr));
TextOut(hdc,Col_6,Line_13,certHBlockSizeStr,strlen(certHBlockSizeStr));
}
//--------- Line 14 ----------------
TextOut(hdc,Col_1,Line_14,"Output Script Filename",strlen("Output Script Filename"));
TextOut(hdc,Col_2,Line_14,":",1);
if(strlen(certFile)>0||strlen(scriptFile)>0)
{
TextOut(hdc,Col_3,Line_14,scriptFile,strlen(scriptFile));
//--------- Line 15 ----------------
TextOut(hdc,Col_3,Line_15,scriptFileTX,strlen(scriptFileTX));
}
return (0);
}
|
|
|
|
|
First of all I must say one thing your code isnt good you used of TetOut repeated but you can use from a function and in this function insert Textout.This function needs to input parameters for TextOut.How do you refresh this window did you try with Invalidate
|
|
|
|
|
use CWnd::Invalidate() or CWnd::InvalidateRect .
|
|
|
|
|
I'm new to Visual C++ and am having problems getting your suggestion to compile. This is the routine that I call initially to paint the screen and then to subsequently update the screen.
int PaintScrn ()
{
pdash_Line = dash_Line;
memset(pdash_Line,'-',300);
//--------- Line 1 ----------------
TextOut(hdc,Col_1,Line_1,"Code Directory",strlen("Code Directory"));
TextOut(hdc,Col_2,Line_1,":",1);
if(strlen(code_dir) == 0)
{
TextOut(hdc,Col_3,Line_1,home_dir,strlen(home_dir));
}
else
{
TextOut(hdc,Col_3,Line_1,code_dir,strlen(code_dir));
}
//--------- Line 2 ----------------
TextOut(hdc,Col_1,Line_2,"OVL File :",12);
TextOut(hdc,Col_2,Line_2,":",1);
if(strlen(overlay1_name)>0)
{
TextOut(hdc,Col_3,Line_2,overlay1_name,strlen(overlay1_name));
}
//--------- Line 3 ----------------
if(strlen(overlay2_name)>0)
{
TextOut(hdc,Col_3,Line_3,overlay2_name,strlen(overlay2_name));
}
//--------- Line 4 ----------------
TextOut(hdc,Col_1,Line_4,"APP File :",9);
TextOut(hdc,Col_2,Line_4,":",1);
if(strlen(app_name)>0)
{
TextOut(hdc,Col_3,Line_4,app_name,strlen(app_name));
}
//--------- Line 5 ----------------
TextOut(hdc,Col_1,Line_5,"SFL File :",9);
TextOut(hdc,Col_2,Line_5,":",1);
if(strlen(sfl_name)>0)
{
TextOut(hdc,Col_3,Line_5,sfl_name,strlen(sfl_name));
}
//--------- Line 6 ----------------
TextOut(hdc,Col_1,Line_6,"CRT File :",9);
TextOut(hdc,Col_2,Line_6,":",1);
if(strlen(crt_name)>0)
{
TextOut(hdc,Col_3,Line_6,crt_name,strlen(crt_name));
}
//--------- Line 7 ----------------
TextOut(hdc,Col_1,Line_7,"TBL File :",9);
TextOut(hdc,Col_2,Line_7,":",1);
if(strlen(tbl_name)>0)
{
TextOut(hdc,Col_3,Line_7,tbl_name,strlen(tbl_name));
}
//--------- Line 8 ----------------
TextOut(hdc,Col_1,Line_8,pdash_Line,185);
//--------- Line 9 ----------------
TextOut(hdc,Col_4,Line_9,pdash_Line,26);
TextOut(hdc,Col_5,Line_9,"***** BLOCK SIZE *****",strlen("***** BLOCK SIZE *****"));
//--------- Line 10 ----------------
TextOut(hdc,Col_4,Line_10,"** FILE SIZE **",strlen("** FILE SIZE **"));
TextOut(hdc,Col_5,Line_10,"DEC",strlen("DEC"));
TextOut(hdc,Col_6,Line_10,"HEX",strlen("HEX"));
//--------- Line 11 ----------------
TextOut(hdc,Col_1,Line_11,pdash_Line,185);
//--------- Line 12 ----------------
TextOut(hdc,Col_1,Line_12,"Output Flash Filename",strlen("Output Flash Filename"));
TextOut(hdc,Col_2,Line_12,":",1);
if(strlen(flashFile)>0)
{
TextOut(hdc,Col_3,Line_12,flashFile,strlen(flashFile));
TextOut(hdc,Col_4,Line_12,flashFileSizeStr,strlen(flashFileSizeStr));
TextOut(hdc,Col_5,Line_12,flashDBlockSizeStr,strlen(flashDBlockSizeStr));
TextOut(hdc,Col_6,Line_12,flashHBlockSizeStr,strlen(flashHBlockSizeStr));
}
//--------- Line 13 ----------------
TextOut(hdc,Col_1,Line_13,"Output Cert Filename",strlen("Output Cert Filename"));
TextOut(hdc,Col_2,Line_13,":",1);
if(strlen(certFile)>0)
{
TextOut(hdc,Col_3,Line_13,certFile,strlen(certFile));
TextOut(hdc,Col_4,Line_13,certFileSizeStr,strlen(certFileSizeStr));
TextOut(hdc,Col_5,Line_13,certDBlockSizeStr,strlen(certDBlockSizeStr));
TextOut(hdc,Col_6,Line_13,certHBlockSizeStr,strlen(certHBlockSizeStr));
}
//--------- Line 14 ----------------
TextOut(hdc,Col_1,Line_14,"Output Script Filename",strlen("Output Script Filename"));
TextOut(hdc,Col_2,Line_14,":",1);
if(strlen(certFile)>0||strlen(scriptFile)>0)
{
TextOut(hdc,Col_3,Line_14,scriptFile,strlen(scriptFile));
//--------- Line 15 ----------------
TextOut(hdc,Col_3,Line_15,scriptFileTX,strlen(scriptFileTX));
}
return (0);
}
|
|
|
|
|
I have been reading and analyzing various progs dealing with DLL's, looking up things in manuals until I understand what is happening. I have encountered the term WINAPI in one prog that used explicit linking to the DLL. There are references in MSDN, but no explanation. (Just its appearance in code snips.) For example, what does WINAPI do in the following:
typedef INT (WINAPI * lp_ptRegisterCallback)(INT callbackID, ProcAddr CBackProc);
|
|
|
|
|
WINAPI is defined as __stdcall (a calling convention). Basically it tells the compiler what sort of function it is, in particular about the arguments passed into a function and who is responsible for cleaning the stack (the function or the caller). Try searching for terms such as "calling conventions" to get a better idea.
|
|
|
|
|
Oliver123 wrote: I have been reading and analyzing various progs dealing with DLL's, looking up things in manuals until I understand what is happening. I have encountered the term WINAPI in one prog that used explicit linking to the DLL. There are references in MSDN, but no explanation. (Just its appearance in code snips.) For example, what does WINAPI do in the following:
WINAPI expands to __stdcall.
It's a windows calling convention which means the the callee is responsible for clearing the arguments passed to it from the stack.
For more information read this[^] article by Nemanja.
|
|
|
|
|
I'm curious why you did not just put the cursor somewhere on WINAPI and press the F12 key. You would have been taken to windef.h where you would have seen that WINAPI resolves to __stdcall . Searching for __stdcall would have produced a lot more.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The answer is simple. I didn't know about that F12 trick. VC++ contains quite a lot I haven't yet experienced. Thanks for the tip. I suspect it will get lots of use.
|
|
|
|
|