|
What is the error code? Check the error code by calling GetLastError() or by adding @err,hr to the watch window.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
|
Hi,
There is no any problem in the code..
Its working for me.
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
I am connecting Sqlserver2000 with VC++6.0(MFC) and ERROR when update information. please help me. thanks very much
----------------------------------------------------
void CReadDBDlg::OnRead()
{
// TODO: Add your control notification handler code here
CDatabase database;
CString SqlString;
CString sCatID, sCategory;
CString sDriver = "SQL Server";
CString sDsn;
CString sFile = "nhanvien_DATA.mdf";
int iRec = 0;
sDsn.Format("Driver={SQL Server};Server={EZITWK115};" "Trusted_Connection=no;""Database=NHANVIEN;Uid=sa;Pwd=sa;");
TRY
{
// Open the database
database.Open(NULL,FALSE,FALSE,sDsn,TRUE);
// Allocate the recordset
CRecordset recset( &database );
CString SS2 = "UPDATE nhan_vien SET hoten = 'nU' WHERE manv = '002' ";
//Execute query ====>> This is ERROR !!!
recset.Open(CRecordset::forwardOnly,
"{CALL " + SS2 + "}", CRecordset::executeDirect);
// Close the database
database.Close();
}
CATCH(CDBException, e)
{
// If a database exception occured, show error msg
AfxMessageBox("Database error: "+e->m_strError);
}
END_CATCH;
}
-------------
|
|
|
|
|
phan xuan nguyen wrote: //Execute query ====>> This is ERROR !!!
WHAT error?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I need to send and receive data from mutiple comports may be around 10,
parallely.
Now I am able to work with single comport.
What are the things to be taken care for mutiple port
communication.
Can I have single receiving thread for all ports,
or I must have separate receiving thread for all ports.
Please clarify.
If any document is there, please give me link.
Regards,
Sunil Kumar
|
|
|
|
|
You are reposting the same question.
Previous question link[^]
Your doubt was answered by Cedric
If you have not checked it please check.
Regards,
Sandip.
|
|
|
|
|
hi.
how can i create an application that listens to the desktop events.
for example , poping up a messege whenever i click the ctrl btn.
thanks.
|
|
|
|
|
Do you mean that you want to hook/"listen to" all messages that are posted to windows in the current desktop?
Haimbert wrote: for example , poping up a messege whenever i click the ctrl btn.
You can create system-wide hotkeys using the RegisterHotKey() function (documentation here).
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
what im basicly trying to do is to create a process that listens to the keyboard events in all windows, and if a user clicks on the "ctrl" button , a square will be painted arround the mouse cursor.
im doing it in mfc. and i dont even know if i have to create a CFrameWnd object. i dont want to create a window , only listen to key events in the computer.
|
|
|
|
|
You'll want to use the SetWindowsHookEx() with the WH_KEYBOARD or WH_KEYBOARD_LL hook procedure - see the documentation here.
This article should also help get you started
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
|
Hello, We are parsing a XML manifest. Inside the manifest can be sub manifests. When parsing for the sub-manifests our windows service crashes with this error:
Unhandled exception at 0x72d2c066 in CDPService.exe: 0xC0000005: Access violation reading location 0x00000014.
This is the line of code in our service that it stops at:
hresult = pRdr->parseURL( manifest );
I have verified the XML files. This code works when compiled as an external executable. We are including msxml2.h and using the SAX parser.
Anyone have an idea or suggestions?
|
|
|
|
|
Hi!
I want to protect my software with very simple mechanism. I will generate license number and when user purchase my software, I will send him that number by email. It will look like HTUG-F4DK2-EKFJ-JIII32. I cannot get his information (like name or company name), so I need something like this:
if(editbox_text == "HTUG-F4DK2-EKFJ-JIII32") MessageBox("congratulations");
How to make that more secure. Where to store license numbers in my application? Should I crypt them in file and then decrypt them before if statement?
like:
open_file(serial.txt); // I will actually store 5-10 crypted serial numbers IN CODE (and not in file) and every 5-10 copy I sell, I will change license numbers
decrypted_data=decrypt(serial.txt,decrypted_data);
if(edit_box_text == decrypted_data) MessageBox("congratulations");
Is this good?
I do not want to make complicated mechanism.
How to crypt that numbers?
Thank you!
|
|
|
|
|
No, that is a horrible way to do it. Search right here on CodeProject, there are several good articles on how to do this in a much more secure way.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hell no!
If you protected your app like that, I'd own it in under 10 minutes
Even if I couldn't be bothered looking for the allowed serials, I'd just patch the jump that's made after the "if (edit_box_text == decrypted_data)" comparison.
Further to searching for articles here on CP, I'd heartily recommend you find and follow the series of tutorials by lena151. I found the experience gained within to be invaluable when it comes to devising a useful protection mechanism for an app.
If it's in C#, .NET Reflector with the Deblector & Reflexil plugins leads to the breaking of most apps in under 5 minutes! For others it make may take a little longer, requiring the use of additional tools.
You would be wise to use an exe protector program on your finished program. The best type would be one that utilized the virtual machine method, one like ASProtect SKE or Themida. These protection methods are very difficult to defeat and will allow you to prevent unauthorized eyes from decompiling/dissasembling/modifying/serial-fishing your app.
modified on Monday, August 25, 2008 9:41 PM
|
|
|
|
|
I found free IntelliProtector tool to protect my program from decompiling/dissasembling/modifying. Can I then use if (edit_box_text == decrypted_data) technique? Or what?
|
|
|
|
|
Nice find! Looks like a good tool - especially for free.
That may well provide enough protection for your app - it's all about statistics at the end of the day. Even Autodesk & Microsoft can be hacked - it's only our limited exposure that helps delay/avoid any hacking.
If you want to be sure, look up crackmes - simple programs that do nothing but check username/serial combos. The aim is to create one that no-one can break or conversely to break every one that comes your way.
You may wish to sign up at a ReverseEngineering forum and post your own crackme - a small program with your serial-checking method that has been protected with IntelliProtector too. One forum that you may find good value is: http://forum.tuts4you.com/index.php?act=idx[^]
|
|
|
|
|
I think IntelliProtector offers me what I need. It is also very simple to use. Thank you for your information. I am interested in reverse engineering but never had enough time to learn about it more than simple monitoring of API calls.
|
|
|
|
|
how do i convert a unsigned char to int ?
-Thanks
Nice things do nice works
|
|
|
|
|
unsigned char uc = 15;
int i = uc;
|
|
|
|
|
whoa - that's creepy
Would be scary if we used the same variable names and value.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
wait, I have better code:
unsigned char uc = 15;
int i = (signed int)(unsigned int)(unsigned short)uc;
|
|
|
|
|
Extreme coercion....I like it!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
unsigned char g = 42;
int h = g;
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|