|
Thanks but what I want is to send my new dialogs behind the main program/dialog , SetWindowPos() only sends them behind the other new dialogs but not the main one.
---
|
|
|
|
|
are your popup dialogs modeless?
if so is the problem you face this :- when you click on the parent window, your popups still stay on top.
Is that your problem?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Yep
Do you know a way around this??
---
|
|
|
|
|
Use GetDesktopWindow and set the desktop as the parent window of your modeless dialogs. Now you'll be able to put those popups behind your main app and you'll also be able to minimize them to the task bar
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
The wonders never cease - exactly what I wanted
Thanks a lot
---
|
|
|
|
|
This is a facet abt modeless dialogs that a lot of people are confused about.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Hi,
I want to retrieve unc path for folder and folder shortcut displayed under “My Network Places”. In Windows Explorer, you can see unc path for folder shortcut as “Comment ”.
Help would be appreciated.
Thanks
|
|
|
|
|
I've been getting into the std lib recently.
Have just been trying out map and multimap containers, and while the code compiles I get loads of warnings such as C4786. Seems to be compaining the class name is too long. Anyone experienced this, or how best to clean up code that produces this error?
I'm doing a drill down on a database using a tree control so I want to remember a simple key to locate a node I may or may not have inserted yet?
class CNodeLookup : public map<CString, HTREEITEM>
{
public:
CNodeLookup()
{
}
virtual ~CNodeLookup()
{
}
};
Thanks in advance,
Giles
|
|
|
|
|
It's a known issue with VC, you just pragma the warning and it will go away ( it's not actually a problem )
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I have a Warnings.h which I use to tell VC++ to STFU
example:
#pragma warning(disable:4786) // identifier was truncated to '255' characters in the browser information
Todd Smith
|
|
|
|
|
Thanks guys, thought it was my sloppy coding .
Giles
|
|
|
|
|
if you want to get real good error messages while stl - coding go for the "stl - message - decryptor" from BD Soft
it handles all these warnings and makes the stl - related error messages much more readable..
(the article is posted on codeproject too)
the installation of this tool was a little bit a pain in the behind.. but now i think it is worth it.. i like it and would never code stl without it again..
hope this could help a little bit
bernhard
Sometimes I think the surest sign for intelligent life elsewhere in
the universe is that none of them ever tried to contact us.
|
|
|
|
|
Hey!
Let's say through the ClassWizard I have a variable
attached to a CEdit control. When I type a small
number (like 0.00000001), the number changes to
"1e-008" automatically, which isn't what I want.
How do I go about changing this default behavior?
Steve The Plant
|
|
|
|
|
Sounds like you bound a data variable (like a double, or float) instead of a control class (like CEdit), and letting MFC do the value-to-text & text-to-value conversions for you.
Bind a CEdit to the edit control, and handle the display/conversion yourself.
Or, you could write your own DDX routine to format the value as you like. Look up "TN026" in MSDN for more information.
Peace!
-=- James.
|
|
|
|
|
Here's the scenerio
I have created a app using appwiz(VC++6) and have selected the doc/view arch. Now what i'd like to have is custom app wide properties in the CMainFrame class which are modified via dialogs. The dialog is constructed as a member of CMainFrame. I can transfer data from the dialog to CMainFrame no probs, but how can i do the same for my custom CView class. CView has it's own custom members used for drawing, but part of the drawing process requires info stored in CMainFrame. You swap data between CView and CDocumnet with the GetDocument() is there anyway to get the data(custom member) from CMainFrame. I managed to used globals, but doesn't this defeat the purpose OOP? I would like a more OOD<smiles> To do this would i have to construct CView and CDocument in CMainFrame rather than settle for the appwiz default of dynamic creation using CDocTemplate() and such...?
pardon my lack of clarity
TIA
Alex deltabravo@mb.sympatico.ca
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
You can do this in your CView derived class.
((CMainFrame*)AfxGetMainWnd())->m_yourCustomMemberVariable;
HTH
Jignesh
|
|
|
|
|
I tried the folowing, however got a compile error
'variable' is not a member of 'CWnd'
Doesn't the following return a pointer to generic CFrameWnd rather than derived?
Any suggestion...?
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
Did you try (CMainFrame*)AfxGetMainWnd()->variable; ?
Jignesh
|
|
|
|
|
I used a cast, included the header but still came up with m_Variable is not a member of CWnd.
I even tried instantiating a new CMainFrame obj(however could do it, cuz CMainFrame has protected constructor) but then it would be a differ instance right...? which would mean incorrect data.
Is is even possible to use a object that isn't constructed as a data member from that class...? If that even makes sense...<smiles>
I can use AfxGetMainWnd() but only to call CMainFrame's native functions like resize, but the methods and members i've added in my custom class don't appear in the auto-popup...
Being that the CView,CDocument and CFrameWnd object are created dynamically at runtime via the AddDocTemplate funtion in derived app InitInstance() is there any way i can get hold of pointer to any of these objects using RTTI..?
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
I think you'll just need an extra set of brackets...
int viMySetting = ((CMainFrame *)AfxGetMainWnd())->m_iMySetting;
Hope this helps.
------------------------
Derek Waters
derek@lj-oz.com
|
|
|
|
|
Try'd it and i finally got passed the compiler warning and had the popup assitance window show my custom members...
That worked so hopefully will the final result...haven't tested that yet...to excited, but soon
Thanx alot
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
Does anybody know how to get the number of arguments from a variable length function parameter list? I can't seem to find any documentation anywhere about how to get then number or arguments, without the number of args being a parameter itself.
|
|
|
|
|
You can't. The number (and type) of arguments has to be deduced from one of the non-variable arguments supplied, like, for instance, printf does with its first format argument.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Actually, you can.
int CountArgs(char* unused, ...)
{
int count = 0;
va_list args;
va_start(args, unused);
for (char* cp = va_arg(args, char*); cp; cp = va_arg(args, char*))
{
count++;
}
va_end(args);
return count;
}
int main()
{
int numArgs = CountArgs("blah", "1", "2", "3", "4");
return 0;
}
You could also use the first variable to indicate how many variables you are passing in.
CountArgs(int numArgs, ...);
Todd Smith
|
|
|
|
|
That the will NOT work reliably. If you look at the code generated, there isn't a NULL pushed onto the stack. Thus, just by luck does this work when it does.
19: int main()
20: {
004010B0 push ebp
004010B1 mov ebp,esp
004010B3 sub esp,44h
004010B6 push ebx
004010B7 push esi
004010B8 push edi
004010B9 lea edi,[ebp-44h]
004010BC mov ecx,11h
004010C1 mov eax,0CCCCCCCCh
004010C6 rep stos dword ptr [edi]
21: int numArgs = CountArgs("blah", "1", "2", "3", "4");
004010C8 push offset string "4" (00422030)
004010CD push offset string "3" (0042202c)
004010D2 push offset string "2" (00422028)
004010D7 push offset string "1" (00422024)
004010DC push offset string "blah" (0042201c)
004010E1 call @ILT+5(CountArgs) (0040100a)
004010E6 add esp,14h
004010E9 mov dword ptr [ebp-4],eax
22: return 0;
004010EC xor eax,eax
23: }
004010EE pop edi
004010EF pop esi
004010F0 pop ebx
004010F1 add esp,44h
004010F4 cmp ebp,esp
004010F6 call __chkesp (00401120)
004010FB mov esp,ebp
004010FD pop ebp
004010FE ret
Specifically in this case, the only reason this works is because EDI was 0.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|