|
Christian Graus wrote:
s.SetName("a") // You allowed a char, which is one character
"a" ???
Shouldn't this be 'a'???
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Yeah, but at least I spotted why he couldn't access the function....
Seriously, you're right, of course. *blush*
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Christian Graus wrote:
Yeah, but at least I spotted why he couldn't access the function....
No points for that The guy already knew that
|
|
|
|
|
Then why did he ask:
wouldnt this work... what am i forgetting... i keep getting a undeclared identities thing.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
The funny thing is that it might have worked for the guy if he casted it and he'd have used it without realizing it was a typo error
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Blast. My bad!!!
He'd have been casting the pointer address to char
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Christian Graus wrote:
Student s;
s.SetName("a") // You allowed a char, which is one character
I was thinking that.. the only problem is that the student...
Student s
i will always keep adding students.. could i make s an array?
that always changes? like:
Student s[nextname];
?
Thanks All
~SilverShalkin
|
|
|
|
|
No, you cannot do that - you can make an array of students ( or better yet, a std::vector ). That would be the point - each student knows what it's name is.
To make s an array you would put
Student [12] s;
( from memory )
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Christian Graus wrote:
Student [12] s;
why is the [12] behind s? And so i wouldnt beable to make the [12] into somthing that increases everytime you call it?
oh,... this project is a learning project... its not ment to go the easy path or anything, its ment for me to understand the class and using header. there is a couple other ways i probably could do this "me" you know, the guy that know the least on this forum...
thanks again! c-ya
~SilverShalkin
|
|
|
|
|
SilverShalkin wrote:
why is the [12] behind s? And so i wouldnt beable to make the [12] into somthing that increases everytime you call it?
Read my first STL article, on vector. That's what you need to have a dynamic array.
SilverShalkin wrote:
oh,... this project is a learning project... its not ment to go the easy path or anything, its ment for me to understand the class and using header. there is a couple other ways i probably could do this "me" you know, the guy that know the least on this forum...
I applaud you for taking this on, I'm sure you'll learn a lot from it.
Just keep the questions coming....
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
I have finally finished my program. I let some friends download it and they got some DLL errors. I was wondering how to fix this. I heard there was a certain way to build it which includes all the DLL files needed to run the program but I'm not sure. Any help would be great.
-Raffi
|
|
|
|
|
Yah, you need to compile it with statically linked librarys.
Or you could just package the DLLs with your .EXE
|
|
|
|
|
To find out what dlls your program is using you can open use the Dependency Viewer utility that ships with Visual Studio
Best regards,
Alexandru Savescu
|
|
|
|
|
If you are using MFC, you can link MFC statically. Change your project options to achieve this.
You'll also need to distribute and register any ActiveX controls you are using.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I looked through all the options and couldn't find anything about statically linking. Does it have to be done when you first create the project or am I just missing something?
-Raffi
|
|
|
|
|
Which version are you using?
VC++ 6.0?
VC++ 7.0?
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
|
Wel, I dont have 6 installed currently, so I apseaking from memory.
Take Project Options. First tab.
You'll see a combo box, that currently says "Link MFC dynamically". Change that to "Link MFC statically"
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I feel really stupid now, but thanks a lot.
-Raffi
|
|
|
|
|
Raffi wrote:
feel really stupid now, but thanks a lot
We all feel that way at times
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Hi!
I'm new at MFC and dialog programming. I was just wondering if there is any kind of main loop function in a dialog?
Thanks for your answers
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/dlgboxes_5lib.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_atl_CDialogImpl.3a3a.DialogProc.asp
-Gile
|
|
|
|
|
MFC hides the message loop from us. That's supposedly the way OOP works. But if you really want to intercept and handle messages, you can do that without too much effort
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
A regular modal dialog created with the Win32 functions contains an internal message pump. However, the MFC version of a modal dialog is still created with CreateDialog. This will allow MFC to control the message loop itself and adds the ability to have the pretranslate message handlers for the dialog.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I have created CTypedPtrArray'<CPtrArray,FileInfo*>' fileArray; //ignore ' coz i don't have it on my application. ' is only for < to show on this site.
FileInfo is a class name:
<br />
class FileInfo <br />
{<br />
public : <br />
int status;<br />
CString path;<br />
CString name;<br />
CString size;<br />
CString createdTime;<br />
CString lastWrite;<br />
CString lastAccess;<br />
CString type;<br />
};<br />
the problem is when i calling CreateFileArray() from method 1 . no problem at all. but when i call from method 2. there is a run time error. I'm calling the same way. but only calling once at the time. not calling from both of method 1 and 2.
<br />
<br />
void CSMPprojectDlg::CreateFileArray()<br />
{<br />
HTREEITEM hItem = m_TreeCtrl.GetRootItem();<br />
CreateEmptyFileArray();
CreateFileArray(hItem);<br />
}<br />
void CSMPprojectDlg::CreateEmptyFileArray()<br />
{<br />
int size = fileArray.GetSize();<br />
if(size != 0)<br />
{<br />
AfxMessageBox("hi");<br />
for (int i =0;i<size;i++)<br />
{ <br />
FileInfo* fileinfo =fileArray.GetAt(i);<br />
delete fileinfo;<br />
<br />
<br />
}<br />
}<br />
}<br />
<br />
void CSMPprojectDlg::CreateFileArray( HTREEITEM hItem)<br />
{<br />
<br />
while(hItem != NULL)<br />
{<br />
{<br />
<br />
FileInfo *fileinfo= new FileInfo();<br />
fileinfo = (FileInfo*)m_TreeCtrl.GetItemData(hItem); <br />
MessageBox(fileinfo->name);<br />
if(m_TreeCtrl.ItemHasChildren(hItem) )<br />
CreateFileArray(m_TreeCtrl.GetChildItem(hItem));<br />
if(fileinfo->status == FILE)<br />
{<br />
MessageBox(fileinfo->name);<br />
fileArray.Add(fileinfo);<br />
}<br />
}<br />
hItem = m_TreeCtrl.GetNextSiblingItem(hItem);<br />
}<br />
}
why can't i call from method 2?????
<br />
<br />
void CSMPprojectDlg::PrintChecked()<br />
{<br />
UpdateData(TRUE);<br />
<br />
HTREEITEM hItem;<br />
hItem=m_TreeCtrl.GetRootItem();<br />
<br />
if(!(IsAnyItemChecked(hItem,hItem)))<br />
MessageBox("No file is checked!!"); <br />
else<br />
{<br />
printedfileName.Empty();<br />
int respond;<br />
respond= GetLocationAndName(printedfileName);
<br />
if (!respond)<br />
{<br />
printedfileName = "j:\\BlowBackQC\\"+Company+"_"+Job+"_"+CD+"_PrintedFileList.txt";<br />
CString message = "The location and name of the file: \n\t"+printedfileName;<br />
MessageBox(message);<br />
<br />
}<br />
<br />
QC_file.open(printedfileName);
<br />
QC_file<<"\t\t\t Company Name: "<<Company<<"\n\t\t\t CD Number: "<<CD<<"\n\t\t\t Job Number: "<<Job<br />
<<"\n\t\t\t Total File: "<<File_counter<<"\n\t\t\t Total Folder: "<<Folder_counter<<endl<<setw(80)<<setfill('=')<<endl<br />
<<setfill(' ')<<endl;<br />
<br />
if(m_SortingWay == 1)<br />
QC_file<<" Date \t\t Size\t\tEsti_page_print\t\t Ext\t\t FileName\n"<<setw(80)<<setfill('=')<<endl<<setfill(' ')<<endl;<br />
else<br />
QC_file<<" Date \t\t Size\t\tEsti_page_print\t\t FileName\n"<<setw(80)<<setfill('=')<<endl<<setfill(' ')<<endl;<br />
<br />
CreateFileArray();<br />
int size = fileArray.GetSize();<br />
if(size !=0)<br />
{<br />
for(int i=0;i<size;i++)<br />
{<br />
FileInfo *fileinfo = new FileInfo();<br />
fileinfo = fileArray.GetAt(i);<br />
CString a = fileinfo->name +"\n"+ fileinfo->size;<br />
MessageBox(a);<br />
<br />
}<br />
}<br />
QC_file.close(); <br />
<br />
<br />
<br />
}<br />
printingThread =0;<br />
}<br />
}
|
|
|
|