|
hey tell me,
we both know together, don't we ?
oh, and for those who missed This one[^], fire is opened guyz
|
|
|
|
|
|
|
WhiteSky wrote: What was your question?
don't even ask !
|
|
|
|
|
Software_Specialist wrote:
WTF......lol
who the helll you are!
|
|
|
|
|
|
|
Hi there!
We've got a real big problem, allthough it seems to be not really difficult:
Our main application is a dialog which definitely MUST remain a dialog.
My colleague wants to create a SDI window from this dialog by clicking on a specific button.
Still no problem.
The problem ist, that the window seems not to get the windows messages:
Usually if you create a method to handle a mouseclick on a button in the toolbar, you can also create a function
OnUpdateClickXXX(CCmdUI* pCmdUI)
for example you could gray a specific button, if ButtonXXX is being clicked on.
But OnUpdateClickXXX is never called!
For me it seems, that the WM_PAINT message is being processed just by the dialog.
the SDI window is created with
CSingleDocTemplate* pDocTemplate;<br />
pDocTemplate = new CSingleDocTemplate(<br />
IDR_MAINFRAME,<br />
RUNTIME_CLASS(CSDI_LeerDoc),<br />
RUNTIME_CLASS(CMainFrame), <br />
RUNTIME_CLASS(CSDI_LeerView));<br />
AfxGetApp()->AddDocTemplate(pDocTemplate);
when you click on a button in the dialog.
All OnClickBlah, OnUpdateBlah... methods are inserted by the class wizard, and the AFX_MESSAGE_MAP
has the correct ON_COMMAND, ON_UPDATE_COMMAND...entries
Could you give us some hints, where we could look for that problem?
Sure, the problem is caused by the dialog "standing" between the application and the doc/view.
Thank you all, and i hope you can help us with our problem.
Sascha Billian
Sascha Billian
|
|
|
|
|
Huh?
Does the "SDI window" ever show? You haven't shown any code that creates a window.
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Yes, the window appears.
I haven't the code here, because i'm at home, but the window shows as it should.
but there's one thing i forgot to tell you.
The problem problem occured, when we tried to gray out a button in the toolbar by clicking on another toolbar button. It didn't gray out.
BUT:
in the menu bar, if i try the same with the menu items which are linked with the buttons (same id), one item is grayed out when clicking the other:
this is the code which is used to create the doc/view and show the window:
CSingleDocTemplate* pDocTemplate;<br />
pDocTemplate = new CSingleDocTemplate(<br />
IDR_MAINFRAME,<br />
RUNTIME_CLASS(CSDI_LeerDoc),<br />
RUNTIME_CLASS(CMainFrame), <br />
RUNTIME_CLASS(CSDI_LeerView));<br />
AddDocTemplate(pDocTemplate);<br />
<br />
CCommandLineInfo cmdInfo;<br />
ParseCommandLine(cmdInfo);<br />
<br />
if (!ProcessShellCommand(cmdInfo))<br />
return FALSE;<br />
<br />
m_pMainWnd->ShowWindow(SW_SHOW);<br />
m_pMainWnd->UpdateWindow();<br />
...
thanks!
Sascha
|
|
|
|
|
I'm lost. Is the probem with disalng a button or with window creation?
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
sascha.billian wrote: Sure, the problem is caused by the dialog "standing" between the application and the doc/view.
And you "know" this because you developed the document/frame/view classes in a normal SDI application where it all works as expected but when you share the source code files into your dialog based application it behaves differently... correct?
led mike
|
|
|
|
|
correct.
any clues?
thanks
Sascha
|
|
|
|
|
sascha.billian wrote: any clues?
My guess would be that the command routing is not initialized. Put Spy++ on your dialog and then envoke an action in your frame window and see if it shows up in the dialog messages. If it does you might be able to override OnCmdMsg in the dialog and forward the message to the frame window.
led mike
|
|
|
|
|
Hi Mike,
That sounds like a good idea.
As soon as my colleague is at the office we'll try that.
Thanks so far.
Sascha
|
|
|
|
|
I'm currently using 'fgets' to read a file like the sample below, and need to do some processing on it.....My first question is, is there a way for me to read the X,Y & Z data and store them into a multi-dimensional array? Secondly, the number of entries for the X,Y & Z data can vary from one file to another, so if an array is to be used, it has to be able to be sized dynamically.
using C++, Visual Studio 6.0
Any help would be greatly apperciated, thanks:
Sample File Data:
Name: Test
Date: mm/dd/yyyy
X Y Z
404.72 1064.42 60
402.224 1064.58 60
399.728 1064.75 60
Description: This is a test
//---------------------------------------------------------------------------------------------------------
Here is the code I have so far:
CFile importFile;
importFile.Open(fullName, CFile::modeRead);
CArchive ar (&importFile, CArchive::load);
if(!ar.ReadString(strLine))
{
importFile.Close();
return;
}
do // Repeat while there are lines in the file left to process
{
if( strLine.GetLength() == 0)
{ continue;
}
CString strText = strLine;
if(strText.GetLength() != 0)
MessageBox(strText,NULL,NULL);
}while(ar.ReadString(strLine));
|
|
|
|
|
arunkk1 wrote: I'm currently using 'fgets' to read a file like the sample below...
Check again. You are using ReadString() to read from the file.
arunkk1 wrote: is there a way for me to read the X,Y & Z data and store them into a multi-dimensional array?
Yes.
arunkk1 wrote: Secondly, the number of entries for the X,Y & Z data can vary from one file to another, so if an array is to be used, it has to be able to be sized dynamically.
MFC, as well as the STL, have several provisions for this.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Correct, I was using fgets.....using ReadString now.
Could you please tell me how or point me to an example on how to read the data into a multi-dimensional array?
Thanks
|
|
|
|
|
arunkk1 wrote: Could you please tell me how or point me to an example on how to read the data into a multi-dimensional array?
How many numbers are on each line of the file? If it's a fixed number, just spilt strLine using AfxExtractSubString() . Now add those three numbers to an array like you would any other.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I've got some project I need to compile under VS2005. But I've run into this problem:
error C2664: 'CGeneralAbstract::ParsePath' : cannot convert parameter 5 from 'char **' to 'const char *&'
The call code looks like this:
char *secondPart;<br />
General->ParsePath(parent, path, pathType, pathIsDir, secondPart)
The declaration looks like this:
virtual BOOL WINAPI ParsePath(HWND parent, char *path, int &type, BOOL &isDir, const char *&secondPart) = 0;
Thank you for you help.
PS:I'm coming back to C++ from C#
Asdef Jaker
What part of "Thou shall not kill" don't you understand? GOD
|
|
|
|
|
Asdef Jaker wrote: char *secondPart;
General->ParsePath(parent, path, pathType, pathIsDir, secondPart)
Are you sure, its not ,
char *secondPart;
General->ParsePath(parent, path, pathType, pathIsDir, &secondPart)
|
|
|
|
|
Thank you for the idea, but it doesn't work.
Using your code the error is:
error C2664: 'CGeneralAbstract::ParsePath' : cannot convert parameter 5 from 'char **' to 'const char *&'
Asdef Jaker
What part of "Thou shall not kill" don't you understand? GOD
|
|
|
|
|
Asdef Jaker wrote: Thank you for the idea, but it doesn't work.
I asked you the question , whether you have passed pointer to pointer, instead of pointer? Because, error suggests so.
|
|
|
|
|
how about:
General->ParsePath(parent, path, pathType, pathIsDir, (const char *)secondPart)
?
|
|
|
|
|
Fix the type of secondPart so it matches the type that ParsePath() is expecting:
const char* secondPart;
|
|
|
|