|
Shouldn't the modal dialog be a child of the main app window? The parent window should be AfxGetApp()->m_pMainWnd.
onwards and upwards...
|
|
|
|
|
I am using Win32 API's.
You mean to say that instead of sending the MDI Child Window as Parent for the dialog I send the Main App Window handle as the parent.
|
|
|
|
|
Well...I tried changing the parent window but its not working.
It seems that whenever I am doing Alt+Tab, both the dialog window and the main app window loses focus and perhaps that is causing the problem.....
|
|
|
|
|
Well....the app is there if I switch between apps 1-2 times...then its GONE!!!!
|
|
|
|
|
I want to generate reports in VC++.
Can I use crystal reports in VC++. or if there is way other than this to make the reports?
|
|
|
|
|
Does anyone here know how to use the Shockwave Flash OCX in a dialog. I'm not sure which wrapper functions to use to get the thing working.
I'm using VC++ 7 with MFC. I have Macromedia Flash 5.0.44.0 installed and I can play Flash in IE6.
I want to create a dialog box that plays a Flash (.swf) file. I inserted the Shockwave Flash ActiveX (OCX) control into my dialog. VC++ added an IDispatch wrapper class, CShockwaveflash, to my project and to the dialog class. My dialog is defined like this:
class CMyDlg : public CDialog<br />
{<br />
DECLARE_DYNAMIC(CMyDlg)<br />
<br />
public:<br />
CMyDlg(CWnd* pParent = NULL);
virtual ~CMyDlg();<br />
<br />
enum { IDD = IDD_MYDIALOG };<br />
<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL OnInitDialog();<br />
<br />
DECLARE_MESSAGE_MAP()<br />
public:<br />
CShockwaveflash m_FlashCtrl;<br />
};
In my implementation....
BOOL CMyDlg::OnInitDialog()<br />
{<br />
if (CDialog::OnInitDialog())<br />
{<br />
m_FlashCtrl.put_Movie(_T("sample.swf"));<br />
m_FlashCtrl.Play();<br />
return TRUE;<br />
}<br />
return FALSE;<br />
}
When I run the dialog, the OCX shows the default background but no flash video. I can't find any documentation on using this OCX, even at Macromedia.
Any sample code that works?
thanks in advance,
Andrew
|
|
|
|
|
Hi
Give the full path of swf file ( m_FlashCtrl.put_Movie(_T("c:\sample.swf")); ) and try.
Best wishes..mil10
|
|
|
|
|
Thanks, that fixed it (with backslashes appropriately escaped, "c:\\flash\\sample.swf").
I had previously tried ".\\sample.swf" to force it to read from the current directory, but that didn't work. So perhaps the full path is always required by Flash.ocx !?
cheers!
Andrew
|
|
|
|
|
This is my first post here, so I am going to see if there is anyone out there who can help me...
I am reading (converted excel) data into a List Control in Report format. The data consists of Numbers and characters. It looks like this coming in:
--- Data in ----
15.568 Mark/ Tompson/ SALES/ NYC/ 1553.61 1382.15 14.07
15.024 Sean/ Erickson/ SALES/ BOS/ 1378.05 1266.65 13.25
14.553 Adrian/ Washington/ MGT/ KAN/ 1304.61 1162.28 10.52
13.451 Jason/ Johnston/ DIST/ SEA/ 1200.14 1034.99 09.75
I added the "/" at the end of the Chars so that I could use the command below in the code to read them in. My problem is - in my List Control window I have a "|" symbol infront of the strings i.e.
-- List Control out ---
15.568 |Mark |Tompson |SALES |NYC 1553.61 1382.15 14.07
15.024 |Sean |Erickson |SALES |BOS 1378.05 1266.65 13.25
14.553 |Adrian |Washington |MGT |KAN 1304.61 1162.28 10.52
13.451 |Jason |Johnston |DIST |SEA 1200.14 1034.99 09.75
How can I get rid of the "|"? <---This is my problem.
--- Code ---
<br />
double f1, f6, f7, f8,;
char f2[20], f3[20], f4[20], f5[20];
ifstream inf;<br />
inf.open("Testdata.txt");
<br />
int total=0;<br />
<br />
for (int i=1; i < 200; i++){
<br />
inf >> f1;
<br />
inf.getline(f2,20,'/');
inf.getline(f3,20,'/');
inf.getline(f4,20,'/');
inf.getline(f5,20,'/');
<br />
inf >> f6 >> f7 >> f8;
<br />
total = total + i;<br />
<br />
int nItem;<br />
<br />
Quality = f1;<br />
_gcvt( Quality, precision2, str_Quality );
nItem = m_List.InsertItem(0,str_Quality);
m_List.SetItemText(nItem,1,f2);
m_List.SetItemText(nItem,2,f3);
m_List.SetItemText(nItem,3,f4);
m_List.SetItemText(nItem,4,f5);
Sales = f6;<br />
_gcvt( Sales, precision2, str_Sales );<br />
m_List.SetItemText(nItem,5,str_Sales);<br />
Evaluation = f7;<br />
_gcvt( Evaluation, precision1, str_Evaluation );<br />
m_List.SetItemText(nItem,6,str_Evaluation);<br />
Performance = f8;<br />
_gcvt( Performance, precision1, str_Performance );<br />
m_List.SetItemText(nItem,7,str_Performance);<br />
m_List.SetItemData(nItem,(DWORD)new CListViewInfo(Quality,f2,f3,f4,f5,Sales,Evaluation,Performance));
<br />
}<br />
<br />
inf.close();<br />
return 0;<br />
<br />
<br />
return FALSE; <br />
}<br />
---- End Code ---
Anyone who can help me ... thank you for your time.
|
|
|
|
|
Can you give more remarks about your codes.
For example,
inf.getline(f2,20,'/');//To store characors less than 20, ending when meeting '/'
inf >> f6 >> f7 >> f8;//??????
_gcvt( Quality, precision2, str_Quality );//Converts a floating-point value to a string, which it stores in a buffer.
.....
But I can give you a suggestion, you can Step-Debug to find the errors.
|
|
|
|
|
Ok, I added some comments. If those comments are not enough, let me know and I will add more. Thank you.
I wish I could type better ...
|
|
|
|
|
GOOD news. I figured out my problem. Here is the answer incase any lost soul might need it.
There were tabs ( i.e. | ) in my tab delimited exported file from excel. So I opened the file in WordPad and then did a crtl+H (REPLACE) for all of my tabs ( | ) with a space. That fixed my problem and all is well. I hate it when things are that stupid. Oh well, live and learn.
Thanks for your help.
I wish I could type better ...
|
|
|
|
|
|
A guy I work with wants to learn C++...wants me to teach him C++ (Uh huh, yeah right.) I thought "Self there is not enough time in a day to teach someone how to grock C++." (I am not a teacher, NOPE.)
So my question is this. Has anyone written a tutorial that takes a person step-by-step through building an application? I don't mean something like, "Here is my article, download the code." I mean step-by-step this is what you are doing here and this is why you need to do it. Nothing super fancy (Don't need a 3D rendering engine.) just a good application that starts at the simple and gradually adds features and teaches as it goes. I don't need, "...this is an int and it's size in memory is..." The language basics he can learn on his own. I am looking for something that will teach him how to set up the includes, the headers, etc... (Windows Environment Only, Please)
I know I am asking for a lot but maybe someone has done such a thing. If you have run across a book that takes a similar slant let me know. I would like to get this guy what he needs and still have enough time for me to sleep (when I need to).
So does anything like this exist? Let me know. Thanks!!!
"Guys, guys FLAMING DEATH is a huge hit. I'm serious. The next day word of mouth got around. There was a line of fly's going out the tent forever. It must have been a foot long. I've figured it out. You guys burn me twice a night. I take a day off to heal and the next night we do it all over again." (The Circus Flea in A Bugs Life)
Rex Winn
|
|
|
|
|
This is what got me started in windows API programing www.winprog.org/tutorial/, but I had been using MFC for a while, and C++ for 7 years. I thought it was a pretty good tutorial. If this guy doesn't know any programming at all then maybe you should just run a search on google (keywords: C++ tutorial, MFC tutorial, Win32 Tutorial, and use your imagination). I could suggest more websites but then again I already knew C++ before I looked at them. I don't know how easy they would be for your friend.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Toni78 wrote:
If this guy doesn't know any programming at all then maybe you should just run a search on google
Oh no, he knows lots of programming. Quite good at C# and Java. That is why I wanted to avoid the basics and get right down to building a full application. The order of doing things, priorities all that stuff. He knows the syntax but doesn't have a clue how to build an application.
"Guys, guys FLAMING DEATH is a huge hit. I'm serious. The next day word of mouth got around. There was a line of fly's going out the tent forever. It must have been a foot long. I've figured it out. You guys burn me twice a night. I take a day off to heal and the next night we do it all over again." (The Circus Flea in A Bugs Life a film done by Pixar)
Rex Winn
|
|
|
|
|
So cool then! Did you take a look at the website that I gave you? If you're looking for books I have used several of them but unfortunately I don't remember their titles. I have one with me though and it is called "Teach yourself visual c++ in 21 days - Sams publishing". But the best book for a beginner in MFC(in my opinion) is a book from T. R. Nieto, Harvey M. Deitel, Paul J. Deitel, Edward T. Strassberger "Getting Started with Visual C++ 6 with an Introduction to MFC". It took me two days to read it and on the third day I was writing my very first MFC application which dealt with serial communications. It's a VERY good and simple book.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Beginning Visual C++ 6[^]
Even if you're not using VC6, it's a starting point, anyway.
Jon Sagara
A bottle a night isn't alcoholism - it's persistence!
-- A coworker, jokingly
|
|
|
|
|
hi,
is there any way i can show html in a dialog ?
i want to display html using strings (not from a file).
Any useful links or ideas ?
thanks
regards
Hari Krishnan
|
|
|
|
|
You can use the Microsoft Website Navigator control. I use it in many applications like letting the user write something in an edit box, add the html syntax and show it on the control it works fine!
Well because the control is !Microsoft! you can find extra information on MSDN!
|
|
|
|
|
|
normally, when you press F1, the VS help system pops up and searches for the word under the cursor. suddenly, my F1 key does nothing... all the other function keys work fine.
through Tools / Customize / Keyboard, i can reassign F1 to any of the other commands that are available, but i can't find one that looks like "Search in help for word under cursor". is there such a command? is there another way to reconnect F1 to the help system?
-c
CheeseWeasle
|
|
|
|
|
Go to 'Help' then select 'Keyboard Map...' that will allow you to do all the stuff you need. In the view customize to help and then sort by key 'Help'. This is what mine looks like: I think the one you need is "HelpToggleExtensionHelp" (Very Bottom)
Alternative access: Tools->Customize->Keyboard (Select All Commands) then find it in the list. I would define a custom shortcut key in the "Press New Shortcut Key" then okay out and try it by pressing newly defined shortcut key. I think that will get you back in business.
Help HelpAbout Displays the program information and copyright
Help HelpKeyboard Displays all keyboard commands
Help HelpMOWBestOfWeb Opens the Best of the Web page
Help HelpMOWDevOnly Opens the Developer products home page
Help HelpMOWFAQ Opens the Developer Studio 97 FAQ page
Help HelpMOWFeedback Opens the Developer products feedback page
Help HelpMOWFreeStuff Opens the Developer Studio 97 free stuff page
Help HelpMOWMSHome Opens the Microsoft home page
Help HelpMOWOnlineSupport Opens the Microsoft online support page
Help HelpMOWProductNews Opens the Developer Studio 97 product news page
Help HelpMOWSearchWeb Opens the search page
Help HelpMOWWebTutorial Opens the Web Tutorial page
Help HelpSystemContents Displays the table of contents for the online documentation
Help HelpSystemIndex Displays the Index to the online documentation
Help HelpSystemSearch Searches the online documentation
Help HelpTechnicalSupport Displays support information for Developer Studio
Help HelpTipOfTheDay Displays a Tip of the Day
Help HelpToggleExtensionHelp Toggles extension Help for F1 on and off
"Guys, guys FLAMING DEATH is a huge hit. I'm serious. The next day word of mouth got around. There was a line of fly's going out the tent forever. It must have been a foot long. I've figured it out. You guys burn me twice a night. I take a day off to heal and the next night we do it all over again." (The Circus Flea in A Bugs Life)
Rex Winn
|
|
|
|
|
Hi,
just wondering how do i switch between two dialog..
what i means is when i switch to another dialog i want hide the current one and vice versa..
THANKS
|
|
|
|
|
Take a look at CWnd::BringWindowToTop, CWnd::SetFocus and CWnd::ShowWindow. That's what I've been using so far.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|