|
Is scanf supposed to be fscanf perhaps?
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
|
I'm trying to convert this VB line
Dim hWndp As Long<br />
hWndp = WindowFromPoint(Pt.X - 5, Pt.Y - 5)
into C++... any help please?
Thanks,
Mike
|
|
|
|
|
MSDN:
static CWnd* PASCAL WindowFromPoint( POINT point );
So your C++ code should be:
CWnd* hWndp = WindowFromPoint( CPoint(Pt.x - 5, Pt.y - 5) );
|
|
|
|
|
POINT Pt;
HWND hWndp;
POINT Pt2 = Pt;
Pt2.x -= 5;
Pt2.y -= 5;
hWndp = WindowFromPoint ( Pt2 );
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
The first time i call EncryptString (below) I pass "<password>asdf" it encrypts to to be a length of 25 and encrypts it right. But when i try to encrypt a 2539 length string it returns a string of a length of 225 and only partically encrypted. Why is this happening and how do I fix it?
CString CEncyptionClass::EncryptString(CString m_strUnencryptedString)
{
//variables
//Date:11 22 03
CString m_strResultingText;
HCRYPTPROV hProv = NULL;
HCRYPTKEY hKey = NULL;
HCRYPTHASH hHash = NULL;
DWORD dwLength;
BYTE * pbBuffer;
LPTSTR m_tContents=ConvertCStringToChar(m_strUnencryptedString);
TCHAR szLocalPassword[] = _T("alongrandompassword");
//
// Get handle to user default provider.
if (CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0))
{
// Create hash object.
if (CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash))
{
// Hash password string.
dwLength = _tcslen(szLocalPassword);
if (CryptHashData(hHash, (BYTE *)szLocalPassword, dwLength, 0))
{
// Create block cipher session key based on hash of the password.
if (CryptDeriveKey(hProv, CALG_RC4, hHash, CRYPT_EXPORTABLE, &hKey))
{
dwLength= _tcslen(m_tContents);
pbBuffer=(BYTE*)malloc(dwLength);
if (pbBuffer != NULL)
{
memcpy(pbBuffer, m_tContents, dwLength);
if (CryptEncrypt(hKey, 0, true, 0, pbBuffer, &dwLength, dwLength))
{
m_strResultingText.Format("%s",pbBuffer);
CString strShow;
strShow.Format("After: %s \r\n(%s)\r\n %d %d", m_strResultingText,m_tContents,strlen((const char*) pbBuffer) ,dwLength);
MessageBox(strShow);
}
free(pbBuffer);
}
CryptDestroyKey(hKey); // Release provider handle.
}
}
CryptDestroyHash(hHash); // Destroy session key.
}
CryptReleaseContext(hProv, 0);
}
return m_strResultingText;
}
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
I am tring to build a keyboard hook that blocks the
windows keys. It has to be in a seperate dll. The
call to SetWindowsHookEx requires a HINSTANCE to the
dll. How do I get an HINSTANCE to my dll with out
having to use CWinApp. There is way more stuff in the
CWinApp class than I would like to use.
class CTaskKeyHookDll : public CWinApp
{
public :
CTaskKeyHookDll(){ }
~CTaskKeyHookDll(){ }
} MyDll;
class CTaskKeyHookDll
{
public :
HINSTANCE hInstance;
CTaskKeyHookDll(){ }
~CTaskKeyHookDll(){ }
} MyDll;
Anyone know how to do this?
Thank You
Bo Hunter
|
|
|
|
|
in your overridden DllMain() save the first parameter(HINSTANCE) to g_hInstance.
|
|
|
|
|
I am using a textfile assocciated with my file to store all my data that has resulted from my program, though I have and know know how to record things, I need help in retreiving and analyzing data from the txt file. Can anyone help? I need to look for a specific string of numbers then go to end of the line and retrieve the last character, can someone please help me acheive this, I am using win32.
|
|
|
|
|
Have you thought of a ini file?
If so there is so much code on this site for store and retrieve data.
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
Is there anything special about ini files
|
|
|
|
|
Hi
Sure they take all the work out of acc. a text doc.
See class
http://www.codeproject.com/useritems/CIni.asp?target=cini
and
http://www.codeproject.com/useritems/hongky.asp?target=cini
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|
I have a MFC program which supports Documents but I want my program to start with multiple documents.
How could it be possible?
Earth is like an apple, where are worms in it - the worms are humans...
|
|
|
|
|
I guess if you call OpenDocument as many times that many document window and view will be opened.
IndrekSnt wrote:
Earth is like an apple, where are worms in it - the worms are humans...
IndrekSnt wrote:
where are worms in it
Is it a question or a statement?
|
|
|
|
|
BOOL CGLprMpDoc::OnNewDocument()<br />
{<br />
if (!CDocument::OnNewDocument())<br />
return FALSE;<br />
<br />
<br />
return TRUE;<br />
}
What do I have to write between lines:
// (SDI documents will reuse this document)
and:
return TRUE;
---
Earth is like an apple, where are worms in it - the worms are humans...
|
|
|
|
|
errrrrrr
to open multiple documents u need to be writing an MDI app
MDI = multiple document interface
SDI = single document interface
"there is no spoon" biz stuff about me
|
|
|
|
|
This may be a little off the wall but you might want to think about the benefits of using Forth. It is a fine training language and will allow you to master the concept of object oriented thinking and open many possibilities for you.
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
Kidding
My neighbours think I am crazy - but they don't know that I have a trampoline. All they see my head bobbing up and down over the fence every five seconds
|
|
|
|
|
Hmm, I started a MFC MDI project but I don't know how to customise it more than MFC MDI wizard allows...
---
Earth is like an apple, where are worms in it - the worms are humans...
|
|
|
|
|
Hello all
I need information how verify (hash data and signature) this function.
I get data from hash by using CryptGetHashParam(...)and send to
SmartCard (infineon). This card prepare digital signature.
Next step call CryptVerifySign(...) for this signature and hash but receive error - bad signature.
What's wrong ?
Thanks
Adam Lyzwinski
Alyan
|
|
|
|
|
hi,
my application uses crystal report ocx and take setup for with application using .net setup wizard. while intalling the application on pc i got the following error
Module C:\wINNT\System32\crystl32.occx failed to register. HRESULT -2147024770 Contact your support personnel.
any one help to me.
thanks in advance.
|
|
|
|
|
That means a dependent module (DLL or OCX) wasn't installed. Run 'depends' on the OCX and see what might be missing.
Steve S
|
|
|
|
|
hi steve,
thanks for u help. problem is solved. i have one more problem if u have any idea share with with me. when i open the report from my problem on installed system(not development system) report is opened and immedeatly closed unable to view the report. my email is murali_utr@hotmail.com or murali@s-ecom.com. thanks in advance.
Murali.M
|
|
|
|
|
Hi
In deplhi TWerbBrowser is
document.documentElement
whot is equivqlent in BCB ?
THANKX veri much
|
|
|
|
|
How can I extract tags from CppWebBrowser->Document in BCB
marian_p@pobox.sk
THANKX
|
|
|
|