|
Always start an MFC application with a wizard. Hand coding it is a disaster waiting to happen.
MFC apps tend to use precompiled headers. Learn to use them for now, decide later if you don't want them.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
hello friends
i m using vc++, so plz tell me function to get size of a file(text file)
bye
|
|
|
|
|
You can try the static CFile::GetStatus method and one of the status members is the file size.
Chris Meech
I am Canadian. [heard in a local bar]
Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
Looking into my crystal ball I see...GetFileSize() and GetFileSizeEx() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
And also GetFileAttributesEx , in case you need to know more about the file all in a single function call.
|
|
|
|
|
Blake Miller wrote:
And also GetFileAttributesEx, in case you need to know...
Yes, I'm aware of it. Thanks.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
After many years away from MFC, I need to develop a simple ActiveX control whose primary purpose is to act as a container for other ActiveX controls.
In the days of VC++ 6, the Class Wizard, bad as it was, provided an automated way to add properties, methods and events to a control by automatically generating the needed .odl and other changes. I find no such capability in the VC++ 7.0 IDE. I dimly remember enough Ole to manually edit the files, but this seems like an incredible hardship for what should be a simple task.
What am I missing? An ActiveX tutorial for VC++ 7.0 would be fantastic. The old favorite "Circ" has not been updated to be of much value in Visual Studio .Net.
A pointer to a usable reference on the standard messages and maps would also be extremely helpful.
I am in desperate straights because I bid this job stupidly assuming that MFC had kept pace with C#. Any help would be greatly appreciated.
Regards,
David Hamilton
|
|
|
|
|
|
Nemanja,
Thank you. It almost had to be simple. I have found that almost everything in software development is easy once you know the "secret." Finding Microsoft "secrets" is often nearly impossible.
I have had the good fortune of helping others over the course of my career, and it gives me a lasting good feeling. I hope you enjoy that feeling now.
Regards,
David Hamilton
|
|
|
|
|
I know its possible with VB but is it possible with C++?
Have a part in the program where it allows the user to write what he wants in a text and itll implement it into the program?
Not like a configuration where you allow the user to write name/password so forth... But a full blown C++ code written in a text file that the program reads and uses it at the certain point of the program...
Say; Having a Client/Server program (a bot), and having the user write all the commands in C++ he wants in a text, allowing him to delete some, and add some commands... How would this be allowed?
/* Just a Human Trying to Live in a Computers World. */
|
|
|
|
|
NewbieStats wrote:
Have a part in the program where it allows the user to write what he wants in a text and itll implement it into the program?
you'd either have to include a C++ compiler and linker or use a C++ interpreter like CINT[^].
then you'll have to set up an interface so that your program and the external code can communicate. that could be difficult (or easy), depending on what you want these external code chunks to do. if it's compiled code, you're probably looking at a very tough bit of work. interpreted code is probably easier, since it'll be 'running' inside your EXE.
but, if you're asking your users to write C++ in order to use your program, you might as well ask them to go all the way and simply build DLLs which implement certain interfaces that your program can use via LoadLibrary - plugins, in other words.
Image Toolkits | Image Processing | Cleek
|
|
|
|
|
C++ is compiled, not interpreted...
I don't think this is possible to do, unless (as it has been said) you add a compiler
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi everyone:->. I need to pass some arguments to a worker thread function (VC++), but i don't know how to do that ... the MSDN says : UINT MyControllingFunction( LPVOID pParam ), but I need to pass to MyControllingFunction other parameters too. If anyone can help, please do it.
|
|
|
|
|
The LPVOID pParam should be set to point to a structure that contains all of the parameters that you wish to pass. Is this what you need?
Chris Meech
I am Canadian. [heard in a local bar]
Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
I demonstrate by passing your Class pointer to your Worker thread .
Let your class be CMyClass and Worker thread function something like this
[vccode]
UINT <code>MyControllingFunction</code>( LPVOID pParam );
void CMyClass::StartThread();
{
AfxBeginThread(&<code>MyControllingFunction</code>,(LPVOID)<code>this</code>);
}
UINT MyControllingFunction( LPVOID pParam )
{
CMyClass *<code>pMainClass</code>=(CMyClass*)<code>pParam</code>;
return 0;
}
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
Hello all. I have a button that loads a file dialog, CFileDialog. I'm trying that the user enters a PATH name rather than a FILE name. However, the CFileDialog only allows me to enter file names. ¿What do I have to do?
Here's what I'm doing, rather simple.
<br />
CFileDialog wndDialog(<br />
TRUE,<br />
NULL,<br />
NULL,<br />
OFN_PATHMUSTEXIST | OFN_HIDEREADONLY,<br />
NULL,<br />
this<br />
);<br />
wndDialog.DoModal();<br />
<br />
m_strDestPath = wndDialog.GetPathName();<br />
SetDlgItemText(IDC_NEWTRAN_DESTPATH, m_strDestPath);<br />
<br />
Regards,
K.K.
Only the good dies young...
|
|
|
|
|
|
|
I am tring to use the ToolTips with this tool and would like a multi-line tool tip. You Set the Tooltip with a String and I am trying to embed \r\n and such in the CString to create a larger Text Box of area for the ToolTip. My goal is that a person would not have to go to a next screen to see all the data but get an idea of what is there from a current screen. Any help
thank you
Kyle
|
|
|
|
|
Bit of a Newbie to this so bare with me...
In my Visual C++ 6 Project, I have a Form View whereby I wish to create another button dependant on results from a Database. In the OnInitialUpdate() of the form I am trying to use the Create Function - but can only generate a debug assertion Failure. Is have used this line of code:
m_Button.Create("My button", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
CRect(10,10,100,30), this, 1);
Am I doing anything obviously wrong?
Any help would be appreciated...
|
|
|
|
|
Place code like that in OnInitDialog.
Don't try it, just do it!
|
|
|
|
|
Thanks - that works a treat. Next question though, how can I create an OnClick Event Handler for this button that will distinguish between the different Buttons I have created from the original Button object?
|
|
|
|
|
blinkered wrote:
m_Button.Create("My button", WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
CRect(10,10,100,30), this, 1);
it working fine here in my test project,what ASSERTION notice are you getting.Second put a valid ID of button instead of Putting ID=1
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
I have an mFC dll into which I want to use mysql. So in the projrct settings c++ tab in project options i put:
"C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include" /
but the compiler says:
Command line warning D4002 : ignoring unknown option '/'<br />
Command line warning D4024 : unrecognized source file type 'C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include', object file assumed<br />
Command line warning D4027 : source file 'C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include' ignored
Project options now look like:
/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_MBCS" /D "_USRDLL" /Fo"Release/" /Fd"Release/" /FD / "C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include" /c
used to look like the foll before i put in mysql, and it compiled fine
Thanks for helping,
sb
/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_MBCS" /D "_USRDLL" /Fo"Release/" /Fd"Release/" /FD /c
|
|
|
|
|
ns wrote:
"C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include" /
The compiler will attempt to interpret this as a parameter. Since there is no flag before the path name, it assumes it is a file that it needs to compile. The '/' by itself will be interpreted as an invalid parameter. If your intention is to add a folder to the list of folders to search for header files in, use:
/I"C:\mysql\mysql-noinstall-4.1.10-win32\mysql-4.1.10-win32\include"
or add the folder to the include folder list in the program options.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|