|
Dunno if it's possible!
But you can make a hook and catch when printcreen button is pressed and then remove the content.
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
I would add my program to the clipboard notifier chain (SetClipboardViewer ) and wait until the clipboard changes (you receive a WM_DRAWCLIPBOARD ).
When the clipboard changes, check immediately if the Print Screen Key is pressed (GetAsyncKeyState ) and if it is, clear the clipboard (OpenClipboard, EmptyClipboard, CloseClipboard ).
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
1. Create a DLL that holds a System Wide Keyboard Hook.
2. Start the hook at the beggining of your program.
3. stop the hook when you want it...
NOTE 1:
you can also receive a notification from that DLL that the event has happened via a WM_XXX or whatever other method...
NOTE 2:
If you want to avoid the printscreen press only when your app has the focus you could avoid the system wide hook and hook only your app.
hope this helps.
|
|
|
|
|
I have a class with members that are pointers to the base class of derived classes... Here's a simplified example.
class CDerivedClass : public CBaseClass
{
DECLARE_SERIAL(CDerivedClass)
int something;
}
class CBaseClass : public CObject
{
DECLARE_SERIAL(CBaseClass)
...
void Serialize(CArchive &ar);
...
(data to archive)
}
class CCompoundClass : public CObject
{
DECLARE_SERIAL(CCompountClass)
...
void Serialize(CArchive &ar);
...
CBaseClass *ptrBaseClass; // points to the CDerivedClass
}
I dynamically allocate CDerivedClass, and set the CBaseClass pointer in the CCompoundClass to this object. I want to make the CCompoundClass Serializable, but don't seem to have the right recipe to pick up the derived class that ptrBaseClass points to. Any suggestions?
I read through the help documentation, but it doesn't cover this case.
|
|
|
|
|
I should have submitted this earlier... After scratching my head for a few hours, I deleted the object files (clean), rebuilt, and everything worked as expected.
|
|
|
|
|
Hi all,
I am connecting to sybase through my VC 6.0 DLL which gets called from PB
application, its is multithreaded DLL. I am using ODBC to connect sybase. I
am facing some major problems. I am connecting to (Ora, Syb, SQL) through
this sam DLL with ODBC.
The problems which i am facing is
1) Sybase not allowing to use Dynaset in recordset. if i use forwardonly it
works but not allows me to go back.
2) When this thread is ended, system gets hanged.
Although the same code is running perfectly with ORA,SQL server.
I am looking forward for some general way which will be applicable for all the databases.
Thanks
Ajaz
/***************Thread Code **************/
// check if new mails have arrived for the logged in dealer
UINT of_CheckNewMail(LPVOID lpnull)
{
CString l_SQL ;
CString msglabel ;
long ll_LastMsgCount,ll_LoopCount, ll_CurrMsg ;
l_SQL = "select mailid,ufrom,umsg,udate from kastlemail where uto =
'" + gsDealer + "' and (recieved is null or lower(recieved) <> 'y') " ;
KMailCount = new CRecordset(&gdb_Connection) ;
gdb_Connection.BeginTrans () ;
KMailCount->Open(CRecordset::dynaset, l_SQL,
CRecordset::noDirtyFieldCheck ) ;
while ( ib_StartMail == true )
{
TRY
{
KMailCount->Requery() ;
ll_CurrMsg = 0 ;
while ( !KMailCount->IsEOF())
{
ll_CurrMsg++ ;
KMailCount->MoveNext();
}
if ( (ll_CurrMsg > 0 ) && (ll_CurrMsg !=
ll_LastMsgCount) )
{
// show the popup window and let the
process stop for 3 sec
msglabel.Format ("%d%s", ll_CurrMsg, " New
Message");
popup->Show(msglabel);
while(popup->m_nAnimStatus > 0 );
ll_LastMsgCount = ll_CurrMsg ;
ll_LoopCount=0;
}
ll_LoopCount++;
if ( ll_LoopCount > 20 )
{
ll_LoopCount = 0 ;
ll_LastMsgCount = 0;
}
}
CATCH(CDBException, e)
{
::MessageBox(0, e->m_strError, "Kastle Mail Error",
MB_OK) ;
ib_StartMail = false ;
}
END_CATCH
Sleep(3000);
}
popup->Hide();
if(gdb_Connection.IsOpen())
gdb_Connection.Rollback () ;
if(KMailCount->IsOpen())
KMailCount->Close() ;
// close the cursor
::SQLFreeStmt( KMailCount->m_hstmt, SQL_CLOSE );
delete KMailCount ;
AfxEndThread(0);
delete popup;
return 0;
}
|
|
|
|
|
Hello, anyone knows hot to configure the Soap Trace Utility that comes along with the SOAP SDK 3.0.
I encounter difficulty in configuring it to trace .ASPX page.
In the help file. it stated
In the WSDL file, locate the <soap:address> element that corresponds to the service and change the location attribute for this element to port 8080. For example, if the location attribute specifies <http: myserver="" vdir="" service.wsdl=""> change this attribute to <http: myserver:8080="" vdir="" service.wsdl="">.
But, there is not WSDL file for a .ASPX file. The WSDL document is generated runtime by the .NET when passing the query string as http://localhost/test.aspx?WSDL
How to confgure it to the WSDL file? I need to trace the content of the SOAP communication between client and server.
Thank you.
|
|
|
|
|
I thought out already.
it is by passing the URL as http://localhost:8080/sss.aspx.wsdl
|
|
|
|
|
Does anyone know how to map frequency ranges to the bands of an equalizer??? I'm trying to map the 20hz to 20kz range to a 32-band equalizer. But the relation is not linear...
Henry P.
http://www.allersoft.com
|
|
|
|
|
|
How come I get the following errors on my MFC dialog app? I have included fstream.h and I have used code like this before. Why is it not working here?
void CTestDlg::OnTimer(UINT nIDEvent)
{
fstream file;
file.open("Run.txt", ios::out);
CDialog::OnTimer(nIDEvent);
} </code>
error C2065: 'fstream' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'file'
error C2065: 'file' : undeclared identifier
error C2228: left of '.open' must have class/struct/union type
error C2653: 'ios' : is not a class or namespace name
error C2065: 'out' : undeclared identifier
Error executing cl.exe.
Thanks,
Selevercin
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
it's:
ifstream file
or
ofstream file
if that doesn't work, try:
std:: (file == input ? i : o)fstream;
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Hi Nitron.
I've already tried the ofstream (it's output), but with no success. I just tried your "if that doesn't work" also with no success. I got the following errors (*note* I copied your code exactly):
error C2653: 'std' : is not a class or namespace name
error C2589: '(' : illegal token on right side of '::'
error C2143: syntax error : missing ';' before '::'
Error executing cl.exe.
I've had my previous way work before, but without using MFC. Any ideas?
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
You neet to include:
#include "fstream.h"
and try:
std::ifstream file;
(my last line was pseudo-code, telling you to put "i" or "o" depending on if it's an input file or not. Sorry
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
you are probably doing this:
#include <fstream.h>
#include "stdafx.h"
try this:
#include "stdafx.h"
#include <fstream.h>
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Wow! Thanks! That fixed it! I know the order of headers matters, but is there a simple reason why this worked?
Thanks,
Selevercin
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
The compiler uses stdafx.cpp to generate a precompiled header file substituting it for all # include's in the # include stdafx.h directive. The header stdafx.h should be at the top of all headers because the compiler ignores any # include directives before stdafx.h.
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
if you don't want to include stdafx.h try this:
go to Project->Settings->C/C++->Project Options and search for:
""/Yu"stdafx.h" " and replace it by "" (nothing) (that means kick it !)
and you don't need to include stdafx.h
Sendel
The only place for millions of bugs is the Rainforest
|
|
|
|
|
hi people,
I created a button (button1) that was suppose to bring out the save file dialog and prompt user for a place to save the file.. which works exactly like "SAVE AS" under FILE selection. but i can't get it to work. for example, i want to save a file "c:\ABC.txt" into "d:\XYZ.txt" using the save file dialog once button1 is clicked...
void CMytestDlg::OnButton1()
{
}
thanks in advance.;)
|
|
|
|
|
CFileDialog d(true);
if (d.DoModal() == IDOK)
{
}
else
{
}
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
.... the dialog thing came out.. but it looks like a file opening dialog.. i'm really new at this... can you please be more detail here? thanks..
for example..
everytime button is clicked.. a specific file (c:\ABC.txt) will be saved to another location that user placed in the prompt..
thanks again.. your help is grealy appreciated..
|
|
|
|
|
there is a member of CFileDialog called
m_ofn[^].
it is an OPENFILENAME[^] structure, which can be modified before calling the dialog (ie. before DoModal()) to define the dialogs behaviour.
BW
"I always wanted to be somebody, but now I realize I should have been more specific."
- Lily Tomlin
|
|
|
|
|
Use CFileDialog dlg(FALSE); instead - this creates the dialog as a "Save" dialog instead of an "Open" dialog.
|
|
|
|
|
oops.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Does anyone know how to seek a value in a database field from an ODBC recordset? In other words, is there an equivalent to the CDAORecordset.seek or CDAORecordset.find for ODBC? Thanks,
Ralf.
ralf.riedel@usm.edu
|
|
|
|