|
Is there a function or code to lock my computer,like this: you need a password to enter in application to enable using computer.The program should lok all functions of computer,and it should be turned off only by password!
Thanx
|
|
|
|
|
LockWorkStation();
Don't try it, just do it!
|
|
|
|
|
Just use a password-enabled screen saver. To enable it programmatically, check out the following value in the registry:
HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaverIsSecure
The alternative, LockWorkStation() , only works on Windows 2000 and newer machines.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi all,
I have client application and server application (FTP server / client). On client side, due to certain reasons, I use CArchive to write / read data to / from socket. On the server side I use CSockets to send / receive data.
It worked fine for me, but now I implemented encrypted communication (Twofish cipher) and want to exchange the data safely. When I send encrypted data from client to server (ie. CArchive::Write()), it is ok. But when I use CSocket::Send() to send encrypted data from server to client, on client side the call of CArchive::Read() doesn't return and after a while it throws CFileException (OS Error it says).
My method for sending encrypted data from server to client is the following:
[CODE]
DWORD dwToAllocate = CTwofishCipher::getPaddedSize(strlen(s) + 3) + TC_BLOCK_HEADER_SIZE;
BYTE* encryptedData = new BYTE[dwToAllocate];
memset(encryptedData, 0x00, dwToAllocate);
encryptAnswer(stringToSend, encryptedData);
pControlSocket->sendEncryptedString(encryptedData, dwToAllocate);
void CMyControlSocket::sendEncryptedString(BYTE* encryptedData, INT dataLen)
{
CSocket::Send(encryptedData, dataLen, 0);
}
[/CODE]
And the code of client for receive encrypted data is here:
[CODE]
BYTE* receivedData = NULL;
UINT nBytesRead = 0;
TRY
{
receivedData = (BYTE *) m_retmsg.GetBuffer(32000);
nBytesRead = m_pCtrlRxarch->Read((TCHAR*) receivedData, 32000);
m_retmsg.ReleaseBuffer();
}
CATCH(CFileException ,e)
{
ErrorCode = e->m_lOsError;
return FALSE;
}
END_CATCH
[/CODE]
The interesting is that when I check received data on client side (after it throws the exception after a while), the bytes received exactly match the bytes which had been sent. Anyway, the function CArchive::Read() has apparently some difficulty receiving the buffer.
Thanks for any suggestion!
|
|
|
|
|
hi,
for a project fot school in need a struct array whith a length of 22510....If i debug the program it seems the array has only a length of 1024...
Does some know if there is a maximum lenght of arrays in borland c++ builder and how i can solve this problem??
Ben Tros
Ben_Tros@hotmail.com
|
|
|
|
|
ben_tros wrote:
how i can solve this problem??
Allocate your array dynamically (also don't forget to free it when you don't need it anymore)
Ashes to ashes,
And clay to clay
If the enemy doesn’t get you,
Your own folk may
|
|
|
|
|
Is this a heap array or a stack array? For example:
int num[250000];
would create an array of 250,000 integers, and consume 1MB of the available stack. The default stack size for a VC++ program is 1MB, so this would most likely fail as there would be no room for anything else in the program.
This statement, however, would execute with no problems as it allocates from the heap:
int *num = new int[250000];
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
The max Len of an array generally is assumed to be Maximum Unsigned Integer or possibly 2^64(depending on system). I don't know any more. Generally a dynamicly maitained array doesn't need to worry about maximum size any more. It just needs to have good memory managment behind it.
|
|
|
|
|
There isn't a maximum in C++. However, various debug views may set a maximum for performance reasons... in other words, it may take forever for a debugger to show all 22510 nodes of an array, so it may be limiting it to 1024. This shouldn't affect your code at all though.
Remember, even if you win the rat race, you're still a rat.
|
|
|
|
|
How to Create a Button with Tooltip in "win32 application project"?
|
|
|
|
|
|
Hi,
is it possible to have a combo box display both text and an icon without resulting to owner drawing it? (im not using MFC)
Any example would be ace and also if i do have to draw it, any examples would be great!
Cheers
Skute
|
|
|
|
|
I was just about to suggest CComboBoxEx, but then I saw you are not using MFC.
You should still be able to use this control sans MFC as it is part of the windows common controls.
I Dream of Absolute Zero
|
|
|
|
|
Hi there
One of my users is getting the following error when trying to pull
back an XML document from my web service
The xml page cannot be displayed
Cannot view xml input using style sheet. Please correct the error and then click the Refresh button, or try again later.
xml document must have a top level element. error processing resource
this is only occuring for one user, all other users have no problems accessing the
same xml query. And results are returned OK
If i go directly to the web service as well and add in the parameter manually it works fine
and for all other users, i just dont know why its only this user. Other XML querys that this user performs are successfull, but not this one
im using VC and c# for the web service on VS2003
please help
si
|
|
|
|
|
I create splitter,
in them - form,
in them - flex-grid control,
in them - check-box.
That check-box begin to react if I click on form somewhere - once.
Why so happens?
And how to make check-box clicked from first click?
thanks.
|
|
|
|
|
May be the first click is used to set the focus on the formview.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Yes, it was true, - to set it for grid.
|
|
|
|
|
There is beta version of Visual Studio 8.0 to test,
I need people opinion - does it worth thing,
in comparison with 7.1 version.
What is advantages and disadvantages ?
does enterprise code templates- "best practices" templates -
worth thing in real coding work?
thanks you
|
|
|
|
|
Hi,
I am trying to develop a samll software which will interact with USB storage devices. I am able to get the USB devices add/remove notification and can also get the type of device , but i am unable to get the device name so can some one help me.
I am using WindowsXP as a development platform.
Thanks,
Liaqat
|
|
|
|
|
i hv used inline assemble which hv been showed below:
do{
for(int test=0;test<5000;test++);// reach the high output to send a read data properly
__asm{//the normal case which used to transfer the data
///*
mov dx,portaddress
mov bx,data
mov cx,i //need to shift it to the large register
bt bx,cl
jc Current_Bit2_Is_1
Current_Bit2_Is_0:
/* mov al,00000010b
mov cx,10h
loop_label7: out dx,al
loop loop_label7*/
mov al,11111101b
mov cx,25h
loop_label8: out dx,al
loop loop_label8
mov al,11111111b
mov cx,35h
loop_label9: out dx,al
loop loop_label9
mov al,11111101b
mov cx,25h
loop_label7: out dx,al
loop loop_label7
jmp END2 //jump without any condition
Current_Bit2_Is_1:
mov al,11111101b
mov cx,25h
loop_label1: out dx,al
loop loop_label1
mov al,11111001b
mov cx,35h
loop_label2: out dx,al
loop loop_label2
mov al,11111011b
mov cx,35h
loop_label3: out dx,al
loop loop_label3
mov al,11111001b
mov cx,25h
loop_label4: out dx,al
loop loop_label4
mov al,11111101b
mov cx,25h
loop_label5: out dx,al
loop loop_label5
END2:
}
for(test=0;test<7000;test++);
__asm{
mov dx,portaddress
mov al,11111101b
out dx,al
}
i--;
}while(i>=0);
if i just use like this then no problem. but when i use inline assemble in another part of my program, it always make the program hang.
if(i==-1){
__asm{
mov dx,portaddress
mov bx,data
mov al,00000010b
mov cx,10h
loop_labelA: out dx,al
loop loop_labelA
mov al,00000000b
mov cx,15h
loop_labelB: out dx,al
loop loop_labelB
mov al,00000010b
mov cx,10h
loop_labelC: out dx,al
loop loop_labelC
}
}
this one is just under the while statement.....but it always make the program hang. i really dont know what is the problem in here.
is there anyone know how to solve it?
thank u in advance!!!!!
|
|
|
|
|
Did you consider that the loop variable test may be optimised to register variable and your inline code is currupting it.
MSN Messenger.
prakashnadar@msn.com
|
|
|
|
|
Hello, dear sirs !
There is a class CMyWnd1 : public CWnd.
This class is imported from MFC-Extension DLL to my application.
(this DLL I created by myself and use successfully).
In application I try to create new class CMyWnd2, derived from CMyWnd1.
In "CMyWnd2.cpp" I wrote:
BEGIN_MESSAGE_MAP(CMyWnd2, CMyWnd1)<br />
ON_WM_SIZE()<br />
ON_WM_PAINT()<br />
END_MESSAGE_MAP()
and also in "CMyWnd2.h"
DECLARE_MESSAGE_MAP()
But compiler informs me about the following error:
CMyWnd2.obj : error LNK2001: unresolved external symbol "protected: static struct AFX_MSGMAP const CMyWnd1::messageMap" (?messageMap@CMyWnd1@@1UAFX_MSGMAP@@B)
It's seems like difficulties during try to import MESSAGE_MAP of the base class CMyWnd1 from DLL.
What's the problem ? I can't understand ! I need your advice !
|
|
|
|
|
Hi,
if i just buy a VC++.Net but not the whole Visual Studio.Net
package, can I still use it to develop software for Pocket PC 2003/Smartphone by using the compact framework extension ?
and can I develop software on PocketPC/Smartphone by using
C# ?
Thanks
|
|
|
|
|
Hi all,
I have three questions,
1. What are the limitation of C# compared to C++.net ?
2. will MFC in VC++ be obsolete in future ?
3. Do we need to obsfucate the code in C++.net as in C# for
protecting the reverse engineering of software code ?
Thanks
|
|
|
|
|
C++ can be still written in a unmanaged version. Visual Studio even contains a newer version of the MFC. (Albeit this if thought as the last version ever). This produces pure machine code as before.
Also, you can use the managed extensions of C++ and you have a(ugly and uncomfortable) way of programming .NET in your known language. This produces Intermediate language code that easily interoperates with any DOT-NET language.
C# is fairly complete language, much as Java is. It is still lacking templates, so you do not have typesave containers easily. Otherwise, there is about nothing you can do with C++ that you can't with C#.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|