|
Hi all,
please help me to resolve error of Access is Denied.
When server is Windows server 2008 and client machine is Windows xp Professional with service pack 3.
in network window when i want to access this client machine its popup a username and password window to access.
in my code if i use RegConnectRegistry without entering username password in network window for xp client,this return a error of Access Denied.
if i use RegConnectRegistry after entering username password in network window for xp client,
than its execute,no error return but after the i want to open the registry by RegOpenKey.
now this return error access denied.
please help me what can i do.
thanks.To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi...
I am using Visual Studio 2008, and i am working with a multiple document application, it is CView Based. In CView how can i add cbutton?
My code is,
CRect button1Rect;
CButton button1;
button1Rect.SetRect(250,75,400,100);
button1.Create(_T("HI"),WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,button1Rect,this,1);
button1.ShowWindow(SW_SHOW);
the above code not showing the cbutton.
but if the code is like,
CRect button1Rect;
CButton button1;
button1Rect.SetRect(250,75,400,100);
button1.Create(_T("HI"),WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,button1Rect,this,1);
button1.ShowWindow(SW_SHOW);
AfxMessageBox(L"Button created");
It shows the button.
How to solve this problem?
Any help will be appreciated.
Thanks...G.Paulraj
|
|
|
|
|
Umm, your problem is that if you show a message box you see the button on your view but if you don't then there's no button? My guess would be that you need to update your view or maybe your button (make it redraw itself). If you don't bring up the message box but after creating the button you somehow force the view to redraw, like, moving another window around on top of it, do you see your button appearing out of "nowhere"? If yes, then try calling RedrawWindow on your view OR on your button after it was created. > The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
yes..
You are correct. i redraw the window.
Thanks...G.Paulraj
|
|
|
|
|
Did you try calling "Invalidate(false)" function?modified on Monday, February 8, 2010 10:16 AM
|
|
|
|
|
Hi,
button1Rect and button1 should be members to view class. Then only the button will display.Try with that.
cheers!.nss
|
|
|
|
|
The button object has to be a member of your CView derived class. Then, I assume you can override OnInitialUpdate() function and put the code for creating the button in that.
|
|
|
|
|
In my application i need to add grid with specific coloum selection property
is there any method to add check boxes in coloumn headers.
Thanks in advance...
pk
|
|
|
|
|
|
Hi all,
I am trying to convert CString value to double value. see below
if(pos == 0)
{
assfile.ReadString(nextLine);
pos = nextLine.Find(_T(","));
temp = nextLine.Left(pos);
dValue = _wtof(temp);
if (dValue < minval)
minval = dValue;
}
i am using _wtof() to convert string to double. The problem here is after conversion the double value has more decimal points every time.
for example
str = "234.555"
after conversion the double value will be like this 234.55500005
i want the double value to be as it is in the string. how to resolve this?
Thanks in advance.
Regards,
kumarhi
|
|
|
|
|
You can't control that. This is due to the precision of the double which is not perfect. I suggest you google about "floating point precision" to learn more about the subject (see this[^] for instance).
|
|
|
|
|
Did you try:
double dValue = 234.55500005;
long lValue = dValue * 1000;
dValue = lValue / 1000;
|
|
|
|
|
I doubt! "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
As Cedric Moonen said, you cannot control this.
But you can always choose what you want to be displayed by formatting the data.
For example, printf("%.3f", dValue); will only show you 3 decimal digits.
The same formatting can also be used with CStringT::Format and other APIs like StringCchPrintf .
|
|
|
|
|
Hi,
I need to develop a software which will get installed in the user pc and reads the phone number from the attached modem. This phone number will be the users own number not the incoming one. Is it possible using Ms-Comm control?
Regards,
J
|
|
|
|
|
emmmatty1 wrote: Is it possible using Ms-Comm control?
My experience with the MSComm control makes me recommend you to not use the MSComm control at all. It introduces more problems than it solves. Writing the communication with a device such as a modem is fairly simple. For an example on how to do serial communication you can have a look here[^].
If you have any requirements on performance regarding speed you cannot use MSComm.
Whether you use the MSComm control to communicate with the modem or you roll your own solution is up to you. But I'm very curious on how you're planning on getting the phone number of the user where the modem is installed. I am not aware of such functionality or any AT command that supports it.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi,
i need some help to bring a dialog to top, but only for him parent dialog.
I use this to set child dialog on the top, but he still on top for all applications:
::SetWindowPos(pWaitDlg->m_hWnd, HWND_TOP,0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
but i need it to be only for him's parent dialog on top, not for all, this is a small dialog with progressbar on it!
Thanks for any help!!
Arrin
|
|
|
|
|
I think you can try giving handle to the parent window instead of HWND_TOP as second parameter.
|
|
|
|
|
Hi,
thanks for answer, that is!
Only one issue is there , first here is code:
CProgressDlg dlgProgress;
dlgProgress.Create(CProgressDlg::IDD, GetDesktopWindow());
this->EnableWindow(FALSE);
::SetWindowPos(dlgProgress.m_hWnd, this->m_hWnd,0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
dlgProgress.ShowWindow(SW_SHOW);
dlgProgress.CenterWindow();
dlgProgress.BringWindowToTop();
There is only one thing that is not ok, i can switch between this two dialogs if i click they icons in the taskbar,
in this case is this little "dlgProgress"(simple Dialog with progressbar) Dialog in the background of hims parent(if i click on parent icon),
and that is what i need to avoid! This little dlgProgress must be on top of hims parent until the process is finish!
Thanks for help!
Arrin
|
|
|
|
|
May be you can remove the call to GetDesktopWindow().
I think dlgProgress.Create(CProgressDlg::IDD) would be enough.
In addition to that, I suppose dlgProgress has to be a member of the parent dialog.
|
|
|
|
|
From the msdn page for SetWindowPos: http://msdn.microsoft.com/en-us/library/ms633545(VS.85).aspx,
HWND_NOTOPMOST
Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window.
This sounds a lot like what you want.
Iain.I have now moved to Sweden for love (awwww).
|
|
|
|
|
Hi,
thanks for answer!
Still need help!
regards
Arrin!
|
|
|
|
|
Arrin wrote: Still need help!
Then I need a question to help with!
Did my answer not solve your problem?
Did you realise you asked the wrong question?
Was my answer complete rubbish?
Iain.I have now moved to Sweden for love (awwww).
|
|
|
|
|
I want to know what sort of complexities may arise, if we port an existing application(huge application having so many threads connected to various components) onto a multi-core system.What all the things that can be taken care of while developing an application in order to make it run efficiently in multi-core environment too? If someone have the experience in handling such scenario, please suggest.
|
|
|
|
|
You won't find new bugs by moving from a single core to a multi core.
But you will find the same bugs you already had will manifest more often...
I know that's a short answer, but the idea is not a big one!
Iain.I have now moved to Sweden for love (awwww).
|
|
|
|