|
Dear All,
how can i solve the problem of including the View class header file in the MainFrame.cpp file. when do so an error occure about the GetDocument(); declaration in the view header file.the error says "error C2143: syntax error : missing ';' before '*'"
thanks,
Mohammad Zakarni
|
|
|
|
|
You need to include the document class as well. The error is because GetDocument returns a pointer to a document object, so you need to include it first, so it knows what that is.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Cool thank you it worked...
Thanx;)
|
|
|
|
|
I got the same error C2143 when I moved a snippet of working code to open a file and load a list box. I put the code in a new file as a good programming practice and I think the error was related to the include header:
#include <fstream>
using namespace std;
Any suggestions?
When you come to a fork in the road, take it! Y. Berra
|
|
|
|
|
doubl00 wrote:
#include
using namespace std;
Any suggestions?
1. Check 'display this message as is' or use < and > to do < >
2. NEVER use all of namespace std.
3. I really don't know, because I don't know what you included. The problem will be different now, because it's obviously std library stuff you're using. Could you post the offending code and the name of the header ?
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
When i edit my menu in the resource editor it is OK, but when i start the app, it is
disabled, and i cannot enable it, i tried with handling WM_INITMENU, and enabling the
items there but no success. Only E&xit it OK, it is the only menu item that works,
why is that ?
And another question... Is there any significance which class will contain the menu's
ON_COMMAND handlers ?
|
|
|
|
|
if you are using MFC the menu handler will need to be in a class that has an instance available ..... if you have the menu handler in a doc class that has no open document...then MFC will disable the menu item for you...since there is no handler available to service the request.....if that is not the case, give a little more detailed info.....about the problem
1. The Lord loves a workin' man.
2. See a doctor and get rid of it.
3. Don't trust whitey.
|
|
|
|
|
I am Korean and weak English.
I want fax brodcasting service. But I don't know how to use below three API.
I want to know how to working together three below API.
FaxSendDocumentForBroadcast()
FaxCompleteJobParams()
FAX_RECIPIENT_CALLBACK()
Please help me. I searched MSDN and web site.
But there no detail data about FaxSendDocumentForBroadcast().
I attach my fax broadcast project source code.
Thank you very much.
BOOL CALLBACK CALLBACK FAX_RECIPIENT_CALLBACK(
HANDLE FaxHandle, //handle to the fax server
DWORD RecipientNumber, //index indicating current fax recipient
LPVOID Context, //pointer to context information
PFAX_JOB_PARAM pfxParam, // [in,out] pointer to job information structure
PFAX_COVERPAGE_INFO pcpInfo ) // [in,out] pointer to local cover page structure
{
pfxParam->SizeOfStruct = sizeof(FAX_JOB_PARAM);
pfxParam->RecipientNumber = pszFaxNumber; // recipient's fax numbe
pfxParam->ScheduleAction = JSA_NOW; //schedule the transmission at any time in the next 24 hours
if(RecipientNumber > 10) return FALSE;
else return TRUE;
}
void CFaxClientDlg::SendFax()
{
if(!FaxConnectFaxServer(NULL, &fxHandle))
{
DWORD dwError = ::GetLastError();
switch(dwError){
case ERROR_INVALID_PARAMETER:
break;
case ERROR_NOT_ENOUGH_MEMORY:
break;
}
ReportOSError();
FaxClose(fxHandle);
return;
}
/*
if(!FaxCompleteJobParams( &pfxParam, &pcpInfo ) )
{
ReportOSError();
FaxClose(fxHandle);
return;
}
*/
if( FaxSendDocumentForBroadcast(fxHandle, pszFileName, &dwJobId, FAX_RECIPIENT_CALLBACK, NULL) ) /* [out] dwJobId */
AfxMessageBox("SendDoc Succeeded");
else ReportOSError();
// Cleanup here
FaxFreeBuffer(pfxParam);
if ( pcpInfo )
FaxFreeBuffer(pcpInfo);
FaxClose(fxHandle);
}
|
|
|
|
|
you didn't find indo on MSDN on this because, (I believe), this is not part of the OS API, Windows has traditionally never provided fax support....this is probably a 3rd party lib, you need to consult the vendor documentation....if Windows is now supporting Fax thru API then it is a new one on me, wouldn't be the first time though!!!!
1. The Lord loves a workin' man.
2. See a doctor and get rid of it.
3. Don't trust whitey.
|
|
|
|
|
Thank you very much.
Windows is now supporting Fax Service and Fax Client API.
From Windows 2000, Windows support FAX SERVICE and I just want to program
fax client.
Below three API is FAX CLIENT API. But I nerver know how working together three API.
FaxSendDocumentForBroadcast()
FaxCompleteJobParams()
FAX_RECIPIENT_CALLBACK()
|
|
|
|
|
hi,
why does using const referance slow down the program and increase the program size,its referance any way,no need to copy anything?I read this in oneof the articles here.
julie
|
|
|
|
|
Have you verified this ? It sounds strange to me.... Slow down I would investigate to see if it was true, although I can't see why ( surely making a copy would slow things down ? ), but there is no reason I can see why it could make a program bigger.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
annie julie wrote:
why does using const referance slow down the program and increase the program size
Are you sure this is the case???? Maybe it does make the program bigger but I'd guess only marginally, but I can't see how it would slow down a program... weird
"When a friend hurts us, we should write it down in the sand, where the winds of forgiveness get in charge of erasing it away, and when something great happens, we should engrave it in the stone of the memory of the heart, where no wind can erase it" Nish on life [methinks]
"It's The Soapbox; topics are optional" Shog 9
|
|
|
|
|
It doesn't. A reference is just a pointer internally.
Shockingly, not everything you read on the internet is automatically true.
--Mike--
Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
hi,
could anyone brief me about how to work with messages between threads or lead me to some good COMPREHENSIVE articles.
actually i want to communicate between two applications(one of them from a dll).does it count as between threads?
bye,
|
|
|
|
|
hi,
if you want to communicate between two application you need the Window Handle for the window that should hanld the message you want.
you can retreive the desired window handle by usinf EnumWindows this API will enumerate all the running applications; to indicate the desired application you can use GetWindowText API to retreive the Application main window title and compare it with application title you want to communicate with, after gaining the handle you can use SendMessage or PostMessage to send that application the Message you like.
Good Luck...
Mohammad Zakarni;)
|
|
|
|
|
hi,
I am setting windows message hook to an application like notepad. I am using create process of notepad in some client. In same client I am loading DLL having the hook routines. Passing threadID of notepad to funcion present in DLL setting the hook. but in hooking it says that can not install non local hook . what should I do?
VIKS
|
|
|
|
|
no short answer on this...check out codeguru, article called "API Hooking Reveale" by Ivo Ivanov....there may be inof on this site, not sure, but I no Ivo's has your answers for you, be prepared for some heavy reading
1. The Lord loves a workin' man.
2. See a doctor and get rid of it.
3. Don't trust whitey.
|
|
|
|
|
Can anybody tell me the class and function through which I can find out if the file is empty or not.
Thanks in advance
Samir Sood
|
|
|
|
|
|
Hi.
In both windows and dialog boxes, there are buttons on the upper right corner of the frame to minimize, maximize, and/or close window. Is it possible to enable or disable one or more of those buttons? For example, I would like to disable the maximize option during a certain time and then reenable it.
Thanks,
Kuphryn
|
|
|
|
|
|
Nice! Thanks.
How about the close window, big "X" icon? Is there a way to disable it too and/or catches it because the program closes or the dialog closes?
Kuphryn
|
|
|
|
|
hi,
hm....sorry cound find how to disable the "X" button, but it think you can catch, whether the dialog closes or not. Put the WM_CLOSE handler to your Dialog class and put the code in that you need. This will always tell you when the dialog is closing!
for example:
void CCloseDDlg::OnClose()
{
MessageBox("Closing the app");
CDialog::OnClose();
}
Regards, Sonu
|
|
|
|
|
Thanks.
Perfect! That solution is exactly what I will implement if it is not possible t disable the "X" in the window frame and/or dialog box frame.
Kuphryn
|
|
|
|