|
http://tds-crew.thebugs.ws
|
|
|
|
|
I don't even know what most of those things stand for. Is this URL to a shop, or a pirate site ?
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Christian Graus wrote:
Is this URL to a shop, or a pirate site ?
Definitely the latter. Such pages really shouldn't be allowed.
Peter O.
|
|
|
|
|
|
|
Nishant S wrote:
Did you really think you can mess up the forums by putting that in a message?
some people are just plain stupid
Soliant
"Every man dies, not every man really lives"
- Braveheart
|
|
|
|
|
When you press ctrl and the lbutton at the same time over almost anything, a little plus sign is added to the cursor. I can't seem to find anything that talks about that. How do you do it?
-Raffi
|
|
|
|
|
See the articles in the Drag and Drop section.
For normal OLE d&d, you'll just return DROPEFFECT_COPY at the appropriate time and place.
Or if you're doing your own thing, you can just create a cursor with a little plus sign in it...
--------
PMGRE --Shog9 --
|
|
|
|
|
Can someone tell me what needs to be done in order use a timer in a dialog dll. I have used settime with and without a TIMERPROC function and therefore with and without the use of OnTimer override, and nothing.
Suggestions?
I was going to throw the dialogs into a seperate thread, and use a sleep on the sll function, but I need to set variables in the dialog class that are passed in from the dll function call.
Help....I'm running out of ideas.
If you need to see some code, let me know, I did not post any because the settimer and ontimer stuff is uncomplicated. All I need to do when the timer hits is to close the dialog.
Thanks
Wade
|
|
|
|
|
|
Tried it, if the dialog code is inside an application settimer and the corresponding OnTimer that receives the WM_TIMER msg works. However, once the dialog class is implemented from a dll, the OnTimer function no longer receives any WM_TIMER msgs. However, the SetTimer fires when required.
|
|
|
|
|
Hello,
I am getting this error in my program in debug mode..
Damage: after Normal block (#63) at 0x011E1A20
It happens after I try the following code.
void CEncryptDlg::EncryptMsg()
{
UpdateData(TRUE);
KeyGen((DWORD)m_iKey);
DWORD* pdwTemp;
// Gets the length of the msg for the loop
m_nMsgLength = (UINT) m_strMessage.GetLength();
m_pFileData = new BYTE[m_nMsgLength];
// Fills the m_pFileData with the String
m_pFileData = (BYTE*) (LPCTSTR) m_strMessage.LockBuffer();
for(UINT i = 0; i < m_nMsgLength; i += 16)
{
pdwTemp = (DWORD*)&m_pFileData[i];
pdwTemp[0] = (pdwTemp[0] - m_dwS[2 * R + 2]);
pdwTemp[2] = (pdwTemp[2] - m_dwS[2 * R + 3]);
for(int j = R; j >= 1; j--)
{
DWORD temp = pdwTemp[3];
pdwTemp[3] = pdwTemp[2];
pdwTemp[2] = pdwTemp[1];
pdwTemp[1] = pdwTemp[0];
pdwTemp[0] = temp;
DWORD t = LeftRotate((pdwTemp[1] * (2 * pdwTemp[1] + 1)),
OffsetAmount((DWORD)(log((double)W)/log(2.0))));
DWORD u = LeftRotate((pdwTemp[3] * (2 * pdwTemp[3] + 1)),
OffsetAmount((DWORD)(log((double)W)/log(2.0))));
pdwTemp[0] = (RightRotate((pdwTemp[0] - m_dwS[2 * j]), OffsetAmount(u))) ^ t;
pdwTemp[2] = (RightRotate((pdwTemp[2] - m_dwS[2 * j + 1]), OffsetAmount(t))) ^ u;
}
pdwTemp[1] = (pdwTemp[1] - m_dwS[0]);
pdwTemp[3] = (pdwTemp[3] - m_dwS[1]);
}
m_strMessage.UnlockBuffer();
// Displays the String after being encrypted
m_strMessage = (LPCTSTR) m_pFileData;
m_pFileData = NULL;
m_nMsgLength = 0;
pdwTemp = NULL;
UpdateData(FALSE);
}
Any ideas?
Thanks!!
|
|
|
|
|
I've noticed three errors:
m_pFileData = (BYTE*) (LPCTSTR) m_strMessage.LockBuffer(); This does not copy the contents of m_strMessage into m_pFileData : instead, it simply makes m_pFileData point to those contents. I don't think your crash is due to this, but it's an error nevertheless.
m_pFileData = NULL; You're having a memory leak here, as m_pFileData should be deleted with delete [] m_pFileData (once you've fixed the first error.) Again, your crash is probably not related to this.
for(UINT i = 0; i < m_nMsgLength; i += 16) This is most likely what's causing the problem. You're handling the data as contiguous blocks of 16 bytes, but this won't be always the case: Consider for instance that m_nMsgLength is 20: then your code will overwrite 12 bytes past the end of m_pFileData . You should be adjusting the space allocated with m_pFileData to cope with this situation (and of course correct first the other errors.)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I didn't finish reading the code, but here's the first problem at least:
m_pFileData = new BYTE[m_nMsgLength];
m_pFileData = (BYTE*) (LPCTSTR) m_strMessage.LockBuffer();
Allocates a buffer, and immediately looses the only pointer to it. Then, at the end:
m_strMessage.UnlockBuffer();
m_strMessage = (LPCTSTR) m_pFileData;
Unlocking the buffer tells CString that you're no longer holding any pointers to its internal data (which you in fact are), and that it can go ahead and free it if it needs to. Think for a bit about what's going to happen when it frees that internal buffer, and then tries to copy into a new buffer whatever happens to be in the memory where the old buffer once was...
Like i said, i didn't read through the rest of the code, (could you indent pls?) but this is definately a place to start...
--------
PMGRE --Shog9 --
|
|
|
|
|
Thanks to both of you! using strcpy instead of using a pointer and locking the buffer helped, plus I didn't need to delete m_pFileData I was just trying to NULL it but that was not needed..
Thanks again.
|
|
|
|
|
Hi I am trying to implement a simple Bulk Row Fetching mechanism using the DoBulkFieldExchange function.
My problem is that I get a "????????????? ODBC ????? ?????????" message box on a CRecordset.Open command. I have implemented a derived CRecordset class for a simple table in sybase that has two columns and three rows of data.
Below are my header and implementation files.
// BulkFetch.h
class CBulkFetch : public CRecordset
{
public:
CBulkFetch(CDatabase* pDatabase = NULL);
DECLARE_DYNAMIC(CBulkFetch)
// Field/Param Data
//{{AFX_FIELD(CBulkFetch, CRecordset)
LPSTR m_fname;
LPSTR m_lname;
//}}AFX_FIELD
long *m_fnameLength;
long *m_lnameLength;
CString parm;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CBulkFetch)
public:
virtual CString GetDefaultConnect(); // Default connection string
virtual CString GetDefaultSQL(); // Default SQL for Recordset
// virtual void DoFieldExchange(CFieldExchange* pFX); // RFX support
//}}AFX_VIRTUAL
virtual void DoBulkFieldExchange(CFieldExchange* pFX); // RFX support
// Implementation
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
};
// BulkfFetch.cpp
IMPLEMENT_DYNAMIC(CBulkFetch, CRecordset)
CBulkFetch::CBulkFetch(CDatabase* pdb)
: CRecordset(pdb)
{
////{{AFX_FIELD_INIT(CBulkFetch)
m_fname = NULL;
m_lname = NULL;
m_nFields = 2;
////}}AFX_FIELD_INIT
m_fnameLength = NULL;
m_lnameLength = NULL;
m_nDefaultType = snapshot;
m_nParams = 0;
}
CString CBulkFetch::GetDefaultConnect()
{
return _T("ODBC;DSN=ARBOR_CUST1_PROD");
}
CString CBulkFetch::GetDefaultSQL()
{
return _T("[guest].[ashish_test]");
}
void CBulkFetch::DoBulkFieldExchange(CFieldExchange* pFX)
{
////{{AFX_FIELD_MAP(CBulkFetch)
pFX->SetFieldType(CFieldExchange::outputColumn);
RFX_Text_Bulk(pFX, _T("[fname]"), &m_fname,&m_fnameLength,30);
RFX_Text_Bulk(pFX, _T("[lname]"), &m_lname,&m_lnameLength,30);
////}}AFX_FIELD_MAP
}
/////////////////////////////////////////////////////////////////////////////
// CBulkFetch diagnostics
#ifdef _DEBUG
void CBulkFetch::AssertValid() const
{
CRecordset::AssertValid();
}
void CBulkFetch::Dump(CDumpContext& dc) const
{
CRecordset::Dump(dc);
}
#endif //_DEBUG
Thanks a lot.
ashish
|
|
|
|
|
I want only one column, and not a blank one in addition to col 0 that appears by default. I am doing:
m_list1.InsertColumn(0,"Keywords",LVCFMT_LEFT,800);
m_list1.SetColumnWidth(0, LVSCW_AUTOSIZE_USEHEADER);
m_list2.SetExtendedStyle(LVS_EX_CHECKBOXES);
m_list2.InsertColumn(0,"Options",LVCFMT_LEFT,800);
m_list2.SetColumnWidth(0, LVSCW_AUTOSIZE_USEHEADER);
if(NULL != m_list1.GetSafeHwnd())
{
m_list1.MoveWindow(100,100,200,400);
m_list2.MoveWindow(450,100,200,400);
}
Inspite of the great width specified, a 200 wide list control shows up with the col 0, plus a little part of another column (a blank one) showing. If I make the col width 100, then theres only one visible column. However I needa width of 200. What is to be done in this case?
Thanks,
ns
|
|
|
|
|
I had to get rid of the autosizeheader line, which actually someone here at CP had suggested when my setting the width didnt work ,> however right now, setting the width to 800 is doing the job...
Thanks anyways!
ns
|
|
|
|
|
Does anyone know a better way to get a single column in a list control without just sizing it bigger than the dialog?
|
|
|
|
|
... another app exclusively?
I need to be able to open a file for "reading" that is already opened exclusively by another app, that is writting to that same file.
I've used tools that do this, but can't figure out how it is done.
Can someone point me in the right direction?
Thanks much!
craig knutson
dakotaknut@yahoo.com
craigk
|
|
|
|
|
Hello,
I will really appreciate any input on the following problems.
I am implementing the Database operations using MFC .. and using DAO. The problem is when the program goes to get the data, it just quits. THIS HAPPENS ONLY ON SOME COMPUTERS. It just simply quits! This was happening when I was implementing ODBC in the same program. The screen where it is supposed to display the data, when it goes to the screen .. it just disappears and terminates. My database is in .mdb format.
The other problem is that it says "Unrecognized database format" if I write my database in Access 2000.
I am wondering if there are some win registry entries that are not being updated or something.
Thank you very much for your time and help !
Sincerely,
Anjum.
|
|
|
|
|
a3gupta wrote:
The problem is when the program goes to get the data, it just quits. THIS HAPPENS ONLY ON SOME COMPUTERS.
Does your installation program for your application include installation of DAO runtime components?
a3gupta wrote:
My database is in .mdb format.
The other problem is that it says "Unrecognized database format" if I write my database in Access 2000.
What version of MFC do you use?
|
|
|
|
|
Thank you very much for your response.
I am installing following files in my installation program:
DAO350.DLL
DAO2535.TLB
MSJTER35.DLL
MSJINT35.DLL
MSVCRT40.DLL
MSJET35.DLL
MSRD2X35.DLL
MSJTER35.DLL
MSJINT35.DLL
VBAJET32.DLL
VBAR332.DLL
I am using Visual Studio 6. So .. Visual C++ 6. It works fine on my computer .. but doesn't work on somebody elses computer. They don't have Visual Studio installed .. But ... I run the installation program. I am making the setup program using Installshield for Visual C++ 6.
Thank! Hope this infomation will be useful.
Sincerley,
Anjum.
|
|
|
|
|
I am not sure, if this article Q236991 will solve the all your troubles, but at least second one should be rectified.
|
|
|
|
|
Hi,
I had the same problem with "Unrecognized database format" and
I solved it like this:
In InitInstance() of my App-Class I put the follwing line:
AfxGetModuleState()->m_dwVersion = 0x0601;
That was it.
For further Information see the follwing Article on MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmsj00/html/cpp0100.asp
I hope that helps you.
MS
|
|
|
|