|
Hey all,
I've got to create 5 similar dialogs for a new app I'm writing. All 5 dialogs have the same 3 controls on them (a couple of CStatics and a CEdit control) in addition to a few controls that will be unique for each of the 5 dialogs.
Is there any way to accomplish the following?
- Create a base dialog (CBaseDialog), derive it from CDialog, add those 3 common controls to it.
- Use that new CBaseDialog class as the base class for my 5 similar dialogs so that I don't have to copy/paste the 3 controls onto each of the 5 dialogs?
I'm thinking that since the controls are created from the resource file, I might run into a problem with something like that...
Thanks.
-Mike
-Mike Zinni
"Don't take life too seriously, you'll never make it out alive"
- Van Wilder
|
|
|
|
|
Why not just host a modeless dialog box inside your main CBaseDialog?
<br />
CBaseDialog _base ;<br />
CCustomDialog _custom ;<br />
_base.SetChild( &_custom ) ;<br />
<br />
_base.DoModal() ;<br />
...
<br />
BOOL CBaseDialog::OnInitDialog() <br />
{<br />
BOOL bReturn = TRUE ;<br />
CDialog::OnInitDialog();<br />
m_pDialog->Create( this ) ;
<br />
CRect rFrame ; <br />
CWnd * pFrame = GetDlgItem(IDC_STATIC_FRAME) ; <br />
pFrame->GetWindowRect( rFrame ) ;<br />
ScreenToClient( rFrame ) ;<br />
m_pDialog->MoveWindow(rFrame, FALSE) ;<br />
<br />
return bReturn ;<br />
}<br />
There is more to do such as chaining the child's DoDataExchange() in the CBaseDialog::DoDataExchange() and maintaining the dialog position in OnMouseMove() but that is a fairly trivial.
|
|
|
|
|
Yes, it is possible. Just make sure the common controls all have the same IDs.
http://www.codeproject.com/dialog/dialogsubclass.asp[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
I have problems about building the projects that include directx libraries, headers or components...
I installed directx 9 sdk but nearly allof the projects on directx give fatal errors..
like "incorrupt file" or linking errors or macros are not defined etc.
what must i do????
exela
|
|
|
|
|
hello to everyone im a studet in tijuana mexico im having problems in school we needed to present a program that will manipulate hardware in my case i did an led display in turboc the problem is that our teacher wants that our program will manage threads or work with threads i dont have any experience with threads any informaton tutorials source code or wahtever will be much apreciated it is urgent for me
Thank you everyone who took the time to read this rookie's problem
|
|
|
|
|
if you talking about old Turbo C , I am very sorry there is no support for multithreading in Dos based application.
but you can simulate that by using GetVert() and SetVert() function,see detail for them in your local turbo C documentation.
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi,
Can anybody help me with the following?
I have a text file with some text. The text on each line is separated by a comma. The length of the text on each line varies. I have to store this information somehow.
I intended to create a 2D array but the size of an array has to be fixed, so that wouldn't accomodate the case where I am reading text from a large file.
It was suggested that I use a vector, but I have no idea how to work with them.
Can somebody help me out with how to create a vector that acts like a 2D array. Also how can I resize the vector? Where can I find an API that shows what methods can be used?
Hope this isn't asking too much.
Thanks very much,
dlarkin77
|
|
|
|
|
Hi Dlarkin!
there Is predefined VECTOR Class in STL under std namespace.
Search for Vector in you local copy of MSDN
or Here is Small tutorial to use that.
#include <vector>
#include <iostream.h>
std::vector<int> i;
void main()
{
i.push_back(20);
i.push_back(30);
i.push_back(40);
std::vector<int>::iterator it;
for(int j=0,it=i.begin();it!=i.end();it++,j++)
cout<<j<" Element in vector is " <<*i<<endl;
}
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
If just need to read the file and process its contents then I suggest having a look at memory mapped files. This will let you treat the file as one big string. Very fast to.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Dear Sir,
Problem Description – Unable to capture audio from USB Audio Device when the format is set to MuLaw.
Scenario – We developed USB Audio Device that produces Audio in MuLaw Format. The USB descriptors are correctly set to indicate that the Audio format. Please see the attached file showing the descriptors.
Description – We want to capture Audio in MuLaw format. Windows DDK documentation states that it supports all “All Type I formats” (MuLaw being one of them). Refer to http://www.microsoft.com/whdc/device/audio/usbaud.mspx (document name - USB_Audio_and_Windows.doc). Also refer to the same information in Windows DDK documentation at mk:@MSITStore:C:\WINDDK\2600\help\stream.chm::/hh/ddkslm/stream/aud-design_8gmr.htm.
When we connect the Audio device Windows recognizes it properly as an Audio device and shows it in the Control Panel. When we check the Audio formats using both GraphEdit (DirectX 9.0) and Adobe Audition, it shows as “None”. As a result we are unable to capture Audio from the device.
Additional Info – When we change the USB Audio Device properties (by changing the descriptors) to PCM8 the device works without any problem.
|
|
|
|
|
Dear Sir,
i am also working on USB(newbie here.....)
i have a doubt?
i want to use windows usb driver,but how do i direct the midi data to this??
i a have directed the midi data to the default windows sw synth,what r the commandz that r reqired to set this to the already existing windows midi usb driver???/
please help me out!!!!!
|
|
|
|
|
Ms VC++ .Net 2003 tells me this just out of nothing for (some) breakpoints, at some build, however it worked totally correct at the last build. Someone recommended me deleting build folder, done that, deleting project.suo, done that, debug and non-incremental RE-build, done, turning all optimalisation options OFF, done.
Then what the hell causes this stupid error or whatever?
|
|
|
|
|
There is a lot of examples of using ActiveX components in MFC applications, but I didn't found any code which shows, how to use ActiveX in no-MFC apps.
I don't know MFC, but I often need to include ActiveX (like Web view) into my projects. Is there a way to do it, or I need to learn MFC?
|
|
|
|
|
Please,
How create a Printer Port Monitor??
I need to create this.
Please help me!!!
raf-sp
|
|
|
|
|
|
Thank´s but,
I don´t found this FAQ "How can I determine the status of the printer programmatically?" here.
"now rest you have to make loop which check printer at regular interval". Please, you have some example??
Thank you!!
|
|
|
|
|
hey guys,im a degree student in networking,recently im doing my project about the packet analyzer,but i face a problem in retrieving the RIP (routing information protocol) header information, for example: command,version,etc. i had read through the RFC 1058 & RFC 2453,but i still dont have any idea, is there anyone can help? pls,10q so much.
p.s. i dont know how to use C++ to retrieve the information, is there any sample source code or advice?
|
|
|
|
|
I don't have a direct answer for your question, but I think the reference on the topic is "TCP/IP Illustrated, Volume 1+2". Volume 2 holds a lot of implementation details of the NetBSD? kernel TCP/IP stack.
/moliate
The corners of my eyes catch hasty, bloodless motion -
a mouse?
Well, certainly a peripheral of some kind.
Neil Gaiman - Cold Colours
|
|
|
|
|
I want to connect Oracle database through VC++ without using ODBC connection.
I got OCL library from http://crlab.com/ocl but its not working properly.
Can anybody provide me a sample code for this problem(Connection wiht Oracle 9i database through VC++ without ODBC connection).
|
|
|
|
|
I am begging for help on this. I had a VC6 project that I converted to .NET 2003 and when I went to add a class using the add class wizard, it gave me the following error: "MFC classes can only be added to MFC projects." Thinking that it might of been a conversion problem, I rebuilt the project file using .NET 2003. It worked and I can add classes to the project. Now, the weird thing is if I move the directory that contains the project it goes back to giving me the previous error. I am really stumped on this one. Here is a link to a zip file that contains the "working" project. (It's full path on my drive is c:\Test\TinyCad). If someone could please take a look and tell me if your getting the same thing, or if you happen to know whats going on that would be of much help. Thank you for your time and attention.
http://www.angelfire.com/electronic2/testme/TinyCad.zip
The zip file is 15MB in size.
Some side notes:
I do not have a copy of VC6 otherwise I would have tried to see if the original dsw/dsp files are suffering from the same problem.
TinyCad is a schematic capture program written by Matt Pyne.
|
|
|
|
|
I can NOT find anywhere on the internet a complete memory layout of RAM for XP.
IOW, I want someone to have gotten a memory dump and gone through and explained/showed where everything is.
JL
|
|
|
|
|
Anonymous wrote:
I want someone to have gotten a memory dump and gone through and explained/showed where everything is.
Everything like what? I'm not sure of what benefit this would be since a memory snapshot will likely differ each time Windows is started. Windows does not load a program in the same location each time. It is all governed by what might already be at that spot. Windows will try to load a program based on an address contained within the EXE/DLL itself, but if something is already loaded in that spot, Windows has to dynamically re-base the program to start at some other unoccupied location.
Having said all that, is there something specific that you are after? Maybe a better solution is possible if given a clearer description of the problem.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi!!
I would liek toknow id VC++ supports any inbuilt function call to read the amount of memory or disk free space????
This value to be displayed on the VC++ Front end being developed.
Grace Sonal
|
|
|
|
|
|
Has anyone used the Image Mastering API (IMAPI)?
I can't get the Get / Set volume name to work. Here is my code for Get Volume name
CString Volume_Name;<br />
IPropertyStorage* Properties;<br />
PROPSPEC Property_Type[1];<br />
PROPVARIANT Property_Value[1];<br />
BOOL Result;<br />
<br />
Result = m_Joliet->GetJolietProperties(&Properties);<br />
if (Result)<br />
{<br />
Property_Type[0].ulKind = PRSPEC_LPWSTR;<br />
Property_Type[0].lpwstr = ::SysAllocString(L"VolumeName"); <br />
m_Result_Code = Properties->ReadMultiple(1, Property_Type, Property_Value);<br />
Result = SUCCEEDED(m_Result_Code);<br />
Volume_Name = (CString)Property_Value[0].bstrVal;<br />
}
Everything works. The result code is success, but the volume name is always an empty string.
Similarly the set volume name function succeeds, but the volume name of the CD burned is blank.
|
|
|
|