|
Cpudood wrote:
inData.open("data.dat");
Use the full path to the file. Without a path, the OS looks in the current directory, whatever that happens to be, and the file evidently isn't in that directory.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
I have inlcuded the data file as a part of the project workspace. I don't know if that is the current directory or not but I wouldn't know how to specify its location in the actual project.
|
|
|
|
|
If the data file is in the same folder as the app, then use GetModuleFileName() to get the app's path, lob off the app's name, and add the data file's name.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
Cpudood wrote:
getline(cin, line1);
shouldn't that be
getline(inData, line1); if you are reading in from the file? cin is reading in from the console.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
2 things I can see:
1) Did you remap cin to your input stream somewhere in code that you didn't include? If not, your file could be open, but you aren't trying to read from it.
2) Where is your input file? if it is sitting in your project directory your code won't see it. You need to put the file in the Debug and Release directories - which is where your executable file is running from.
|
|
|
|
|
My View is CFormView-base class
please help me how to center MDIChildWnd in MDIFrameWnd
thanks
|
|
|
|
|
Hi
I am a beginner to c++. I am using visual c++ compiler.
I am required to do a project in which i have to plot graphs. 2D and 3D. ( 2D between velocity and time).
I have never plotted graphs in c++ . Can anyone please help me ?
Q. 1 How do i start plotting the graphs.
Q. 2 Does anyone know of any online tutorials ?
Q. 3 Can you please direct me to the books which can help me with graphics ?
I asked some people and did not get an encouraging response.
I was told c++ does not have plotting functionalites and i will have to use libraries.
Q. 4 Can you please tell me which library to use and where i can find it ?
Thank you in advance.
|
|
|
|
|
|
|
Hey all...
IT DOESNT LINK
I dont know what to do
I create a template class like this:
<code>
template <class type>
class MyClass
{
public:
int item1,item2;
void func
};
<code>
#include "myclass.h"
template <class type>
MyClass::MyClass()
{
ew lew dlkfjsdlv cx; <code>
}
template <class type>
void MyClass::func()
{
dwadgfre; <code>
}
link error: on the func(); and the ctor
=-=-=-=-=
The Server
|
|
|
|
|
|
great article
helped me alot
thank you
|
|
|
|
|
|
I prepared a program that can enumerate currently running processes. It's a MFC Application. I used CreateToolhelp32Snapshot, Process32First and Process32Next functions. For enumerating the process in list control I must click a button. I'd like to add any processes to the list of currently running processes when they start to run without click any button. How can I do this?
|
|
|
|
|
Are you looking for PsSetCreateProcessNotifyRoutine() ?
|
|
|
|
|
Hi everybody,
I have an SDI application with dialog, toolbar etc...
I made a button in the MainFrame toolbar who create a CFileDialog. Everything is fine but I want to remove or hide the "Up one level" and "Create new folder" buttons. There's no flag to set so I ask you if you have a good idea about that.
I read an article on a programming website who talks about that but when I do what it says in the article I've got an 0xC0000005 error.
Here's the link : http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20546488.html
Thanks a lot,
Rene
|
|
|
|
|
class COpenFileDialog : public CFileDialog
{
DECLARE_DYNAMIC(COpenFileDialog)
public:
COpenFileDialog(BOOL bOpenFileDialog,
LPCTSTR lpszDefExt = NULL,
LPCTSTR lpszFileName = NULL,
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
LPCTSTR lpszFilter = NULL,
CWnd* pParentWnd = NULL);
virtual ~COpenFileDialog();
virtual BOOL OnInitDialog();
protected:
DECLARE_MESSAGE_MAP()
};
#include "stdafx.h"
#include "OpenFileDialog.h"
IMPLEMENT_DYNAMIC(COpenFileDialog, CFileDialog)
COpenFileDialog::COpenFileDialog(BOOL bOpenFileDialog, LPCTSTR lpszDefExt, LPCTSTR lpszFileName, DWORD dwFlags, LPCTSTR lpszFilter, CWnd* pParentWnd) :
CFileDialog(bOpenFileDialog, lpszDefExt, lpszFileName, dwFlags, lpszFilter, pParentWnd)
{
}
COpenFileDialog::~COpenFileDialog()
{
}
BEGIN_MESSAGE_MAP(COpenFileDialog, CFileDialog)
END_MESSAGE_MAP()
BOOL COpenFileDialog::OnInitDialog()
{
BOOL b = CFileDialog::OnInitDialog();
DWORD dwStyle = ::GetWindowLong(m_hWnd,GWL_STYLE);
if ( dwStyle&WS_CHILD )
{
const DWORD NEW_FOLDER_ID = 0xA002;
HWND hwndtb = ::FindWindowEx(GetParent()->m_hWnd,NULL,TOOLBARCLASSNAME,NULL);
if ( hwndtb )
::SendMessage( hwndtb, TB_HIDEBUTTON, NEW_FOLDER_ID, MAKELONG(TRUE,0) );
}
return b;
}
Provided courtesy of Mark Baker.
|
|
|
|
|
How can I programmatically change the background of a toolbar icon? I want Red background color for the Inbox icon when there are new messages.
Eilzabeth
|
|
|
|
|
If you are using windows forms...
Make the icon transparent [the background of it at least]. I believe the function is MakeTransparent(Color), a member of the Image class.
Next, simply change the background of the icons container [a Panel might be a good idea].
|
|
|
|
|
I do not use Windows Forms. I am using Visual C++ 6.0. I can not find MakeTransparent().
Eilzabeth
|
|
|
|
|
...in the Dallas/Ft Worth area of Texas. It can be any type of training that deals with windows and C++ but I'm not sure where to look. After I pestered my boss about training (a rare thing where I work) he finially said "You find the training in the area and I'll send you!". So if anyone knows of any around D/FW, let me know,
Thanks,
Joe
|
|
|
|
|
Are you referring to windows programming or just Visual C++? In terms of windows programming, I highly recommend books and practice instead of "training."
Kuphryn
|
|
|
|
|
Probably windows programing, that's what I'm weakest at. Plus, work won't pay for books and practice, even if I'm doing it at work. Improving myself in order help the company is "not my job" and it has to have an immediate value-added componant to the project at hand. None of this silly long term benefit stuff! Plus, there is no "proof" I did it without a lousy piece of paper saying I did it at the end.
Besides, it would be approved time away from the building. With books, the boss (if he did approve it) would interrupt any time, just like if I have lunch at the building.
Thanks for the suggestion
Joe
|
|
|
|
|
One possible problem with "training" is that I believe it is way too short. On the other handle, learing windows programming using books and doing practices is extremely effective.
The key to learning windows programming is practice and to never give up. Good luck.
Kuphryn
|
|
|
|
|
I need to access the underlying display I/O at system level for implementing a Terminal Services like service (display output redirection). From what it looks like I have two options:
1. API hooking - slow, cumbersome, low-level, half-documented and error prone (not to mention unportable)
2. "Mirror" driver technique - fast, available but a bit hidden from public so to speak.
Which one to choose, and how to implement them ? Can any of you guys help me out ?
Are there any tutorials available on this ? I am already briefly familiar with what DDK says about this, and generally with the NT driver programming theory, although I was never even near all this stuff.
|
|
|
|