|
Thanks a lot, I appreciate it!
|
|
|
|
|
OK code snippet:
void CPro1WinTUSDlg::OnMainButton()
{
if(OnSearchforRadio()){
CSearchingDlg SearchingDlg;
SearchingDlg.DoModal();
}
else{ //if(OnEnterdataRadio()){
CSureToEnterDlg SureToEnterDlg;
SureToEnterDlg.DoModal();
}
}
I want my button to invoke dialog 1 if radio 1 is selected and dialog 2 if radio 2 is selected. I changed the OnEnterdataRadio() and OnSearchforRadio() functions from type to void to BOOL. Everything compiles but when the button is pressed, regardless of which radio is selected the button is invoking the Seaching dialog.
I'm a newbie at all of this, so please be gentle with the flames.
Digital Khaos
"Every problem has a solution" -unknown
|
|
|
|
|
Digital Khaos wrote:
I'm a newbie at all of this, so please be gentle with the flames.
Really ?
Anyhow, I can't see what you're saying here - you've not shown us the functions that matter, OnSearchForRadio and OnEnterDataRadio, but I presume they are functions added through the Resource Editor and relate to radio buttons ? If so, you need to create an integer variable for the first radio button in your group, it will be a 0 indexed number that indicates which button is checked. You'll need to call UpdateData() first.
My advice may be totally wrong based on the absence of enough info, so if it doesn't seem right, just post the rest of the code and I'll try again....
BTW BOOL is a typedef'd int, created for C programmers ( C does not have type bool ). Use bool if that's what you want, or int if you want an int.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I am assuming that CPro1WinTUSDlg is a dialog with a button and some radio buttons on it. You're expecting the user to pick one of the radio buttons, then click the normal button. And you want to launch one of two dialogs, depending on which radio button is selected.
Although without you posting more code, I can't be sure, it looks like you're calling message handler functions ( OnSearchforRadio() and OnEnterdataRadio() ). This is a big no-no. Those functions should be called only by the framework, when it receives a particular message.
There are at least a million ways to achieve this, but here is one that is both easy and good. Not necessarily the best though.
void CPro1WinTUSDlg::OnMainButton()
{
CButton *p_Radio1 = (CButton *) GetDlgItem(IDC_RADIO1);
if (p_Radio1->GetCheck()) {
CSearchingDlg SearchingDlg;
SearchingDlg.DoModal();
} else {
CSureToEnterDlg SureToEnterDlg;
SureToEnterDlg.DoModal();
}
}
That should do the job for you.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
I'm writing an add-in for VS.NET, but I think this is really a COM question - I'm quite a novice with COM.
I've started from the ToolWindow add-in sample. It is implemented as an add-in that hosts an ActiveX control. The add-in retrieves a pointer to the DTE object, like this:
pApplication->QueryInterface(__uuidof(EnvDTE::_DTE), (LPVOID*)&m_pDTE);
But how do I get that pointer in the control? I guess I want to pass that pointer from the add-in to the control, but I don't know how to do this.
I guess I could export a function from the control's DLL and pass the pointer to that, but that doesn't seem appropriate in a COM object.
Thanks,
Tom.
|
|
|
|
|
Can any one save me from tearing my hair out?
I'm trying to write a copy constructor for a templatized class, but I'm kind of new to both copy constructors /and/ template classes, so it's not going too well.
When I try my app with the following copy constructor:
<bold>
template <class TYPE>
C4DList<TYPE>::C4DList( const C4DList &rValue )
{
Element *pCurrElement;
pCurrElement = rValue.m_pHead;
while( pCurrElement )
{
AddTail( pCurrElement->pData );
pCurrElement = pCurrElement->next;
}
}
Visual C++ (6.0sp5) refuses to insert a breakpoint anywhere in the code, and when I execute
<bold>
CImageProcessing::GetBlobList( C4DList<CImageProcessing::Blob> *pBlobList )
{
ASSERT( pBlobList );
*pBlobList = m_BlobList;
}
and try to step into the assignment (which I think should call the copy-constructor) VC won't let me step in.
I have a feeling I've either got completely the wrong end of the stick, or I've made an elementary mistake, but I can't figure it out for the life of me. And I have been RTFMing as much as I can!
TIA,
Pete
|
|
|
|
|
moredip wrote:
*pBlobList = m_BlobList;
That calls operator=, not the copy constructor. It sounds like VC is optimizing out the copy constructor since it is never called, that would explain why you can't set breakpoints in it. (And yes, that can happen in Debug builds, I've seen it happen myself.)
--Mike--
My really out-of-date homepage
"Not our fault we are intellectually superior to the rest of the office." -- Paul Watson in the Lounge, 12/12/2001
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
Hi mike,
Thanks for your help, you were right on the money! I wrote a little TestCopy( C4DList<blob> test ) function, and this /did/ use the copy constructor and therefore VC allowed me the honour of placing breakpoints etc. I wonder if MS view the 'optimising debug build' as a bug or a feature?
now I just have to learn about operator=...
Thanks again,
Pete
|
|
|
|
|
I am porting some code from C++ 1.5 to 6.0. The
combox would let me drop down other combo boxes
when one box was asked to be dropped. The new
version does not let this happen. In the message handler
ON_CDN_DROPDOWN, I would call "ShowDropDown" for
the other ComboBoxed. If I do this now, the requested
box will drop then after making the call to "ShowDropDown",
the request box will close. The new box will drop and then
immediately close, too.
Any insight would be appreciated.
Eldon Zacek
Czech-Mate Enterprises, LLC
|
|
|
|
|
This is a little off topic, but I can't think of a better group of people to ask this question.
I've recently been evaluating a debugging suite of products from Mutek. The principle product of interest is called Bug Trapper.
It attaches to one or more processes and captures all the activity (can be filtered). Then you can play it back in a session similar to live debugging, except you can look at anything as of anytime.
A couple of key features are that you can attach to any running process, it does not have to be compiled in debug mode, just need a pdb. It identifies the thread that is executing each piece of code and can be played back in time sequence or on a thread by thread basis. (Helps my multithreaded service debugging immensely).
1. Has anyone had experience with this product?
2. How did you use it? (what types of apps)
3. Was it worth it (its not clear yet what this will cost, but it aint cheap!)
4. Are there other similar/better products out there?
5. Any other comments?
As always, thanks for any help I get with this.
As always, thanks for any help I get with this,
Bill
|
|
|
|
|
In WinXP many new programs have very cool checkboxes (with an hoover effect), buttons & controls...
I woluld like to know how to use these new controls... I think that some stiles should exist.... someone has any idea about that?
|
|
|
|
|
To get the whole XP look in your programs ( the buttons, menus, toolbars, etc. ), you need something like the Xtreme Toolkit ( www.codejock.com ), which gives you those styles as well as wizartds to create GUIs such as Outlook and Visual Studio.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Are you developing for Win XP or another operating system.
If you are using XP you can use this article:
http://www.codeproject.com/useritems/xptheme.asp
-Matt Newman
-Politically Correct Sensoring Service
-We make sure you don't f*** up in public
-Sonork ID: 100.11179:BestSnowman
|
|
|
|
|
Are you asking how to get your app to be themed when run on XP, or how to use XP-looking controls on other OSes? If the former, you need to insert a manifest into your resources so XP will draw your controls with themes. MSDN has info on doing this.
--Mike--
My really out-of-date homepage
"Not our fault we are intellectually superior to the rest of the office." -- Paul Watson in the Lounge, 12/12/2001
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
We are in trouble, can anyone help. We are trying to locate software
First Impression Visual Component V5.x or later
We have lost our CD, lost our serial number, need to support a project with the design time license which we cannot access.
We are willing to purchase this software from you if you have it.
Please check!!! thanks so much for reading.
|
|
|
|
|
I really doubt it. But is anyone aware of the existance of an object timeline control similar to Flash and Director ?
ThaNks !
|
|
|
|
|
template
< class T >
class CVTView : public CView
{
protected: // create from serialization only
CVTView();
DECLARE_DYNCREATE(CVTView)
//Blah blah blah
private:
std::list< T* > m_TPtrList;
};
This creates a ruckus with the
IMPLEMENT_DYNCREATE
and MESSAGE_MAP macros,
not to mention that ClassWizard runs amok. So
its back to the typing wizard, expanding all the
macros and typing in the entries into the message
map. (I havent got it working yet)
Is there a more elegant way to handle this?
Are future version of MFC going to be more
sophisticated to handle cases like this?
Satheesh
|
|
|
|
|
Hi, i need to read data from an ascii file ,
but from some reason there is a conflict in my programm with the lib files and i can't use the fscanf .
is there any other way to read from the file( in Ascii )???
* i am using an MFC application.
Thankyou
|
|
|
|
|
If you are using MFC, take a look at CStdioFile class. You can use its member ReadString to read a line of text into CString, and than you can parse the information you want from here.
I vote pro drink
|
|
|
|
|
meirav wrote:
from some reason there is a conflict in my programm with the lib files and i can't use the fscanf
This seems to be indicative of a larger problem. fscanf() is present in msvcrtl.dll and should be available for use. However, if you don't want to use it because you're not doing standard C file I/O, you could use MFC's file read functions and sscanf() to parse the data.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
In MFC you have the CStdioFile or the CFile Classes...
Best Regrards....
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
How can i create a modeless dialog that cant be closed. I am using it as a compulsary advertisment window and currently all my attemts at making it non-closable have failed.
I would apreciate any help u can give!
|
|
|
|
|
if its modeless and purely win32 without MFC (allthough u could do the same if its MFC) try putting something like this in the WM_CLOSE handler:
WinExec("myapp.exe");
in which myapp.exe is the current application. This way it'll just restart everytime it is shut down.
or if you really want the user not to be able to close it you could just disable their system keys, mwehe, but thats pretty gwiffy, i dont think they'd like that. U can use the following code for this:
PUINT fuiState;
SystemParametersInfo(97, TRUE, fuiState, 0);
that'll disable ctrl-alt-del and other system keys.
Kuniva
Want, take, have.
(oh btw, best way of learning some language is by looking at examples, start large!) :p
|
|
|
|
|
Write do-nothing handlers for WM_CLOSE and WM_SYSCOMMAND (SC_CLOSE).
A somewhat more annoying thing to do is to hide the dialog when the user tries to close it, create an n-second timer, then show the window (and kill the timer) when the timer fires.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
if you use this method you can still close the dialog with the task manager, but if thats all you want then this is advisable yea, dont use my method it'll freak 'em out lol
Kuniva
Want, take, have.
(oh btw, best way of learning some language is by looking at examples, start large!) :p
|
|
|
|