|
In Visual Studio this will initialize the structure to all zeros similar to ZeroMemory(&f, sizof(struct foo));
|
|
|
|
|
... the code of ... = {0}; may be much faster
(than the code of ZeroMemory(..) )
virtual void BeHappy() = 0;
|
|
|
|
|
My project uses statically linked MFC (using VS 2005), and whenever MFC displays a message box (usually due to a DDV_* call), it is empty. Is there a way to fix this (except for not linking MFC statically, which is right now not an option)?
|
|
|
|
|
I want to create combobox having my own bitmap button arrow image and draw color on every item and also want to draw the border for combobox.
I am thinking to do with OWNERDRAW but I am not getting, can you please suggest any idea to do so.
Thanks
|
|
|
|
|
Did you set the style of ComboBox as CBS_OWNERDRAWVARIABLE?
|
|
|
|
|
Try To create a clase Derived from the BAse CComboBox Class and define ur own objects into ur new Class
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
|
I have a CTreeCtrl variable in CMainFrame class of a MDI application.
I have a sizing side bar for the mainframe.The side bar contains a TreeCtrl.
whenever user double clicks on that tree control I want to handle a task.
Now I want to add NM_DBLCLK message to CMainframe class.
How to do this?
If it is a dialog variable we can add this message from class wizard.
How to add NM_DBLCLK message from the class variable?
|
|
|
|
|
The classwizard is useful, but very limited.
You're going to have to add it by hand.
If you like, look at the code that classwizard adds to a dialog class - then do the same thing to your CMainFrame class. I'm deliberately not showing you the code - just spend two minutes making a plain dialog application with AppWizard.
That said, if you're struggling to work without classwizard, I'm a little surprised you have a tree control directly as a MainFrame child. I'd double check that things are where you expect them to be.
Good luck,
Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
|
|
|
|
|
ON_NOTIFY(NM_DBLCLK, IDC_YOUR_TREE, OnNMDblclkYourTree)
|
|
|
|
|
Ok thank you.
Any have i have solved this problem long back.
|
|
|
|
|
hi Experts,
I m developing an Application which handles a Database with Unicode values.
I have Done all the Settings to run the Unicode Program
1. Added "_UNICODE" in Preprocessor Directives and removes "_MBCS"
2. Entrypoint in Link tab as "wWinMainCRTStartup"
I have write following code to search Records of given Unicode value.
It runs fine but could not give any Records/Result back.
It just out of While loop.
Please Help me out..My code is as follows. :-
<code>
CDatabase cn;
CString FieldValue1,FieldValue2,FieldValue3;
CDBVariant varvalue;
CString csPwd,csUser,csServer,csDBName;
csPwd = "SQLServer2005";
csUser = "sa";
csDBName = "DeccanCollege";
csServer = "DECCANSERVER";
cn.OpenEx(_T("DRIVER={SQL Server};Pwd="+csPwd+";Uid="+csUser +";Database="+csDBName+";Server="+csServer),CDatabase::noOdbcDialog);
TCHAR *m_Voc = (TCHAR*) malloc(50);
m_VocEdit.GetWindowText(m_Voc,50);
CString sqlStr = _T("Select * from Vocablemaster where slvid in(Select slvid from slipvocmaster where binno between 165 and 169) and (VocDescSan like N'%"+CString(m_Voc)+"%')");
CRecordset rec(&cn);
rec.Open(CRecordset::forwardOnly,sqlStr,CRecordset::none);
while(!rec.IsEOF())
{
rec.GetFieldValue((short)0,FieldValue1);
rec.GetFieldValue((short)1,FieldValue2);
rec.GetFieldValue((short)2,FieldValue3);
rec.MoveNext();
}
</code>
I have tried it by another way also by ADODB..
Its code is as follows :-
<code>
HRESULT hr;
CoInitialize(NULL);
try
{
ADODB::_ConnectionPtr connection;
hr = connection.CreateInstance(__uuidof(ADODB::Connection));
if (FAILED(hr))
{
throw _com_error(hr);
}
ADODB::_RecordsetPtr recordset;
hr = recordset.CreateInstance(__uuidof(ADODB::Recordset));
if (FAILED(hr))
{
throw _com_error(hr);
}
connection->CursorLocation = ADODB::adUseClient;
connection->Open(L"Provider=sqloledb;Data Source=DECCANSERVER;"
L"Initial Catalog=DeccanCollege;User Id=sa;Password=SQLServer2005;", L"",
L"", ADODB::adConnectUnspecified);
TCHAR *m_Voc = (TCHAR*) malloc(50);
m_VocEdit.GetWindowText(m_Voc,50);
_variant_t varVoc = m_Voc;
recordset->Open(L"SELECT * from VocableMaster where VocNo like N'%"+_bstr_t(varVoc.bstrVal)+"%'", connection.GetInterfacePtr(),
ADODB::adOpenForwardOnly, ADODB::adLockReadOnly, ADODB::adCmdText);
while(!recordset->ADOEOF)
{
_variant_t var;
var = recordset->Fields->GetItem(L"VocDescSan")->GetValue();
std::cout << static_cast<char *>(_bstr_t(var.bstrVal))
<< std::endl;
recordset->MoveNext();
};
recordset->Close();
}
catch(_com_error &e)
{
std::cerr << static_cast<char *>(e.Description());
}
catch(...)
{
std::cerr << "Unhandled Exception";
};
</code>
Please help me out....
Thnks in advance...
Its urgent for Me..
How can I send Unicode Values through SQL Query and Get the Records..
Is there any another way or any Settings I have to do???
I have never failed,I just found 1000 ways that never works.
Regards,
Victory.
|
|
|
|
|
Dear Friends,
Actually i want to retrieve value of a Input attribute 'id' from the source page [Right click on a Webpage->Select 'View Source'].For example - 'id' of PasswordBox . Right now i able to retieve the values of attributes like- 'type','name','image' by using IID_IHTMLInputElement ->get_type/get_name..... But i unable to retieve value of 'id'.
I'm using VC++ .Please any one help me out in this regard soon
Thankx
|
|
|
|
|
You can use IHTMLElement::getAttribute .
|
|
|
|
|
Thanks dear for your reply.
Actually i'hv already tried this "IHTMLElement::getAttribute" .But i'm getting my application crash as soon as any webpage opened. May be some where else i'm doing mistake in my code ,so that i'm getting crash. Can you please give detail idea, how i should use this '::getAttribute' for retrieving InPut values.
please help soon.
|
|
|
|
|
I think you should start by using a debugger and locate the statement causing the crash. It's hard to help if your program crashes.
|
|
|
|
|
I've got a code snippet that does a bunch of IHTMLElement stuff. What is the URL that you are parsing so that I can verify it will work for you?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi DavidCrow,
Actually i reffered to MSDN and tried to implement in my code .Can you please send any sample code which shows a clear idea of implimentation in VC++
Thanks
modified on Friday, June 25, 2010 2:25 AM
|
|
|
|
|
Hi,
i was looking for sthing which make double variable looks from sth like 1.5487524e027 to 15487.... which means i want to elliminate the exp symbol from the double and have all the digit seen (not a formatting proc for a printing on screen but for calculation) hope u understood me.
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Blood_HaZaRd wrote: not a formatting proc for a printing on screen but for calculation)
That makes no sense.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
ok i'll try to give a little exmp :
let's sy i have a double x= 1.123456789 e09 . i'd like to make it x = 1123456789 without the e right.
is it clear or still fuzzy :s
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Blood_HaZaRd wrote: x= 1.123456789 e09
Blood_HaZaRd wrote: x = 1123456789
Since they are different representations of the same number, both of them are stored, in a double , with the same bit pattern.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
it's clear that they have the same number but God its seems that the fmod doesn't make a correct modulo with double or i missed sth else with that fucntion ...
double alpha = fmod (x, 97)
or with calculator x modulo 97 = 92
it sounds my computer is hollowed
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Blood_HaZaRd wrote: //i have x = 105145010021234567890311169400 which is also equal to 1.0514501002123e+029
That is wrong. As I stated before, double cannot represent such big integer numbers with the required (by you) accuracy:
1.0514501002123e+029 = 105145010021230000000000000000
i.e. there's a big difference with 105145010021234567890311169400.
Bottom line: you cannot use a double for the intended purpose (after all, doubles are 64 bit numbers: they would have 'mystical powers' in order to represent an integer better than a 64 bit int itself).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
May i use a 128 bit integer or double nd if yes how to do that so
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|