|
I have created dsn at runtime but i have to enter the values like- user name, password also at runtime.
So how can i do this in vc++?
plzz help me..
thanks in advance
|
|
|
|
|
In the fourth argument to SQLConfigDataSource() , you could try the UID and PWD keywords. Those may be driver specific, however.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Dear all
I have one double number which i want to round to nearest decimal number in Visual C++.
What is the function to do this
REgards
Monhi
|
|
|
|
|
double d =whatever;
int i = (int)(d + .5);
Please note that, as pointed out by Rage it doesn't work properly with negative numbers See the fix here [^].
-- modified at 8:10 Tuesday 10th July, 2007
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.
|
|
|
|
|
d=-5.6 => i=-5, not -6. Is this ok ?
|
|
|
|
|
he probably should take the absolute value, and then apply it the original sign...
|
|
|
|
|
Rage wrote: d=-5.6 => i=-5, not -6. Is this ok ?
No, of course. I (naively) assumed d > 0 .
But there is an easy fix to account for negative numbers:
i = (int) ( d < .0 ? d -.5 : d + .5 );
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.
|
|
|
|
|
Hi everybody,
i put a ListControl on a dialog and want to catch the LVN_BEGINDRAG Handler.
I know that LVN_BEGINDRAG is a notify message.
I tried already :
ON_NOTIFY_REFLECT(LVN_BEGINDRAG,OnBeginDrag)
and via :
OnNotify(WPARAM w,LPARAM l, ...
{
if(((LPNMHDR)l)->code == LVN_BEGINDRAG)
int ok = 1; --> breakpoint
but i can't catch it
I tried also directly to add a handler via the ressource editor by adding a new handler,
but there i can't find the LVN_BEGINDRAG handler, only DoubleClick, Set & KillFocus ...
How should i catch it?
Big thanks
|
|
|
|
|
Try this:
ON_NOTIFY(LVN_BEGINDRAG, IDC_LISTVIEW1, OnLvnBeginDrag)
This should work.
"Some people believe football is a matter of life and death.
I'm very disappointed with that attitude.
I can assure you it is much, much more important than that. -- Bill Shankly"
|
|
|
|
|
Thanks for your answer
Is it necessairy to create a class from this Listbox from which i want to catch the Drag?
Because it won't work
|
|
|
|
|
|
Thanks for the tutorial,
but i really don't find where i can add the LVN_BEGINDRAG-handler via the classwizard.
I tried a lot of things, but no way to find a LVN_BEGINDRAG.
|
|
|
|
|
You may actually have to type it in by hand
For the handler prototype(s), see ON_NOTIFY and WM_NOTIFY Messages[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
Insert this code to your program
BEGIN_MESSAGE_MAP(CDialogDlg, CDialog)
ON_NOTIFY(LVN_BEGINRDRAG, IDC_LIST2, OnLvnBeginrdragList2)
END_MESSAGE_MAP()
void CDialogDlg::OnLvnBeginrdragList2(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
*pResult = 0;
}
afx_msg void OnLvnBeginrdragList2(NMHDR *pNMHDR, LRESULT *pResult);
|
|
|
|
|
Big thanks ,
my code was completely correct, but probably the CListbox don't support drag&drop,
with CListCtrl it works fine
|
|
|
|
|
I suggest use of CListCtrl on your program its better and very flexible than CListBox.;)
|
|
|
|
|
Hi All,
I calling the method SetEnvironmentVariable and i getting back return value that is nonzero and the last Error does not return to me nothing.
BUT
The Environment Variable is not set !?
What to do ?
Thanks for any help.
|
|
|
|
|
Yanshof wrote: SetEnvironmentVariable
This function will set the environment variable for the current process only. I will not change the whole system's environment variable.
|
|
|
|
|
Thanks,
How can i create new environment variable and/or change exist one data ?
|
|
|
|
|
|
To change system environment variables, modify the HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment registry key.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I wanted to make my program to work on the desktop.
like http://desktop-tools.net/clock.html
i tried many things but i just dont know how did they do it? i dont know about any technique to make it transparant.
Is this possible or is it somesort of rendercode that creates a picture from what you need to have on the desktop and so making everything arround the text transparant? i hope there is a easier way.
Greetz
Rob
|
|
|
|
|
See IActiveDesktop::SetWallpaper for set wallpaper on the desktop.
|
|
|
|
|
thx but then iam setting the whole wallpaper on every refresh of the application :P
isnt there a more useable way then creating wallpapers the whole time?
|
|
|
|
|