|
If you are trying to mix both Ansi and Unicode I would recomend using only MBCS. You are just bound to end up in deep water if you don't. Most of my projects need to deal with Unicode and Ansi, and I have never had a problem with the MBCS. Maybe some of the other posters would be able to give you a better answer.
|
|
|
|
|
Hi all
I am making a file wiping tool.
For data wiping I googled many algorithms one of them is "The Russian GOST P 50739 95"
In this algorithm it is given that:
"1 Logical zeros (0x00 numbers) is overwritten to each byte of each sector for 6th to 4th security level systems. Randomly selected symbols (numbers)are to be overwritten to each byte of each sector for 3rd to 1st security level systems."
Here I am not getting the term "6th to 4th security level systems" and "3rd to 1st Security level systems".
So Please guide me to understand these term.
Thanks
|
|
|
|
|
Is it possible it is refering to the amount of times the algorithm passes over the selected data block? I don't know too much about data wiping, but I do know they will usually wipe the same area more than one time.
|
|
|
|
|
Thanks for your reply
it is fine that this is overwriting more than once.
but my problem is to clarify
"6th to 4th security level systems" and "3rd to 1st Security level systems".
Please guide me.
Thanks
|
|
|
|
|
Well usually a data wipe is a time consuming process, especially on computers which hold sensetive information. These types of computers can have a very large storage capacity, which when wiping, involves wiping files, free space and the swap.
Obviously the more times you wipe, the more secure your system. Most wiping utilites allow you to set the security level, they do this by adjusting the amount of times they wipe the same data block.
Take the best-crypt wipe utility for example, it offers you an 8 level passover, A level 8 (MOD level) being the highest.
rajeevktripathi wrote: "6th to 4th security level systems" and "3rd to 1st Security level systems".
I would take a guess here that there are 6 levels invloved. And the 1st to 3rd would be the highest level i.e 3 to 6 passes. But this is only a guess. I would do some googling and find out more about this particular method of wiping.
|
|
|
|
|
What Hotkey would you normally associate with Delete or Clear?
MS Word claims it to be 'Del' but I want to use this with Rich text, therefore a hotkey would clear the whole selection, formatting included.
All the Ctrl + ? hotkeys seem to be located on the left of the keyboard, so which would you choose for a Delete?
|
|
|
|
|
Ctrl + X, just in case
~RaGE();
|
|
|
|
|
That was my first thought, but Ctrl+X is reserved for Cut operations, which would fill the clipboard. I want the users to be able to clear the control and still have tho option of pasting anything they may have previously copied.
I have used Ctrl+D for now, but I was wondering if there was any national standard as with Cut, Copy and Paste.
|
|
|
|
|
Ctrl + Shift + X
Nibu thomas
Software Developer
|
|
|
|
|
That sounds good, Ctrl + Shift + X it is :->
|
|
|
|
|
waldermort wrote: Cut operations, which would fill the clipboard.
Sorry, my post was a bad attempt at humour. The "just in case" was supposed to mean "so that we can paste it back in case we did not really want to delete it".
Seriuosly, Shft + Ctrl + X is a bit too much keys to my taste. I find Ctrl + D better. My 2 cents.
~RaGE();
|
|
|
|
|
haha, man I must be way too tired if I didn't notice that. I would agree Ctrl+D is better. At the moment I will leave it as it is and look further into the Richedit hotkeys. I don't want to have to many over-rides.
|
|
|
|
|
I have a program where i have created an openGL window within an MFC Dialog using a tutorial on http://steinsoft.net . I have buttons on the Dialog which i want to use to rotate and move (translate) some objects that i have drawn.
I implemented some code from http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=10[^] to allow me to move around the objects.
The code seems to be almost correct, but there seems to be a problem with the focus, coz something is stealing the focus, and thus the events are not getting executed properly.
Could someone please tell me how to get around this.
Your help would be highly appreciated
Thanks in advance
If you need my project to look at it for further clarification, you could post your meail address here and i'll mail it to you...
|
|
|
|
|
Please post the sample here (Only the Main code)
Regards,
FarPointer
|
|
|
|
|
This is the DrawGLScene() function called by onPaint()
void COpenGLControl::DrawGLScene()<br />
{<br />
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);<br />
glLoadIdentity();<br />
glRotatef(80.0f,-1.0f,0.0f,0.0f);<br />
<br />
GLfloat xTrans = -xpos;<br />
GLfloat zTrans = -zpos;<br />
GLfloat yTrans = -walkBias-0.25f;<br />
GLfloat sceneRoty = 360.0f - yRotation;<br />
<br />
glRotatef(lookUpDown,1.0f,0.0f,0.0f);<br />
glRotatef(sceneRoty,0.0f,1.0f,0.0f);<br />
<br />
glTranslatef(xTrans, yTrans, zTrans);<br />
<br />
<br />
if(myRightButton==true){<br />
heading -= 10.0f;
yRotation = heading;<br />
::SetFocus(m_hWnd);<br />
<br />
}<br />
if(myLeftButton==true){<br />
heading += 10.0f;
yRotation = heading;<br />
::SetFocus(m_hWnd);<br />
}<br />
<br />
if(myUpButton==true){<br />
xpos -= (float)sin(heading*piover180) * 0.05f;
zpos -= (float)cos(heading*piover180) * 0.05f;<br />
if (walkBiasAngle >= 359.0f)<br />
{<br />
walkBiasAngle = 0.0f;<br />
}<br />
else<br />
{<br />
walkBiasAngle+= 10;<br />
}<br />
walkBias = (float)sin(walkBiasAngle * piover180)/20.0f;<br />
<br />
::MessageBox(0,"Moving Forward","Move Forward",MB_OK|MB_ICONINFORMATION |MB_DEFAULT_DESKTOP_ONLY);<br />
<br />
}<br />
<br />
if(myDownButton==true){<br />
xpos += (float)sin(heading*piover180) * 0.05f;
zpos += (float)cos(heading*piover180) * 0.05f;
if (walkBiasAngle <= 1.0f)<br />
{<br />
walkBiasAngle = 359.0f;<br />
}<br />
else<br />
{<br />
walkBiasAngle-= 10;<br />
}<br />
walkBias = (float)sin(walkBiasAngle * piover180)/20.0f;<br />
<br />
}<br />
<br />
if(myPageUpButton==true){
lookUpDown-=20.0f;<br />
}<br />
<br />
if(myPageDownButton==true){
lookUpDown+=20.0f;<br />
}<br />
<br />
<br />
<br />
HRESULT hr;<br />
CoInitialize(NULL);<br />
<br />
try{<br />
hr = cnSURMPtr2.CreateInstance(__uuidof(ADODB::Connection));<br />
if (FAILED(hr))<br />
{<br />
throw _com_error(hr);<br />
}<br />
<br />
hr = rsObjectsPtr.CreateInstance(__uuidof(ADODB::Recordset));<br />
if (FAILED(hr))<br />
{<br />
throw _com_error(hr);<br />
}<br />
<br />
cnSURMPtr2->CursorLocation = ADODB::adUseClient;<br />
<br />
_bstr_t dbLocation(L"");<br />
dbLocation = (L".\\SURM.mdb");<br />
<br />
cnSURMPtr2->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ dbLocation +";Persist Security Info=False","","",ADODB::adConnectUnspecified);<br />
<br />
rsObjectsPtr->Open("SELECT * from Objects", cnSURMPtr2.GetInterfacePtr(),<br />
ADODB::adOpenDynamic, ADODB::adLockOptimistic, ADODB::adCmdText);<br />
<br />
if(!rsObjectsPtr->ADOEOF){<br />
if(rsObjectsPtr->GetRecordCount()>0){<br />
while (rsObjectsPtr->ADOEOF == false){<br />
_variant_t myCoordinates;<br />
<br />
myCoordinates = rsObjectsPtr->GetCollect(L"Coordinates");<br />
<br />
if(myCoordinates.vt != VT_NULL){<br />
CString myStrCoords;<br />
<br />
myStrCoords = static_cast<char *>(_bstr_t(myCoordinates.bstrVal));<br />
<br />
int myArraySize = (myStrCoords.GetLength()/15);<br />
CString *singleCoord = new CString[myArraySize];<br />
int tokenCounter = 0;<br />
<br />
while(myStrCoords.GetLength()>=15){<br />
singleCoord[tokenCounter] = myStrCoords.Left(15);<br />
myStrCoords.Delete(0,15);<br />
tokenCounter++;<br />
}<br />
<br />
if(tokenCounter==2){<br />
drawLine(singleCoord[0],singleCoord[1]);<br />
}<br />
else if(tokenCounter>2){<br />
drawQuad(singleCoord[0],singleCoord[1],singleCoord[2],singleCoord[3]); <br />
}<br />
}
rsObjectsPtr->MoveNext();<br />
}<br />
if(rsObjectsPtr->BOF){<br />
rsObjectsPtr->MoveFirst();<br />
}<br />
if(rsObjectsPtr->ADOEOF){<br />
rsObjectsPtr->MoveLast();<br />
}<br />
};<br />
}<br />
}<br />
catch(_com_error &e)<br />
{<br />
AfxMessageBox(static_cast<char *>(e.Description()));<br />
}<br />
catch(...)<br />
{<br />
AfxMessageBox("Unhandled Exception");<br />
};<br />
<br />
myRightButton = false;<br />
myLeftButton = false;<br />
myUpButton = false;<br />
myDownButton = false;<br />
myPageUpButton = false;<br />
myPageDownButton = false;<br />
myHomeButton = false;<br />
<br />
SwapBuffers(dc->m_hDC);<br />
}
Since i would like the rotation and translation to happen either by pressing buttons or key-presses, i have the following code: (NB: Without the message boxes it doesn't work, but with them ... it seems to send the focus back to the correct control - which i'm not too sure whether it's the dialog itself or the GLWindow within the dialog)
BOOL COpenGLMFCDlg::PreTranslateMessage(MSG* pMsg) <br />
{<br />
<br />
<br />
if (pMsg->message == WM_KEYDOWN)<br />
{<br />
if (pMsg->wParam == VK_RIGHT){
openGLControl.myRightButton = true;<br />
<br />
m_Txt_ObjectTypeName.SetWindowText("Right fired"+(CString)(openGLControl.yRotation));<br />
}<br />
<br />
if (pMsg->wParam == VK_LEFT){
openGLControl.myLeftButton = true;<br />
::MessageBox(0,"One more Event fired","My fired Event",MB_ICONINFORMATION |MB_SYSTEMMODAL|MB_DEFAULT_DESKTOP_ONLY);<br />
}<br />
<br />
if (pMsg->wParam == VK_UP){
openGLControl.myUpButton = true;<br />
::MessageBox(0,"Up Event Fired","Up Event",MB_ICONINFORMATION |MB_SYSTEMMODAL|MB_DEFAULT_DESKTOP_ONLY);<br />
<br />
}<br />
<br />
if (pMsg->wParam == VK_DOWN){
openGLControl.myDownButton = true;<br />
}<br />
if (pMsg->wParam == VK_PRIOR){
openGLControl.myPageUpButton = true;<br />
::MessageBox(0,"Page Up Event fired","PageUp Event",MB_ICONINFORMATION |MB_SYSTEMMODAL|MB_DEFAULT_DESKTOP_ONLY);<br />
<br />
}<br />
if (pMsg->wParam == VK_NEXT){
openGLControl.myPageDownButton = true;<br />
<br />
}<br />
<br />
}<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}
Above was the code for keypresses... now for the buttons events code
void COpenGLMFCDlg::OnCmdUp() <br />
{<br />
openGLControl.myUpButton = true;<br />
::MessageBox(0,"Up Button Event Fired","Move Forwards",MB_OK|MB_ICONINFORMATION |MB_DEFAULT_DESKTOP_ONLY);<br />
<br />
<br />
}<br />
<br />
void COpenGLMFCDlg::OnCmdRight() <br />
{<br />
<br />
openGLControl.myRightButton = true;<br />
<br />
<br />
::MessageBox(0,"Right Button Event Fired","Turn Right",MB_OK|MB_ICONINFORMATION |MB_DEFAULT_DESKTOP_ONLY);<br />
<br />
}<br />
<br />
void COpenGLMFCDlg::OnCmdLeft() <br />
{<br />
openGLControl.myLeftButton = true;<br />
::MessageBox(0,"Left Button Event Fired","Turn Left",MB_OK|MB_ICONINFORMATION |MB_DEFAULT_DESKTOP_ONLY);<br />
<br />
<br />
}<br />
<br />
void COpenGLMFCDlg::OnCmdDown() <br />
{<br />
openGLControl.myDownButton = true;<br />
::MessageBox(0,"Down Button Event Fired","Move backwards",MB_OK|MB_ICONINFORMATION |MB_DEFAULT_DESKTOP_ONLY);<br />
<br />
<br />
}
This is the onPaint() function
void COpenGLControl::OnPaint() <br />
{ <br />
<br />
glEnable( GL_POLYGON_OFFSET_FILL );<br />
glPolygonOffset( 1.0, 1.0 );<br />
DrawGLScene();<br />
glDisable( GL_POLYGON_OFFSET_FILL );<br />
<br />
glEnable( GL_BLEND );<br />
glEnable( GL_LINE_SMOOTH );<br />
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );<br />
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );<br />
DrawGLScene();<br />
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );<br />
glDisable( GL_LINE_SMOOTH );<br />
glDisable( GL_BLEND );<br />
<br />
<br />
<br />
CWnd::OnPaint();<br />
myRightButton = false;<br />
myLeftButton = false;<br />
}
I think the issue is something to do with the focus being lost somewhere to some control. onPaint an drawGLscene are in the OpenGLControl functions
Hope this helps...
-- modified at 12:16 Thursday 30th March, 2006
|
|
|
|
|
I Get xml files from the internet by using CWebBrowser2 control, now is the question:
How can I save the xml as files on my disks and don't indicate the user?
Now I Get the xml source from CWebBrowser2 by the method CWebBrowser2::ExecWB(OLECMDID_SAVEAS, OLECMDEXECOPT_DONTPROMPTUSER, &vt1, &vt1), is there any way better?
thanks for your answers!
|
|
|
|
|
|
Hi!
This is a really easy question, but I dont know the answer:
The text in a AfxMessageBox should look like this:
Sorry, can't found folder "Test" !
Whats the way to give out the ""??
Thanks
|
|
|
|
|
|
|
it is "Sorry, cannot find the folder \"Test\"". :->
~RaGE();
|
|
|
|
|
Any ideas why this code crashes with 799 elements or more but it works with 699 or less? I haven't found yet the limit.
<code>#include <malloc.h>
#include <stdio.h>
int main()
{
int n = 699;
int* array = (int*) malloc(sizeof(char) * n);
if (!array)
{
printf("Out of memory");
return 1;
}
for (int i = 0; i < n; i++)
{
array[i] = i;
}
for (int i = 0; i < n; i++)
{
printf("%d, ", array[i]);
}
return 0;
}
</code>
-- modified at 2:51 Thursday 30th March, 2006
|
|
|
|
|
Hey when i tried it is working up to n=980.
anything more than 980 application is crashing.
|
|
|
|
|
What compiler? I'm using mingw on WinXP Home right now but I could try it later on VS2005 and GCC under Linux but I have to reboot.
This is a text book example. Well I've change it a little bit but it is basically the same.
|
|
|
|
|
Your array variable is a pointer to int's but you're only allocating enough memory for n char's. char's are smaller than int's so you're running past the end of the memory you've allocated.
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|