|
Yeah, i wonder why C++ doesn't have something like an itemcountof or such operator for that by default. Many times it would be useful, i keep making macros for sizeof(array)/sizeof(array[0]) and i keep forgetting where i put them.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Nikesh Jagtap wrote: int a[4][6] which is allocated dynamically.
Not unless you've declared it as:
int **a = new int*[4];
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi. I have a dll app I've downloaded from web and now trying to modify it to suit my needs. But when I try to make some changes I'm getting this message. How to save my work?
Thanks in advance.
|
|
|
|
|
Copy the contents of the file you have changed via Ctrl-C, and then paste it into Notepad and save it to a new file. Then close VS, change all the RO files to RW, and reopen the project. Then copy/paste the saved contents to the file you were editing.
To change file attributes (optionally including all subdirectories) I use the free Properties Plus: http://www.softlookup.com/display.asp?id=25161[^]
|
|
|
|
|
Well, without knowing anything more about what you are trying to do i can think of 2 general things:
-Your target file has the read-only proparty set to it, remove it for example with Explorer (right-click the file, select "Properties" and uncheck "read only")
-Your target file is in use by another process (could be also a thread by the same process)
What exactly are you trying to save there? And how do you wish to modify a DLL? You have sources for it? Or you are editing it with some binary editor or such? Maybe that DLL has been loaded by some app and that is while it is locked.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
i want to display numeric values in edit box whenever i scroll up or down.
thanks in advance
|
|
|
|
|
Anjali Patil wrote: i want to display numeric values in edit box whenever i scroll up or down.
Hi Anjali,
I think you need the CSpinButtonCtrl[^].
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
hi Experts,
I have big problem,
Am new to MFC.
problem :: I want to create a modelless dialog from inside a thread..Am using RunModalLoop. But my parent window has got stucked....
Any suggestion will be welcome
Please do help me
|
|
|
|
|
If you want a modeless dialog, why use RunModalLoop ? Prototype for creating modeless dialogs could be something like:
void DoTheDialog(CWnd* wndParent)
{
static CMyDialogClass* pDlg = NULL;
if(!(pDlg && ::IsWindow(pDlg->GetSafeHwnd())){
pDlg = new CMyDialogClass();
pDlg->Create(IDD_DIALOG_CLASS, wndParent);
}
pDlg->ShowWindow(SW_SHOW);
}
|
|
|
|
|
|
Hello!
I run my MFC application using the .exe icon from the debug folder, now my requirement is if once i start my application, if again i press the same exe icon it shoud give a message "one instance is already running !" and shouldn't launch the application !!
how to do it ?
thanks!
|
|
|
|
|
Did you read here here[^] and there a lot of other articles on the net. Just google and pick up the one that best suits your needs.
If just you had googled
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
kapardhi wrote: how to do it ?
By reading here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
hi,
Can anybody tell me how to customize a print dialog ,so that on click of 'ok' button in print dialog we will be able to display another user defined dialog box before the print process starts.i had posted the same in general questions but dint get any response..plz help
Thanks and regards,
RM
modified on Monday, December 1, 2008 3:56 AM
|
|
|
|
|
|
hi,
These articles are used to create a print dialog as an exe...can u tell me how to use this dialog instead of the default print dialog when we press print from menu.
thanks and regards,
rm
|
|
|
|
|
Hi All,
I have one program thats taking the screen shot of desktop and
save in a file.But this program is running on remote machine.I connect this machine with RDP.Problem is When i connected to machine program is working fine and taking screen shots ,but when i disconnected from RDP or minimized it it failed.
I found that,
The Bitblt function of the following sample code is falied with
Error 6.Otherwise its working fine when i m connected to it.
Error 6 means Invalid handle.
Can anybody tell why its failed of any other method of taking screen shot of desktop.?
Thanx in advance..
//////////////////////////////////////////
BOOL CBitmapFile::SaveDesktopAsFile(LPTSTR szFile, int nFileType)
{
CString strFileName, strError = "";
CWnd* pWnd = CWnd::GetDesktopWindow();
CBitmap bitmap;
CWindowDC dc(pWnd);
CDC memDC;
CRect rect;
strFileName = (CString)szFile;
memDC.CreateCompatibleDC(&dc);
pWnd->GetWindowRect(rect);
bitmap.CreateCompatibleBitmap(&dc, rect.Width(),rect.Height() );
CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);
memDC.BitBlt(0, 0, rect.Width(),rect.Height(), &dc, 0, 0, SRCCOPY);
// Create logical palette if device support a palette
CPalette pal;
if( dc.GetDeviceCaps(RASTERCAPS) & RC_PALETTE )
{
UINT nSize = sizeof(LOGPALETTE) + (sizeof(PALETTEENTRY) * 256);
LOGPALETTE *pLP = (LOGPALETTE *) new BYTE[nSize];
pLP->palVersion = 0x300;
pLP->palNumEntries =
GetSystemPaletteEntries( dc, 0, 255, pLP->palPalEntry );
// Create the palette
pal.CreatePalette( pLP );
delete[] pLP;
}
// Convert the bitmap to a DIB
HANDLE hDIB = DDBToDIB( bitmap, BI_RGB, &pal );
if( hDIB == NULL )
return FALSE;
// DrawGreyScale( &memDC, hDIB );
memDC.SelectObject(pOldBitmap);
// Write it to file
// Write it to file
if(nFileType == BMP_FILE)
WriteDIB( szFile, hDIB );
else
JpegFromDib(hDIB, 100, strFileName, &strError);
// Free the memory allocated by DDBToDIB for the DIB
GlobalFree( hDIB );
return TRUE;
}
//////////////////////////////////////////
|
|
|
|
|
Well, my guess would be that the desktop you are making screen shots of simply doesn't exist when there's noone looking at it, understand that as in, no remote desktop connection is made. I think when you connect to the RDP server it will create something like a virtual desktop for you and will close and destroy it once you are done using RDP and log out. So my guess is that you get NULL when you call GetDesktopWindow or maybe you get 0 for its width and height, or you just don't get a DC for it. Does this make any sense?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Code-o-mat wrote: So my guess is that you get NULL when you call GetDesktopWindow...
So then wouldn't the subsequent call to GetWindowRect() fail?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I have checked it with writing a log file.
All pointers and rect are looking normal.
But the function bitblt is failed.
Why i dont know and the GetlastError gives Error 6.
which is invalid handle.
Is there any api to check HDC or CDC object is valid or not.
bcoz it looks normal handle and pointer.
Anyway thanx for reply.
|
|
|
|
|
Hi All
I have image on buttons.And i am trying to set TabStop focus on button.I have set TabStop properties TRUE of buttons.But it's working when i am useing tab.Some one help me how can use?
|
|
|
|
|
|
problem is that "tab focus not showing on button".
|
|
|
|
|
If you cant see it you must be show it yourself.
|
|
|
|
|