|
Use class-wizard to generate the derived class from CDialog. Remember to select the right dialog ressource id when generating the derived class.
Gero
|
|
|
|
|
ok, I've done that, but still nothing happens when I click on the button.
What am I not doing?
|
|
|
|
|
Did you use class wizard? Did you chose the right dialog ressource id in class wizard? Which type is m_chatterChooser now?
Gero
|
|
|
|
|
I have it as CDialog. I chose the resource ID for the dialog that I just built. (Chatter chooser).
What do I have to change the type to? I put CCHooser which is the name of the class.. and I got errors.
Please bear with me, I'm new to this.
Thank you so much
|
|
|
|
|
If your derived class is named CCHooser you have to include CCHooser.h in the source file where you have declared m_chatterChooser.
#include "CCHooser.h"
Gero
|
|
|
|
|
I have six errors!
I have in my mainframe.cpp
#include "CHOOSER.h"<br />
#include "CHOOSER.cpp"
and
void CMainFrame::OnSFile() <br />
<br />
{<br />
<br />
m_chatterChooser.DoModal();}
In my mainframe.h:
CCHOOSER m_chatterChooser;
Also, the name of the class is CCHOOSER, but the fileview has chooser.cpp and chooser.h
I know this is a simple thing.. why I am having so much trouble?
|
|
|
|
|
You must not include this line!
#include "CHOOSER.cpp"
Gero
|
|
|
|
|
If this wasn't me, ikt would almost be funny!
Now I have 5 errors!
|
|
|
|
|
Just send me your project (gerogerber@gmx.de), or tell me which errors you get.
Gero
|
|
|
|
|
m_chatterChooser must be of type CChooser
|
|
|
|
|
Errors!
compiling...<br />
Mainfrm.cpp<br />
D:\Documents and Settings\Administrator\My Documents\CS61A Info\Assignment1\cs61a\CHATTER\mainfrm.h(48) : error C2146: syntax error : missing ';' before identifier 'm_chatterChooser'<br />
D:\Documents and Settings\Administrator\My Documents\CS61A Info\Assignment1\cs61a\CHATTER\mainfrm.h(48) : error C2501: 'CCHOOSER' : missing storage-class or type specifiers<br />
D:\Documents and Settings\Administrator\My Documents\CS61A Info\Assignment1\cs61a\CHATTER\mainfrm.h(48) : error C2501: 'm_chatterChooser' : missing storage-class or type specifiers<br />
D:\Documents and Settings\Administrator\My Documents\CS61A Info\Assignment1\cs61a\CHATTER\Mainfrm.cpp(162) : error C2065: 'm_chatterChooser' : undeclared identifier<br />
D:\Documents and Settings\Administrator\My Documents\CS61A Info\Assignment1\cs61a\CHATTER\Mainfrm.cpp(162) : error C2228: left of '.DoModal' must have class/struct/union type<br />
Error executing cl.exe.<br />
<br />
chatter.exe - 5 error(s), 0 warning(s)
|
|
|
|
|
Maybe a misspelling - try CChooser instead CCHOOSER. C++ is case sensitive.
Gero
|
|
|
|
|
That didn't work, same 5 errors. I know C++ is case sensitive, that's why I put it in all caps. The class is in all caps.
I'm going to delete the class and start again.. and give it a name that doesn't start with C!
Is that a good idea?
Thank you so much for your help!
|
|
|
|
|
If you want send me the code.
Gero
|
|
|
|
|
The whole project (actually it is two.. client and server) is large. Shall I send just the relevant code pasted in a document?
|
|
|
|
|
Thank you so much.
What you suggested worked!
Pett.
|
|
|
|
|
I try to help you:
Pett wrote:
D:\Documents and Settings\Administrator\My Documents\CS61A Info\Assignment1\cs61a\CHATTER\mainfrm.h(48) : error C2146: syntax error : missing ';' before identifier 'm_chatterChooser'<br />
D
Here, m_chatterChooser has an unknown datatype.
In the mainfrm.h mentioned write a line #include "chooser.h"
(next to the other #include lines). Use the name of the FILE where CChooser is declared, not the name of the class itself. (normaly these differ by a leading 'C')and a trailing '.h'
Pett wrote:
D:\Documents and Settings\Administrator\My Documents\CS61A Info\Assignment1\cs61a\CHATTER\mainfrm.h(48) : error C2501: 'CCHOOSER' : missing storage-class or type specifiers
Here is the same problem. CHOOSER is wrong spelling (case-sensitive)
Pett wrote:
D:\Documents and Settings\Administrator\My Documents\CS61A Info\Assignment1\cs61a\CHATTER\mainfrm.h(48) : error C2501: 'm_chatterChooser' : missing storage-class or type specifiers
Here, same line - related problem!
Pett wrote:
D:\Documents and Settings\Administrator\My Documents\CS61A Info\Assignment1\cs61a\CHATTER\Mainfrm.cpp(162) : error C2065: 'm_chatterChooser' : undeclared identifier
The variable m_chatterChooser is not known - you due to the errors before.
Pett wrote:
D:\Documents and Settings\Administrator\My Documents\CS61A Info\Assignment1\cs61a\CHATTER\Mainfrm.cpp(162) : error C2228: left of '.DoModal' must have class/struct/union type
Same line-same problem. You can not call a methos from an non-existing object.
Hope this helped.
If you post your errors, it is much easier to help you.
Don't give up. You WILL make it. I know how intimidating I was in the beginning when the compiler spat out hundreds of errors, just for one missing comma.
|
|
|
|
|
Thank you very very much!
|
|
|
|
|
I need to customize WebBrowser component so that i could turn off downloading images, disable script, ...
I fount this MSDN article about that (http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/hosting/wbcustomization.asp),
but I have MFC appication, i'm not familiar with COM. Does anybody know, where and how to implement interfaces like IDocHostUIHandler. Which class i have to use ? how to add into project ?
Thanx
rrrado
|
|
|
|
|
Can someone give me hint
howto create an animation
control that keeps playing
while the main program
executes some lenghty
calculations, let's say
for (int i=0; i<10000000000; i++)
sum+=i;
(i know! it's only an example!!)
I createad an animation control
the standard way (with timer)
which didn't work of course,
and one other in an extra thread,
which i excpected to work,
but it stopped also during the loop!
Didn't anyone have the same
problem yet? Putting getmessage/
translate/dispatch into the
loop is not the right solution
for me! Do i have to create
an extra process for this?
Doesn't seem so elegant!
Thank you
|
|
|
|
|
OK. I have a project (a DLL written in C) that communicates over USB from the PC to a device. It works great, but I need the ability to turn off a progress dialog that I call with the DialogBox function. In other words, I want to be able to transfer data without showing any user interface. I've thought about ways to do this...create a thread, hide the dialog, etc. The problem is, I don't know how to respond to the WM messages (specifically WM_TIMER) if I don't have the UI. I have an API call that is called by an external program, which calls a routine with the DialogBox API. The DialogBox API has a callback procedure that I can process these messages in. So how do I have this API work without a dialog? Do I have to do a PeekMessage or something? It's been a while since I've programmed in straight C for Windows.
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
I think you are out of luck. If the API requires the dialog you can just try to make the dialog invisible (calling ShowWindow(...). Then messages like WM_TIMER will still pass through while the user does not see the dialog anymore.
You can also use AttachThreadInput if you want to get into more "intimate" contact with the dialog's message processing.
I keep submitting “VB” as a Priority-1 bug, but apparently no one here knows how to fix it. Nick Hodapp, Semicolon
|
|
|
|
|
I was actually able to get it to work by calling SetTimer before I start communication. I use a callback for the timer event instead of a Windows message which gets fired every time the timer expires. I do the following when the API is called in the DLL from the user's application:
SetTimer(hWnd, IDT_TIMER1, TIMER_INTERVAL, (TIMERPROC)HiddenSendDataProc);
MSG msg;
while (GetMessage(&msg,
NULL,
NULL,
NULL)
!= 0 && GetMessage(&msg, NULL, NULL, NULL) != -1)
{
if (msg.message == WM_TIMER)
{
msg.hwnd = hWnd;
HiddenSendDataProc(hWnd, WM_TIMER, 0, 0);
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
It works!
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
How to change the background color of a static text control (IDC_STATIC ) in a dialog?
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Look up WM_CTLCOLOR on MSDN.
Michael
Life’s not a song.
Life isn’t bliss.
Life is just this.
It’s living. -- Buffy the Vampire Slayer: Once more, with feeling
|
|
|
|