|
Deian,
Have a look at this Same problem I perhaps? Only way I could get round it was with GetCurSel( LPSYSTEMTIME pDateTime ) which seemed to return the right result.
Adam.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
Thanks, I will try that solution ))
Greetings,
Deian
|
|
|
|
|
Hello there,
I run my program from CD, when my program wants to open the database from CD ... my program crashes
I think it's for strange file( .LDB ) because the database can not make .LDB file beside the access database !
How can i change the .LDB path ?????
Please help me !!!
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
The .LDB file is for record locking. Open the database for exclusive use and no ldb file will be generated. See MSDN KB Q208778 (Access2000) or Q136128 (Access95/97) for more info.
Cheers
Steen.
"To claim that computer games influence children is ridiculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
This seems like a simple question but I just wanted to know peoples thougths on it.
Is it better to load an entire Megabyte file all at once and parse it through memory, or is it better to parse through it a line at a time consuming minimal memory?
I implemented the second method for large file downloads to an embedded system but I would love to hear what others thoughts are on this issue.
Thanks,
Brian
|
|
|
|
|
You can use memory mapped file.
Pavel
Sonork 100.15206
|
|
|
|
|
You should use file mapping for big files. Otherwise, reading a file one line at a time will have the same result as reading the entire file such as in binary mode using C++.
Kuphryn
|
|
|
|
|
Hi.
Is it possible to sort a map *by value* instead of by key? Moreover, is it possible to declare a map that with a custome sorting algorithm that sorts accord to value? If yes, please give a sample of the sorting function. I can create the function object, but I need to know the parameter.
Thanks,
Kuphryn
|
|
|
|
|
You cannot sort a map by value (except in the trivial cases in which key order equals value order). What are you trying to do? If you explain it in more detail maybe we can give an alternative.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Are you sure that you want to use a std::map? Maybe another container is better for your needs?
You could use a std::vector of pairs, and sort this using either first or second.
|
|
|
|
|
A map is a key-value containter. The point of a map is to sort by key and look-up items according to their keys. You may use a second map with first one's values as keys and depending on the situation you use either of them.
Best regards,
Alexandru Savescu
|
|
|
|
|
Okay. Thanks.
The algorithm I am working on a probably simple for most programmers. Nonetheless, I want to come up with my own solution instead of posting it and have someone else solve it.
I have implemented a working solution.
Hey, I always appreciate help from members. Sorry about the late reply. CodeProject server was down yesterday evening.
Kuphryn
|
|
|
|
|
When I set the editbox to read-only, its backgroud color will be gray. Can I set it to another color?
Thanks in advance.
|
|
|
|
|
Try to chenge the backcolor with the Erase Background message....
Best Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
You can!!
handle the WM_CTLCOLOR message and check if the handle of the window passed to the handler function is equal to the handle of the editbox whose colour you want to change.
Then set the handle hbr to the brush you want to use as your background. Call SetBkColor() to change the background colour used when painting your text.
Look up WM_CTLCOLOR in MSDN!!
hope this helps
Adam.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
I have tried to handle the WM_CTLCOLOR message, but failed. When the editbox is set to read-only, it will not send the WM_CTLCOLOR to its parent window.
Anyway, thanks a lot.
|
|
|
|
|
Hmm.. I am doing the same... the following code paints a white background in IDC_USER and IDC_KEY which are read only (I didn't want them to be gray) and paints everything else with a blue background. They are Enabled though (i.e. EnableWindow(TRUE)).
HBRUSH CCncloginDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
HWND hWnd=pWnd->GetSafeHwnd();<br />
if(nCtlColor==CTLCOLOR_EDIT || hWnd==GetDlgItem(IDC_USER)->GetSafeHwnd() || hWnd==GetDlgItem(IDC_KEY)->GetSafeHwnd())<br />
{<br />
pDC->SetBkColor(RGB(255,255,255));<br />
hbr=(HBRUSH)m_brBrush;<br />
}<br />
else<br />
{<br />
pDC->SetBkColor(RGB(128,128,200));<br />
hbr=(HBRUSH)m_brBrush2;<br />
}<br />
return hbr;<br />
}
Sounds mysterious! If you work out what's up then post it. I would be interested to hear what it was.
Adam.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
How do I initialize the dialog's list box in the View's member function ?
Actually, I want to display a record in the listbox in the view button down handler fucntion?
When I try to do, my program aborts in the listbox.AddString(...) fucntion?
What could be possible wrong?
|
|
|
|
|
Sounds like the listbox hasn't been created yet. If the listbox is within a dialog class, you shouldn't initialise it until you receive a WM_INITDIALOG message - the OnInitDialog() method is called. So, in this case you could pass the relevant information to the dialog constructor, and then in the OnInitDialog() method of the dialog class, initialise the listbox there.
Dave
|
|
|
|
|
Yes, u are correct.
But I would like to initailize with the data I read from the database. I am reading the records in the View's member function, so how do i pass the values read to the listbox?
|
|
|
|
|
The same principle applies:
Something like:
void CMyView::DoSomething()
{
CMyDialog dlg( this );
for ( each value in database )
{
CString strValue = GetValueFromDataBase();
dlg.AddValue( strValue );
}
if ( IDOK == dlg.DoModal() )
{
// Do something with it
}
else
{
// Panic / shoot user
}
}
class CMyDialog : public CDialog
{
// All the usual stuff
public:
void AddValue(const CString& strValue);
private:
CStringList m_lstValues;
};
void CMyDialog::AddValue(const CString& strValue)
{
m_lstValues.AddTail( strValue );
}
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// Add the values
for ( POSITION pos = m_lstValues.GetHeadPosition() ; pos != NULL ; )
m_lstCtrl.AddString( m_lstValues.GetNext( pos ) );
return TRUE;
}
Dave
|
|
|
|
|
I have a standard window which I use as a aplitter. I want to give the window a beveled look like you get in VC++. I am trapping the WM_PAINT message to draw my own customized window but I dont have any idea ho to get the beveled look like VC++ splitter. What technique should I use to do that. I am not using MFC. Please help.
Also can somebody suggest me any help how to draw XP style menu using Win32.
Thanks in advance
|
|
|
|
|
checkout the DrawEdge() gdi function.
|
|
|
|
|
Hey Folks,
I just got off the phone with the security guy of a large american company who uses our product, who requires that our product transmit data "encrypted" through the pipes.
Currently, our Client-Server application has no encryption whatsoever, when a user logs into our server, the client sends the MD5 hash of the password to the server to be verified, yadda, yadda.
Our customer only requires the logon to be encrypted (the actual data being stored in our product isn't all that sensitive), which makes life easier, but in time, who knows, another customer MAY want the entire session to be encrypted.
With all this stuff new to me for the most part, I did some looking around, and found that CryptoAPI is included in Win2000 etc. Problem is, our product has to run on older platforms too... 95/98/98/NT/2K/XP... Does anyone have any suggestions?
Thanks,
Mike.
|
|
|
|
|
Use Crypto++[^]: robust, lots of documentation, freeware, no export restrictions... it has it all!
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|