|
I have created one dialog box. Then I have created a view class
with help of menu Insert -> Form.
CMultiDocTemplate* pNewDocTemplate = new CMultiDocTemplate(
IDR_TRIAL_TMPL,
RUNTIME_CLASS(CMDIDocumentDoc), // document class
RUNTIME_CLASS(CMDIChildWnd), // frame class
RUNTIME_CLASS(trial)); // view class
AddDocTemplate(pNewDocTemplate);
Even New template is seen in File -> New but it does not display
my dialog I am sure I am missing some step while creation of view class
Please help me
|| ART OF LIVING ||
|
|
|
|
|
HALO FRIENDS I MYSELF GOT THE SOLUTION
WHILE ADDING DIALOG BOX WE HAVE TO DO FOOLOWING PROCEDURE.
1) RIGHT CLICK ON DIALOG ITEM IN RESOURCE TAB
2) CLICK INSERT.
3) THE VARIOUS INCLUSIVE RESORSES WILL COME
4) OPEN + SIGN INFRONT OF DIALOG
5) SELECT IDD_FORMVIEW
6) THEN WE GET THE FORM ADD CONTROLS AS YOU WANT
7) GO TO TOP MENU BAR " INSERT --> FORM"
8) THIS WILL CREATE ALL STUFF FOR YOU AT BEGINING OF
INITINSTANCE OF YOUR APPLICATION CLASS
9) ONLY THING IT WILL DECLARE
CMultiDocTemplate* pNewDocTemplate;
IN INITINSTANCE OF YOUR APP CLASS YOU HAVE TO CUT THIS
DEFINITION AND PASTE IN THE YOUR APP CLASS;
10) ANY QUERYS PLS CONTACT AT shivditya@hotmail.com
|| ART OF LIVING ||
|
|
|
|
|
Hi Shivditya
Thanks
after ur question last day i was seraching
for the answer,
that's quiet tricky to add a Form dialog and that
will add a Document tempelate .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Vikas It really problematic solve alone vc++ problem
I am working in Thane as a alone programmer
can i get your contact number
|| ART OF LIVING ||
|
|
|
|
|
Hello,
I am totally new to programming with Windows Forms and I have a question about what kind of flexibility is available to properly factor my code. Specifically, I have been tasked with creating a program that is a wizard of sorts with many different panels that show up under various conditions. I should also mention that I am using managed C++, but I am sure I would have the same issue with C#. What I have noticed is that the designer will place event handlers for all child controls of the main form in the class that drives the main form. That is, all of the controls that appear in each of the panels (did I mention that there were a lot of them?) that are embedded in the main form have their events routed to the main form's class. This is a major problem because my main form's class has grown to be enormous and unwieldy. Does any one have any advise on how I might be able to better structure the application so that functionality can be broken out of the main form's class but that I may continue to use the designer?
Any help would be greatly appreciated
|
|
|
|
|
OlliesDad wrote: What I have noticed is that the designer will place event handlers for all child controls of the main form in the class that drives the main form.
They will go into whatever class contains the control. If you're using panels, then your main class will be adding controls to panels. Instead, why not create custom controls, which contain the controls for a panel, and the code will all go into those ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote: They will go into whatever class contains the control. If you're using panels, then your main class will be adding controls to panels. Instead, why not create custom controls, which contain the controls for a panel, and the code will all go into those ?
That sounds like a greate idea. I can just subclass the panel class. Thanks!
|
|
|
|
|
Far Pointer said this to me yesterday
Hi,
Follow this
CInitials::CEdit(derived from CEdit)
make a control variable from CInitials and link it to the editbox(through classwizard)
then you will be able to tap it on the CInitials::OnChar(..)(through classwizard),
or else add the EN_CHANGE handler this will also help you .
Regards
FarPOinter
This was my response.
Thanks, but im using Visual C++ 7.1 not Visual Studio 6.0.
Visual C++ 7.1 comes with Visual Studio 2003.
Thanks for the suggestion anyway.
Tom
Any help would be appreciated on catching WM_CHAR in the derived class, although it doesnt show in the Add Event Handler and like im saying there is no class wizard in VC++.NET 2003. Only Add Event Handler and new Class Dialog.
Tom
|
|
|
|
|
Tom Moore wrote: like im saying there is no class wizard in VC++.NET 2003. Only Add Event Handler and new Class Dialog.
Although you don't use the class wizard, you can still follow this persons advice. Why would Add Event Handler not allow you to add a handler for an event ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi guys. Who has an example of three control with check boxes and multiple selections and, most important, with possibility to show a previously (from xml, or ini file) selections? I’ve made one, but it is updating very slow, because it scanning recursively all sub items to show a previous selections. Please help.(Visual Studio 6)
student
|
|
|
|
|
per the subject...
I want to be able to check if the user's Windows has the right-to-left language support installed (control panel -> regional and language options -> languages)
Thanks in advance for your help.
Abu Mami
|
|
|
|
|
Any reason why this comparison should fail, CONSISTENLY??? Assuming the character at pToken->GetName()[stringIndex] is a - ????
else if (result = strchr("-",pToken->GetName()[stringIndex])) {
// Equals Sign
Operator = CNode::Minus;
szIdString = "Minus";
bIsSymbol = true;
}
My other comparisons are working for semicolon and equals, for example.
else if (result = strchr(";",pToken->GetName()[stringIndex])) {
// Semicolon
Operator = CNode::Semicolon;
szIdString = "Semicolon";
bIsSymbol = true;
}
else if (result = strchr("=",pToken->GetName()[stringIndex])) {
// Equals Sign
Operator = CNode::Equals;
szIdString = "Equals";
bIsSymbol = true;
}
I'm completely stuck on this...
Normality is a weakness...
|
|
|
|
|
I think you reversed the parameters.
char *strchr(const char *s, int c);
Kevin
|
|
|
|
|
adonisv wrote: else if (result = strchr("-",pToken->GetName()[stringIndex])) {
// Equals Sign
Operator = CNode::Minus;
szIdString = "Minus";
bIsSymbol = true;
}
Why not break this up into more manageable statements, like:
char c = pToken->GetName()[stringIndex];
char *result = strchr("-", c);
if (result != NULL)
{
...
} Now you can set a breakpoint on the first statement and single-step through them, noting the results along the way.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
What is wrong with:
if( '-' == pToken->GetName()[stringIndex] )
Or even:
switch(pToken->GetName()[stringIndex]) {
case '-':
break;
case '=':
break;
}
INTP
Every thing is relative...
|
|
|
|
|
Excellent advice, John! I feel so inadequate for not seeing that myself.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thanks, David!
I've just fallen into that trap myself, a couple of times before.
INTP
Every thing is relative...
|
|
|
|
|
Nice solution, thanks! :->
Normality is a weakness...
|
|
|
|
|
Well, none of those solutions worked.
pToken 0x00325360 {m_id=0xfffffcf7 m_name=0x003253c8 "–" m_eType=None ...}
This is what is showing up in the debugger. Am I comparing a character here or not. It keeps failing pretty consistently.
It looks like a string.
Normality is a weakness...
|
|
|
|
|
Sounds like may be the stringIndex is wrong. If not I am out of ideas.
If you know the first character is '-' then run a test with stringIndex=0 . You can atualy do this in the debugger, by stoping on the offending line and changing the value of stringIndex in the watch window. That is if you do not want to do it manualy in the code itself.
INTP
Every thing is relative...
|
|
|
|
|
Good afternoon,
the app detected memory leak at this point:
Groups = new GROUPSTRUCT[NumberofGroups];
for ( i = 0; i < NumberofGroups; i++ )
{
Discount->GetGroup( Groups[i].GroupID );
Groups[i].TotalContributory = 0.0;
}
and here is the delete:
if ( Groups )
{
delete[] Groups;
Groups = NULL;
}
NumberofGroups = this->GetContributoryAmounts (mainPos);
for ( i = 0; i < NumberofGroups; i++ )
{
DiscountData->GroupID = Groups[i].GroupID;
DiscountData->TotalContributory = Groups[i].TotalContributory;
Is this the proper delete? thanks!
|
|
|
|
|
valerie99 wrote: Is this the proper delete?
Yes, except you don't need to check if Groups is not null, before deleting. If Groups is null then delete simply does nothing.
My question is: Are you realy trying to access Groups after deleting them.
DiscountData->GroupID = Groups[i].GroupID;
INTP
Every thing is relative...
|
|
|
|
|
thanks for your reply.
if I step into the program, it's actually working by this float:
if ( Groups )
{
delete[] Groups;
Groups = NULL;
}
NumberofGroups = this->GetContributoryAmounts (mainPos);
Groups = new GROUPSTRUCT[NumberofGroups];
for ( i = 0; i < NumberofGroups; i++ )
{
Discount->GetGroup( Groups[i].GroupID );
Groups[i].TotalContributory = 0.0;
}
for ( i = 0; i < NumberofGroups; i++ )
{
DiscountData->GroupID = Groups[i].GroupID;
DiscountData->TotalContributory = Groups[i].TotalContributory;
|
|
|
|
|
valerie99 wrote: the app detected memory leak at this point:
Clicking on the line in the Debug window should take you to the spot where the new operator was used. That is your memory leak.
valerie99 wrote: Is this the proper delete?
No, because you are accessing Groups[i] after Groups has already been deleted.
valerie99 wrote: DiscountData->GroupID = Groups[i].GroupID;
I would have at least expected an access violation from this.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
thanks. here is the memory leak report. when I clicked the first line it brings to "Groups = new GROUPSTRUCT[NumberofGroups];", I think it's becaue of "you are accessing Groups[i] after Groups has already been deleted", strangly no access violation.
:\dev\c++\billing\voldisc\voldiscdlg.cpp(1702) : {839} normal block at 0x00FE58F0, 16 bytes long.
Data: < > 01 00 00 00 CD CD CD CD 00 00 00 00 00 00 00 00
{465} normal block at 0x00FE5230, 1309 bytes long.
Data: 48 65 61 64 65 72 20 4C 65 6E 67 74 68 3A 20 30
{460} normal block at 0x00FC28B8, 60 bytes long.
Data: < a 0R > 04 EA 61 00 30 52 FE 00 1D 05 00 00 1D 05 00 00
{210} normal block at 0x00FBDB80, 14844 bytes long.
Data: <5 a > 35 00 00 00 90 D2 61 00 98 81 13 00 00 00 00 00
{209} normal block at 0x00FBDB28, 20 bytes long.
Data: <billdata\vtax02.> 42 49 4C 4C 44 41 54 41 5C 56 54 41 58 30 32 2E
{208} normal block at 0x00FBDAC0, 36 bytes long.
Data: < a 5 ( > B8 CC 61 00 35 00 00 00 28 DB FB 00 98 81 13 00
Object dump complete.
So the major leak is {210} normal block at 0x00FBDB80, 14844 bytes long.
Data: <5 a > 35 00 00 00 90 D2 61 00 98 81 13 00 00 00 00 00 , which I couldn't get there by clicking on, so I placed this line _CrtSetBreakAlloc(210); to set a user break point, here is the call stack when the breakpoint taken effect.
_heap_alloc_dbg(unsigned int 14844, int 1, const char * 0x00000000, int 0) line 338
_nh_malloc_dbg(unsigned int 14844, int 0, int 1, const char * 0x00000000, int 0) line 248 + 21 bytes
_malloc_dbg(unsigned int 14844, int 1, const char * 0x00000000, int 0) line 165 + 27 bytes
operator new(unsigned int 14844) line 325 + 15 bytes
CB::Open(const char * 0x00e29f69, int 0) line 915 + 27 bytes
CB::CB(const char * 0x00e29f69, int 0) line 883
CB_DBF::CB_DBF(const char * 0x00e29f69, int 0) line 269 + 45 bytes
OpenDbfHelper(const char * 0x00e29f69) line 93 + 40 bytes
OpenDbf(CB_DBF * * 0x0064acf0 class CB_DBF * VTax, const char * 0x00e29f69, int & 0, std::basic_string<char,std::char_traits<char>,std::allocator<char> > * 0x00fafdcc {0x00000000 ""}) line 46 + 9 bytes
CVoldiscDlg::OpenDBFs() line 838 + 27 bytes
Run(void * 0x0012fd5c) line 2557 + 8 bytes
_AfxThreadEntry(void * 0x0012f6cc) line 112 + 13 bytes
_threadstartex(void * 0x00e24b90) line 212 + 13 bytes
KERNEL32! 7c57b388()
could u give me some help about how to nerrow down where the leak starts? thank you !
|
|
|
|