|
quangpk wrote: Why ?
I have no clue. What have you discovered using the debugger? Have you narrowed the problem down to just one or two statements? Are you checking return values from functions?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi, I copy file hwinterface.sys to folder .../window/system32/drivers/
(I use win NT2K) my App work.
|
|
|
|
|
quangpk wrote: my App work.
Great.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi
I want to disable pasting on an edit control
i have created a subclass control for CEdit and am using the following bit of code to disable pasting
which works in the way it stops the user being able to paste into the edit control
but it is disabling the v character as well so they are unable to type that in
Can anyone advise on a solution, so that it disables paste but the user can still use the v char
thanks
Simon
BOOL CCPEditControl::PreTranslateMessage(MSG* pMsg)
{
switch( pMsg->message )
{
case WM_KEYDOWN:
{
switch( pMsg->wParam )
{
case 0x56:
{
if( GetKeyState(VK_CONTROL) )
return true;
}
break;
}
}
break;
case WM_RBUTTONDOWN:
{
return true;
}
break;
}
return CEdit::PreTranslateMessage(pMsg);
}
|
|
|
|
|
si_69 wrote: Can anyone advise on a solution
No, and if there was one you certainly would not find it in the documentation[^]
led mike
|
|
|
|
|
You just need to override the default processing for the WM_PASTE message, something like:
LRESULT CCPEditControl::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch( message )
{
case WM_PASTE:
{
return 0;
}
break;
}
return CEdit::DefWindowProc(message, wParam, lParam);
}
Gavin Taylor
|
|
|
|
|
See replies here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You found he's the same guy and linking him to the replies over there? You're such a detective.
|
|
|
|
|
We can also find questions by George_George at other sites.
Maxwell Chen
|
|
|
|
|
OK, That does it - he must be a cabal of nascent developers. All those questions cannot be the work of one man! (Or even a multi-tasking woman)
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
VC++ 6.0
I am using CDatabase - for opening MDB file.
Does anyone knows anything that will give me number of tables present into databse with their names?
Thanks in advance
AmolM
|
|
|
|
|
|
Here ya go...SQLTables() wrapped in a CRecordset...
#if !defined(AFX_TABLESTABLE_H__C56C489A_652B_421F_A869_43D7E8E6D602__INCLUDED_)
#define AFX_TABLESTABLE_H__C56C489A_652B_421F_A869_43D7E8E6D602__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
class CTablesTable : public CRecordset
{
DECLARE_DYNAMIC(CTablesTable)
public:
CTablesTable(CDatabase* pDatabase = NULL);
virtual BOOL Open(UINT nOpenType = forwardOnly, LPCTSTR lpszSQL = NULL,
DWORD dwOptions = readOnly);
CString m_strQualifier;
CString m_strOwner;
CString m_strTableName;
CString m_strTableType;
CString m_strRemarks;
CString m_strQualifierParam;
CString m_strOwnerParam;
CString m_strNameParam;
CString m_strTypeParam;
protected:
virtual CString GetDefaultConnect();
virtual CString GetDefaultSQL();
virtual void DoFieldExchange(CFieldExchange* pFX);
};
#endif // !defined(AFX_TABLESTABLE_H__C56C489A_652B_421F_A869_43D7E8E6D602__INCLUDED_)
#include "stdafx.h"
#include "TablesTable.h"
#if (_MANAGED == 1)
#pragma unmanaged
#endif
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNAMIC(CTablesTable, CRecordset)
CTablesTable::CTablesTable(CDatabase* pDatabase)
: CRecordset(pDatabase)
{
m_strQualifier = _T("");
m_strOwner = _T("");
m_strTableName = _T("");
m_strTableType = _T("");
m_strRemarks = _T("");
m_nFields = 5;
m_strQualifierParam = _T("");
m_strOwnerParam = _T("");
m_strNameParam = _T("");
m_strTypeParam = _T("");
}
BOOL CTablesTable::Open(UINT nOpenType, LPCTSTR lpszSQL, DWORD )
{
ASSERT(lpszSQL == NULL);
lpszSQL;
RETCODE nRetCode;
SetState(nOpenType,NULL,noDirtyFieldCheck);
if (!AllocHstmt())
return FALSE;
TRY
{
OnSetOptions(m_hstmt);
AllocStatusArrays();
#if defined(_UNICODE)
AFX_SQL_ASYNC(this, (::SQLTables)(m_hstmt,
(m_strQualifierParam.IsEmpty()? NULL: (SQLTCHAR *)(const wchar_t *)m_strQualifierParam),
SQL_NTS,
(m_strOwnerParam.IsEmpty()? NULL: (SQLTCHAR *)(const wchar_t *)m_strOwnerParam),
SQL_NTS,
(m_strNameParam.IsEmpty()? NULL: (SQLTCHAR *)(const wchar_t *)m_strNameParam),
SQL_NTS,
(m_strTypeParam.IsEmpty()? NULL: (SQLTCHAR *)(const wchar_t *)m_strTypeParam),
SQL_NTS));
#else
AFX_SQL_ASYNC(this, (::SQLTables)(m_hstmt,
(m_strQualifierParam.IsEmpty()? (UCHAR FAR *)NULL: (UCHAR FAR *)(const char*)m_strQualifierParam),
SQL_NTS,
(m_strOwnerParam.IsEmpty()? (UCHAR FAR *)NULL: (UCHAR FAR *)(const char*)m_strOwnerParam),
SQL_NTS,
(m_strNameParam.IsEmpty()? (UCHAR FAR *)NULL: (UCHAR FAR *)(const char*)m_strNameParam),
SQL_NTS,
(m_strTypeParam.IsEmpty()? (UCHAR FAR *)NULL: (UCHAR FAR *)(const char*)m_strTypeParam),
SQL_NTS));
#endif
if (!Check(nRetCode))
ThrowDBException(nRetCode, m_hstmt);
AllocAndCacheFieldInfo();
AllocRowset();
MoveNext();
m_bBOF = m_bEOF;
}
CATCH_ALL(e)
{
Close();
THROW_LAST();
}
END_CATCH_ALL
return TRUE;
}
CString CTablesTable::GetDefaultConnect()
{
return _T("ODBC;");
}
CString CTablesTable::GetDefaultSQL()
{
ASSERT(FALSE);
return _T("!");
}
void CTablesTable::DoFieldExchange(CFieldExchange* pFX)
{
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Text(pFX, _T("table_qualifier"), m_strQualifier);
RFX_Text(pFX, _T("table_owner"), m_strOwner);
RFX_Text(pFX, _T("table_name"), m_strTableName);
RFX_Text(pFX, _T("table_type"), m_strTableType);
RFX_Text(pFX, _T("remarks"), m_strRemarks);
} Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Im currently working on CGridCtrl. I need to support atleast 50,000 rows so i opted for the virtual mode.
The problem raised when I have to add controls into my Grid such as Check boxes and combo boxes. I also want set the
color of the text in virtual mode.
Will you be able to help me out here.
Im very desperate...
Thanks
Rajith
|
|
|
|
|
I'm pretty sure the CGridCtrl's virtual mode is very primitive in the fancy things it can or cannot support.
I remember an article I wrote on a progress-bar cell type, and one of my forum questioners asked about using it in a virtual grid. We never really got anywhere.
More recently, CMaunder and co posted another grid control, developed by him and Dundas and now released into the public arena. That may be more useful to you. I didn't find any features that required me to make all the changes in my software to switch over. But improved handling of virtual grids may be a compelling feature for you.
Ultimate Grid:
http://www.codeproject.com/KB/MFC/UltimateGrid.aspx[^]
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
Hello everyone,
I have searched for MSDN for half an hour about a configuration guide for DCOM on the basis of out-of-process server, but failed.
(Suppose I have a working well out-of-process server and I want to use dcomcnfg to make it run on two machines using DCOM)
Could anyone recommend some tutorials?
thanks in advance,
George
|
|
|
|
|
|
Hi Matthew,
VB client does not matter to my question. My question is about how to configure server.
Any recommended tutorials?
regards,
George
|
|
|
|
|
No sorry I don't remember ever using any . It was a long time ago but I remember I used the notes I made on a DevelopMentor COM course where I asked a lot of questions. DCOMConfig was part of the course so I guess I was pretty confident with it at the time.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thanks all the same, Matthew!
regards,
George
|
|
|
|
|
Hi there,
I am using LogonUser() API in my code to check for the authentication of user credentials. The problem that i am facing is that the API returns true only if the Account User Name is provided and not the Display user Name. For example: If I create a New Account lets say "ABC" with password as "NEWPWD". On passing "ABC" as user name and "NEWPD" as password LogonUser() returns true. If now I change the user name to lets say "XYZ" and call LogonUser() with the changed user name it returns false. How can I resolve this Issue.
|
|
|
|
|
So LogonUser("ABC", ...) succeeds and LogonUser("XYZ", ...) fails. Is that correct?
Why would you want to logon using the display name of XYZ rather than the account name of ABC?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Well as per the requirements of my application the user is allowed to change certain things only if he enters a proper Windows registered user name and password. Normally when we login to windows we enter our display user name and password. Or in case of tiles also we see the display user name and not the account name (if they are different. So in normal circumstances an end user will enter his display name when being asked for his/her credentials.
|
|
|
|
|
I upgrated VS2003 to VS2005 this week, then I found that functions like sscanf was changed to sscanf_s, so I updated my project sobstituting it everywhere .
now:
VS2003 (it was warking perfectly)
CString str=...;<br />
double d1, d2;<br />
scanf(str, "%lf%lf", %d1,%d2);
VS2005
scanf_s(str, "%lf%lf", %d1,%d2);
No, because the compiler tells that it cant convert CString to char*, then
scanf_s((char*) str.GetBuffer(), "%lf%lf", %d1,%d2);
The compiler is ok, but it seemes that only the first char of str is analysed !?!
(i.e. if str="23.43" then d1 will be =2 and not =23.43)
Am I wronging something?
Is there a different way to avoid the compiler error (something different and more sure from (char*) str.GetBuffer() )
thank you
Russell
|
|
|
|
|
Russell' wrote: Is there a different way to avoid the compiler error (something different and more sure from (char*) str.GetBuffer())
Yes, first thing to remember: never, ever use GetBuffer unless you know exactly what it does. Did you check the documentation ?
If it doesn't compile for VC2005, it is probably because UNICODE is enabled by default for VC2005. So either, don't enable it, or use UNICODE compatible functions, like _tscanf_s (check here[^]).
|
|
|
|