|
I use adodb com object in my vc projects and I call SQL SERVER Sp by adodb com that returns many query too
the problem occurs when my SQL SP contains insert , delete , or update .
at this time I can't get results of SP query
example :
ALTER PROCEDURE [dbo].[MySP]
@Par1 VARCHAR(50),
@Par2 INT
AS
INSERT INTO MyDB.dbo.MyTable
(
Field1,
Field2
)
VALUES
(
@Par1,
@Par2
)
SELECT 1 AS RESULT -- I can not get this value from VC pragram
bec I used before INSERT
|
|
|
|
|
Please, take a deep breath and then try to elaborate your question (if is it a question...) a bit.
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]
|
|
|
|
|
If I change style of Combobox to Drop List, its backcolor is changing to grey.
I want Drop List (readonly) with white background same as the one in VC++ for selecting Release/Debug configuration.
Also I would like to have border around it.
How to do this? Any suggestion would be greatly appreciable..
|
|
|
|
|
Create a class that derives from CComboBox .
Override the OnCtlColor virtual function.
Check for CTLCOLOR_LISTBOX in the 3rd parameter.
Return the required brush.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
In addition to Superman's reply...
1/ There's a reason the colour has changed - the behaviour has changed. By overriding the colour back to white, you are now lying to your users. They will go "ahah, ah enabled box we can type it. Look, it's white!". And then they will get very frustrated. Only override this if you are REALLY sure you can cope with the potential confusion - and people issuing bug reports against you. Or worse - not giving you money.
2/ Don't just go for RGB(255,255,255). What if your customer is stuck in the 70s and likes a green on pink colour scheme? Who are you to say it's ugly? Please pick one of the system colours. That helps you - you can use GetSysColorBrush and be lazy!
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi ,
How can i make my static text control BOLD....where even im not able add a member variable to IDC_STATIC....
|
|
|
|
|
toolsrnd wrote: How can i make my static text control BOLD....where even im not able add a member variable to IDC_STATIC....
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]
|
|
|
|
|
Try something like this:
CFont fnt;
LOGFONT lf;
::ZeroMemory(&lf, sizeof(lf));
lf.lfHeight = 14;
lf.lfWeight = FW_BOLD;
::lstrcpy(lf.lfFaceName, "Tahoma");
fnt.CreateFontIndirect(&lf);
GetDlgItem(IDC_STATIC_CTRL)->SetFont(&fnt);
fnt.Detach();
Modifiy lf.lfHeight and lf.lfFaceName to your liking. There are other properties in the LOGFONT structure you might want to modifiy - look it up in the documentation.
|
|
|
|
|
Thanks Michael it really helped me.....
|
|
|
|
|
The wizard does not like static controls with the ID IDC_STATIC.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
That's reasonable however, since many controls may share the IDC_STATIC identifier.
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]
|
|
|
|
|
Wonder why these controls were not given IDC_STATIC1, IDC_STATIC2 etc. like all the other controls.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I suppose they (Visual Studio Development team) assume that you usually don't need to identify them (after all they're static...). Probably most users don't care about.
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]
|
|
|
|
|
THEY could've avoided a lot of confusion especially with beginners.
What were they trying to save??? IDs ???
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
«_Superman_» wrote: What were they trying to save??? IDs ???
Yes, I suppose.
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]
|
|
|
|
|
Hi .
May i know how can i make dropdown list(combo) non-editable ...
|
|
|
|
|
Hello Pradeep,
Take properties and change combo type to "Drop List".
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
ya thanks for ur answer...
may i know how can i read registry values.....
please do"nt mind im beginner in MFC
modified on Wednesday, March 11, 2009 10:21 AM
|
|
|
|
|
Here you go[^]
---
"Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot
|
|
|
|
|
I want to retrive the data from the end in a map.
Generally for retriving we write below code for getting data from begining.
so please suggest how can we get the data from the end in a map???
map<int,cstring>::iterator itera;
for(itera = m_mapFinalSortVirusData.begin();itera != m_mapFinalSortVirusData.end();itera++)
{
int nCount= itera->;first;
CString strvirname = itera->;second;
CString str = "";
str.Format("%d %s",nCount,strvirname);
AfxMessageBox(str);
}
|
|
|
|
|
see here [^].
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]
|
|
|
|
|
Not exactly correct: when iterating in reverse mode, you should replace the usual begin() by rbegin() and the usual end() by rend(). Thus rend doesn't return you the last element in your map but point before the first element.
|
|
|
|
|
Check out the example in the linked page.
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]
|
|
|
|
|
Use a reverse iterator: it is the same principle as an iterator, except that it starts from the end of the container. You have to use the rbegin function (which returns the begining of the reverted map, aka the end of your original map).
|
|
|
|
|
brucewayn wrote: so please suggest how can we get the data from the end in a map???
What about something like:
itera = m_mapFinalSortVirusData.end();
itera--;
int nCount= itera->first;
CString strvirname = itera->second;
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|