|
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
|
|
|
|
|
Hello
As Sonu has said you can override OnClose(), but if you actually want to disable the close button, use this code
GetSystemMenu(FALSE)->RemoveMenu(SC_CLOSE,MF_BYCOMMAND);
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
|
|
|
|
|
Nice!!! Thanks!
I tried our solution. I was able to disable the "X," but could not recover it. Through looking up some other functions via help, I found another solution.
-----
// Disable the "X"
GetSystemMenu(FALSE)->EnableMenuItem(SC_CLOSE,MF_DISABLED);
// Enable the "X"
GetSystemMenu(FALSE)->EnableMenuItem(SC_CLOSE,MF_ENABLED);
-----
Furthermore, SC_CLOSE is just one of a series of menu items that can be used.
GetSystemMenu() is very powerful. Thanks!
Kuphryn
|
|
|
|
|
I've been using the ::GetDIBits function to convert from HBitmap to DIB in a thumbnailer I'm writing. The idea is to use GetDIBits to convert from any bitmap format to a 32 bpp DIB. I then render the DIB to the screen with ::StrechDiBits.
The code below works fine with W98/WMe but under W2k/XP it sometimes - very often - render transparent bitmaps. I wonder if this a bug from me or a bug from the driver of my video card (ATI Radeon DDR 64), but I got the same problem on another XP machine.
Can anybody tell me if there's something wrong in the code below ? Personnaly I give up, I tried so many things I've no more idea.
1/ We get a HBitmap from Disk
2/ Prepare for our final DIB header (pBMI)
3/ Get bitmaps bits (GetDiBits)
4/ Save the bits in a buffer from our Image class (m_pBits)
void __fastcall CP3dOBmp::CreateFromHBitmap(HBITMAP hBitmap, int Width, int Height)
{
HANDLE hDib;
BITMAPINFO* pBMI;
HDC hDC = ::GetDC(NULL);
// Get bitmap format
//::GetDIBits(hDC, hBitmap, 0, 0, NULL, pBMI, DIB_RGB_COLORS);
Create(Width, Height, 32);
int nMem = sizeof(BITMAPINFOHEADER) +
(((((Width * 32) + 31) & ~31) >> 3) * Height);
hDib = GlobalAlloc(GHND, nMem);
if (!hDib) return;
pBMI = (BITMAPINFO *)GlobalLock(hDib);
BITMAPINFOHEADER* pBIH = (BITMAPINFOHEADER *)pBMI;
pBIH->biSize = sizeof(BITMAPINFOHEADER);
pBIH->biWidth = Width;
pBIH->biHeight = Height;
pBIH->biPlanes = 1;
pBIH->biBitCount = 32;
pBIH->biCompression = BI_RGB;
pBIH->biSizeImage = ((((Width * 32) + 31) & ~31) >> 3) * Height;
pBIH->biXPelsPerMeter = 0;
pBIH->biYPelsPerMeter = 0;
pBIH->biClrUsed = 0;
pBIH->biClrImportant = 0;
// Get hBitmap data
if (::GetDIBits(hDC, hBitmap, 0, Height,
(LPBYTE)pBMI->bmiColors, // Pointer to the bits
pBMI,
DIB_RGB_COLORS)) {
memcpy(m_pBits, (LPBYTE)pBMI->bmiColors, (32/8)*Width*Height);
}
GlobalUnlock(hDib);
GlobalFree(hDib);
::ReleaseDC(NULL, hDC);
}
The GetDiBits function obviously returns a blank buffer as I don't initialize the m_pBits one and I get a transaprent bitmap.
Good luck )
Yarp
|
|
|
|
|
Try using a BITMAPV4HEADER instead of a BITMAPINFOHEADER. I had the reverse problem. I had code working under XP, but failed under 95/98. If nothing else it's worth a shot.
Joel Lucsy (jjlucsy@ameritech.net)
|
|
|
|