|
|
See Database[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
In VSS 2005 project settings we have option to set
Enable C++ Exceptions: No, Yes (/EHsc), Yes With SEH Exceptions (/EHa).
By default i am not able to get any exception.(even dividebyzero).
By setting that option to /no. is working fine. please clarify.
|
|
|
|
|
/no is OK unless you have any code in your executable that uses exceptions. For example, if you use iostreams, Visual C++ will complain that you should enable exception handling code.
Using /EHs means you can only catch synchronous exceptions (== C++ exceptions, for all intents and purposes).
Using /EHa allows you to catch C++ exceptions AND structured exceptions (== the native Win32 exception mechanism).
In general, if you're just using iostreams or other bits of STL, /EHs is fine. If you're not using STL and your code has no exception handling, /no should be fine.
|
|
|
|
|
hai!
i have hexadecimal string
strHex = "0c"
i want to convert it to
strDec = "12"
strHex = "FF"
strDec = "256"
How to do it?
Thanks !
|
|
|
|
|
Try this
char* strHex = "0c";
char strDec[50];
int nValue = 0;
sscanf( strHex, "%x", &nValue );
sprintf( strDec, "%d", nValue );
|
|
|
|
|
kapardhi wrote: strHex = "FF"
strDec = "256"
You've actually to fool a bit the underlying math to obtain the above conversion
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello Team,
I am planning to write an application in VC++ to find free calender in outlook.
in our company, all the meeting rooms are listed in outlook calender. to finding a free meeting room takes hello lot of time, i have to look for each room. so resolve this, i am planning to write
an application which will have all the possible rooms listed, and user can search for it.
to find the free cal, to intract with outlook cal, searching in calender, what are the API supported in VC++ ?
Thank you
|
|
|
|
|
In MS-outlook calenders are inside pst file, Is there only one pst file?
modified on Wednesday, December 24, 2008 1:01 AM
|
|
|
|
|
Thank you
I am not sure about this. can you pls put some lights on this
|
|
|
|
|
Hi all,
I have posted same question again, Nobody is responding me Please respond the query.
I uesd FSCTL_GET_VOLUME_BITMAP to get free cluster list but When bitmap is very large it can not be fit into buffer, So I tried to read the bitmap in small chunks of bytes but I am always getting the bitmap from startting 0 offset, How could I read bitmap in small chunks.
my code is here, Please correct if i am wrong
BOOL CFreeCluster::GetBitmap()
{
STARTING_LCN_INPUT_BUFFER StartingLCN;
VOLUME_BITMAP_BUFFER *Bitmap = NULL;
ULONGLONG BitmapSize;
DWORD BytesReturned;
BOOL Result;
StartingLCN.StartingLcn.QuadPart = 0;
BitmapSize = sizeof (VOLUME_BITMAP_BUFFER) + 4;
Bitmap = (VOLUME_BITMAP_BUFFER *) malloc (BitmapSize);
HANDLE hHandle=OpenDrive();
Result = DeviceIoControl
(
hHandle,
FSCTL_GET_VOLUME_BITMAP,
&StartingLCN,
sizeof (StartingLCN),
Bitmap,
BitmapSize,
&BytesReturned,
NULL
);
if (Result == FALSE && GetLastError () != ERROR_MORE_DATA)
{
free (Bitmap);
return (false);
}
BitmapSize = (Bitmap->BitmapSize.QuadPart / 8) + 1;
int nBufferSize=8*512*3;
ULONGLONG ullItr=BitmapSize/nBufferSize;
if(BitmapSize%nBufferSize!=0)
ullItr++;
Bitmap = (VOLUME_BITMAP_BUFFER *) realloc (Bitmap, nBufferSize+1);
ULONGLONG ullClusterNo=0;
for (ULONGLONG ullTmp=0; ullTmp < ullItr; ullTmp++)
{
if(BitmapSize < nBufferSize)
nBufferSize=BitmapSize;
memset(Bitmap->Buffer,0x0,nBufferSize+1);
StartingLCN.StartingLcn.QuadPart=ullTmp*nBufferSize;
Result = DeviceIoControl
(
hHandle,
FSCTL_GET_VOLUME_BITMAP,
&StartingLCN,
nBufferSize,
Bitmap,
nBufferSize,
&BytesReturned,
NULL
);
int p=GetLastError();
if (Result == FALSE && GetLastError () != ERROR_MORE_DATA)
{
free (Bitmap);
return (false);
}
BitmapSize=BitmapSize-nBufferSize;
}
return (true);
}
modified on Wednesday, December 24, 2008 12:18 AM
|
|
|
|
|
Is nobody able to solve my problem?
|
|
|
|
|
i am trying to open .txt text file using ShellExecute() method but it is not getting opened.
thanks in advance
|
|
|
|
|
Sorry, but that's not enough information for someone to help you fix it.
You should show the code you're using to call ShellExecute, and say what error it's giving or what other behavior is happening.
No one can read your mind.
thanks in advance
|
|
|
|
|
CString str="D:\\abc.txt";
ShellExecute(NULL,"open","Notepad.exe",NULL,NULL,SW_HIDE);
ShellExecute(NULL,"open",str,NULL,NULL,SW_SHOWNORMAL);
now it is working, my program is able to open .txt file.
|
|
|
|
|
try file path instead of Notepad.exe
|
|
|
|
|
Hi,
I am working with MFCFeature pack . i created a toolbar with PNG file.
in that toolbar i am dynamically adding 3 buttons. i am trying to set icon to these buttons, but icon is not comming.
i tried with CMFCToolBarImages::AddIcon(hIcon);
can any one suggest how to do that one.
|
|
|
|
|
Is there a special pen that I can use to draw lines on a bitmap that simply invert the pixels that are already there?
I need draw rectangles on a bitmap and I need to update their dimensions every few seconds, so the old rectangles need to be erased before the new ones are drawn.
This means that if I erase the old rectangles with a white pen, after a while large chunks of my bitmap will be missing because of having been overwritten by the rectangles.
I figure that if I can draw rectangles that simply invert the pixels that are already there, then I can erase the rectangles by drawing the same ones a second time, meaning that the pixels will then become inverted back to what they were originally.
Can anyone suggest a way to do this?
|
|
|
|
|
Sounds like you want rubberbanding[^]
You can apply the concept to drawing any drawing primitive like rectangles. You would probably want to have already drawn the bitmap to your client area on the screen to get the effect you are describing.
Also, you will probably enjoy CRectTracker if you use MFC.
|
|
|
|
|
Thanks a million, Bob!
I'm using straight C, not MFC, so I will have to use the SetROP2() GDI function instead of that demo code, but I think it will work out the same.
Thanks again!
|
|
|
|
|
Wishing you all a great break.
To those regulars who post great answers, thanks for educating me.
To those posting interesting questions - thanks for helping me educate myself!
Merry christmas all - those presents need opening, and I can't find the API...
Iain.
|
|
|
|
|
Merry Christmas to you, Iain (an anonymous fan ).
Iain Clarke wrote: To those regulars who post great answers, thanks for educating me.
To those posting interesting questions - thanks for helping me educate myself!
BTW it looks like you missed the meritorious George_George.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Cheers Iain!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Iain Clarke wrote: Merry christmas all - those presents need opening, and I can't find the API...
You too Iain. Merry Christmas!!!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|