|
Hello,
http://www.research.att.com/~bs/C++.html
http://www.cplusplus.com/
http://www.msdn.microsoft.com/visualc/
http://www.codeproject.com;P
http://www.codeguru.com
With Regards,
R.Selvam
|
|
|
|
|
use some good book like "Thinking in C++" "Effective C++" "The C++ programming language by Bjarne Stroustrup"
and offcourse
codeproject.com
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
|
If you have programming experience and want to learn C++ (as opposed to learn programming), I can recommend "Accelerated C++"[^] by Andrew Koenig / Barbara Moo.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
"Thinking in C++" by bruce eckel is free and hardcore, but if you are very new to c++, i recommend that you open C++ complete reference first and then go for Thinking in C++, and C++ is in you!!!
cheers
Balkrishna Talele
|
|
|
|
|
I compiled my project at home without any errors but when I opened it on another pc and edit the code, the compiler encounter error: cannot open include file 'afxdao.h': no such file or directory.
Hwo to resolve this?
|
|
|
|
|
Hello
afxdao.h file missed in your system. So, you can copy afxdao.h file in to VC++ program files include directory.
With Regards,
R.Selvam
|
|
|
|
|
I compiled my project at home without any errors but when I opened it on another pc and edit the code, the compiler encounter error: cannot open include file 'afxdao.h': no such file or directory.
Hwo to resolve this?
|
|
|
|
|
check if path of INCLUDE directory is right one
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
|
Hi,
I know of ReadFile, ReadFileEx and ReadFileScatter.
Are there any other (perhaps lower-level) functions that can be used to read data from files?
Specifically, I would like to know which function DirectShow uses when playing a WMV file (more percisely - which function the filter DS loads calls).
I know that it is not one of the 3 mentioned above...
Thanks in advance,
Oz
|
|
|
|
|
crt functions like fopen
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
They use ReadFile behind the scenes.
|
|
|
|
|
U can use fstream class object and use its functions like read
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
|
are there, to read from files.
fread, fstream - they all use ReadFile (or ReadFileEx) internally.
I want to know what Win32 API functions are there, to read from files.
|
|
|
|
|
ReadFile is the most low level API call you cant get for reading directly from a handle, but there is also a more sophisticated way to read a file.
You could create a memory mapping of the file and then use any developer tricks you can dream up.
An example: If the file is a bitmap file, then you can cast the void * you get from the mapping to a struct BITMAPFILEHEADER *, and then read from the members of that structure.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Thank you for the elaborate resposne
Unfortunately, I found out that this also is not the way DirectShow reads WMV and ASF files (I found it out using API hooking).
Any chance that it uses some sort of direct disk access? Or maybe reads the file in a different process and streams the data through COM to my process?
Any other ideas?
Thanks!
|
|
|
|
|
The whole point of DirectX is to be an abstraction layer that hides the awfull truth which is: If a DirectX driver for the given hardware exists, in your case this is the soundboard driver, then the features of that driver is used. If such a driver does not exist, then DirectX will emulate the DirectX functions, using the usual Win32 API calls.
So, what you are looking for is not an API call, but a way to access the hardware directly which is not at all like reading a file (unless of course you are used to read files in assembler ).
But why not use DirectX then?, if there is a difference in performance compared to the ASM solution, then it is a very small one.
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Thanks again for taking the time to reply everytime
Would you like to continue the discussion in email?
At any case - what I actually want to do is override the DirectX function calls so that my code will intercept every reading from the disk and modify the data that is being read...
|
|
|
|
|
Hi
C functions like fgets() and fscanf() can do the trick for you.
Besides that, you can also use the MFC class CFile and it's derived classes to do some file I/O.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
After calling PageSetupDlg() about three or four times I get an "Out of Memory" error.
My App is MDI with Multiple Document views.
I am storing the PAGESETUPDLG structure in the view class so that each time a new view is created, each view will have it's own page setup values.
The problem seems to be that if the PAGESETUPDLG devmode and devnames are not set to NULL either before or after calling PageSetupDlg(), then the memory error occurs.
I tried creating a dmOrientation variable so that I could store the paper orientation for each view but it won't compile. (See how below. It's commented out.)
I tried creating a DEVMODE and DEVNAMES structure but this didn't help. (See how below. It's commented out.)
My questions are:
How can I store the PageSetupDlg() values for each view?
Am I doing something wrong? (See partial code below)
//- Begin part of h file -//
// MyView.h : header file
//
/////////////////
// CMyView view
class CMyView : public CView
{
protected:
CMyView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CMyView)
// Attributes
public:
PAGESETUPDLG psd; // common dialog box structure
// short myOrientation;
// DEVMODE myDevMode;
// DEVNAMES myDevName;
LOGFONT mylf; // logical font structure
//- End part of the h file -//
//- Begin part of the cpp file -//
// CMyView.cpp : implementation file
//
#include "stdafx.h"
#include "MyApp.h"
#include "MyAppDoc.h"
#include "MyView.h"
#include "resource.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////
// CMyView
IMPLEMENT_DYNCREATE(CMyView, CView)
CMyView::CMyView()
{
//Page Setup
// myDevMode = (HANDLE)NULL; //don't forget to free or store hDevMode
// myOrientation = DMORIENT_PORTRAIT; //Selects the orientation of the paper.
// This member can be either DMORIENT_PORTRAIT (1)
// or DMORIENT_LANDSCAPE (2)
// psd = {0}; //doesn't compile
psd.lStructSize = sizeof(PAGESETUPDLG);
psd.hDevMode = (HANDLE)NULL; //don't forget to free or store hDevMode
psd.hDevNames = (HANDLE)NULL; //don't forget to free or store hDevNames
// psd.hInstance = (HANDLE)hInst;
psd.lCustData = (LPARAM)NULL;
psd.hPageSetupTemplate = (HGLOBAL)NULL;
psd.Flags = PSD_INTHOUSANDTHSOFINCHES | PSD_MARGINS;
psd.rtMargin.top = 1000;
psd.rtMargin.left = 1000;
psd.rtMargin.right = 1000;
psd.rtMargin.bottom = 1000;
// Initialize LOGFONT
mylf.lfHeight = 12; // LONG lfHeight;
mylf.lfWidth = 0; // LONG lfWidth;
mylf.lfEscapement = 0; // LONG lfEscapement;
mylf.lfOrientation = 0; // LONG lfOrientation;
mylf.lfWeight = 0; // LONG lfWeight;
mylf.lfItalic = 0; // BYTE lfItalic;
mylf.lfUnderline = 0; // BYTE lfUnderline;
mylf.lfStrikeOut = 0; // BYTE lfStrikeOut;
// BYTE lfCharSet;
// BYTE lfOutPrecision;
// BYTE lfClipPrecision;
// BYTE lfQuality;
mylf.lfPitchAndFamily = 0;
// BYTE lfPitchAndFamily;
lstrcpy(mylf.lfFaceName,"Arial");
// CHAR lfFaceName[LF_FACESIZE];
}
/////////////////
// CMyView Printing
void CMyView::OnFilePageSetup()
{
psd.hwndOwner = GetSafeHwnd( );
// psd.hDevMode = (HANDLE)myDevMode; //don't forget to free or store hDevMode
// psd.hDevMode = (HANDLE)NULL; // don't forget to free or store hDevMode
// psd.hDevNames = (HANDLE)NULL; // don't forget to free or store hDevNames
// psd.hDevMode.dmFields = DM_ORIENTATION;
// psd.hDevMode.dmOrientation = myOrientation; //doesn't compile
psd.hInstance = (HANDLE)hInst;
psd.lCustData = (LPARAM)NULL;
psd.hPageSetupTemplate = (HGLOBAL)NULL;
if(PageSetupDlg(&psd) == TRUE) {
// myOrientation = psd.hDevMode.dmOrientation;
// myDevMode = (HANDLE)psd.hDevMode;
psd.hDevMode = (HANDLE)NULL;
psd.hDevNames = (HANDLE)NULL;
}
}
//- end of part of cpp file -//
|
|
|
|
|
Oops.
Forgot that there was another function in CMyView::OnFilePageSetup().
After the user chooses OK the following function is called.
AfxGetApp()->SelectPrinter(psd,hDevNames, psd.hDevMode,TRUE);
When this function is commented out, there is no memory error. However, the landscape/portrait is not implemented when Print Preview is called.
|
|
|
|
|
I want to pass the CString name to a class. I have this:
void CForm3Page1::OnName()
{
CFormatname Dlg("ralph");
if (Dlg.DoModal() == IDOK)
{
}
}
and my class looks like this:
private:
CString thename;
public:
CFormatname(CWnd* pParent = NULL, CString); // standard constructor
CFormatname::CFormatname(CString name, CWnd* pParent /*=NULL*/)
: CDialog(name, CFormatname::IDD, pParent)
{
//{{AFX_DATA_INIT(CFormatname)
//}}AFX_DATA_INIT
thename = name;
}
But it doesn't work. I keep getting the errors:
C:\Formatname.h(25) : error C2548: 'CFormatname::CFormatname' : missing default parameter for parameter 2
C:\Formatname.h(15) : see declaration of 'CFormatname'
and other errors. I have looked in this book for quite some trying to
mimic this example. How do I pass a CString to a class?
Please any response any one can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
DanYELL wrote:
CFormatname(CWnd* pParent = NULL, CString); // standard constructor
CString is a data type, it has to be followed with a variable that represents it:
CFormatname(CWnd* pParent = NULL, CString myStr);
- Nick Parker My Blog
|
|
|
|
|
Even with that change, I still get this error:
C:\Formatname.h(25) : error C2548: 'CFormatname::CFormatname' : missing default parameter for parameter 2
and it's this line
CFormatname(CWnd* pParent = NULL, CString mystr); // standard constructor
???
|
|
|
|
|
Try
CFormatname(CWnd* pParent = NULL, CString myStr = NULL);
Thank You
Bo Hunter
|
|
|
|
|
Bo Hunter wrote:
CFormatname(CWnd* pParent = NULL, CString myStr = NULL);
Since myStr is not a pointer and NULL is a void pointer 0, the default argument isn't correct, but should be CFormatname(CWnd* pParent = NULL, CString myStr = "");.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|