|
Hi.
Maybe you can use
BOOL UpdateData(
BOOL bSaveAndValidate = TRUE
);
UpdateData(TRUE); means refresh the value of control to the variable
and UpdateData(FALSE); means put the value of the variable to the control.
|
|
|
|
|
if u call the SetWindowText() api, it will be update the UI display itself.
if u only modify the control's member val, u should call UpdateData(false) to force DDX to update UI
|
|
|
|
|
Hello,
I am trying to create a Windows service with the following WMI code from MSDN(except reading the credentials which I am hard coding):
Example: Getting WMI Data from a Remote Computer
- When I run this code as application, it runs fine. When I run this code as Windows service, it gives me "Access Denied" in ExecQuery().
- In ConnectServer(), when I pass NULL as username/password, as application it runs fine but in service it gives "Access Denied". Is there API or something to know the username and password used to start the service , so that I can use it in ConnectServer().
Please help.
|
|
|
|
|
hackcrackvirus wrote: I am trying to create a Windows service with the following WMI code from MSDN(except reading the credentials which I am hard coding):
Example: Getting WMI Data from a Remote Computer
- When I run this code as application, it runs fine. When I run this code as Windows service, it gives me "Access Denied" in ExecQuery().
Hi,
Yes the Microsoft sample may return 0x80070005 on Windows 2003/Vista/Win7. This Help and Support article addresses the issue:
WMI Sample in MSDN to remotely target a machine results in an 0x80070005 - Access Denied errorr[^]
Best Wishes,
-David Delaune
|
|
|
|
|
- In ConnectServer(), when I pass NULL as username/password, as application it runs fine(i.e. uses login credentials) but in service it gives "Access Denied".
Please help.
|
|
|
|
|
Maybe simple but ..
Using VC Studio 2003.
MFC cstring related to formating a UINT64 in hex .
CString cstrFormat;
WORD wRow,wCol;
UINT64 n64Address = 0x100000000;
char * pcFmt;
cstrFormat.Format (pcFmt, n64Address);
pCtrl->SetItemText( wRow, wCol, (LPCTSTR) cstrFormat);
Result of CstrFormat is 0 , upper bytes are truncated to a 32 bit result in cstring
So I know I can use printf ... but their must be a way to get the format to work.
|
|
|
|
|
something like this?
cstrFormat.Format("%I64", *n64Address);
|
|
|
|
|
Thanks,
You sent me down the right path.
cstrFormat.Format("%I64d", *n64Address); works
|
|
|
|
|
Hi,
I am using VC7. and make thumbnails of images when we call Bitmap::FromFile(L"C:\\Test.bmp") and return value store in Bitmap pointer. It return 0x0000000 address and we get error code 8. I have included gdiplus.h header file and GdiPlus.lib file.
But it is working well with other downloaded sample program
|
|
|
|
|
need to check your code. can you post code snippet here
|
|
|
|
|
I have fully checked and also only call that funcyion
but problem still
|
|
|
|
|
Do u have the "GdiplusStartup"?
|
|
|
|
|
Hi,
I am using VC7. and make thumbnails of images when we call Bitmap::FromFile(L"C:\\Test.bmp") and return value store in Bitmap pointer. It return 0x0000000 address and we get error code 8. I have included gdiplus.h header file and GdiPlus.lib file.
But it is working well with other downloaded sample program
ghy
|
|
|
|
|
Hi,
I am using VC7. and make thumbnails of images when we call Bitmap::FromFile(L"C:\\Test.bmp") and return value store in Bitmap pointer. It return 0x0000000 address and we get error code 8. I have included gdiplus.h header file and GdiPlus.lib file.
But it is working well with other downloaded sample program.
ghy
|
|
|
|
|
HI,
How can i change the width of Crect variable..
ie CRect rect;
need to change the width of rect...
|
|
|
|
|
InflateRect (n,0);
or, it's only four members...
rc.left -= 3;
rc.right += 3;
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
HI Guys iam converting a CString to LPSTR iam getting only first charcter what can any body suggest me how to get complete string I tried the folowing i did n't get it
CString str=_T("Hello");
LPSTR ptr=str.GetBuffer(0);
iam getting only first character into ptr and tried other also its not working
LPSTR ptr=str.GetBuffer(str.GetLength());
|
|
|
|
|
Please, read the documentation about the GetBuffer to understand why you should never call this function without knowing what it does.
Furthermore, CString provides a cast operator that returns the same type as the GetBuffer function.
And how are you checking that you only get the first character ? Why do you need to store that into a LPSTR variable ?
|
|
|
|
|
Cedric Moonen wrote: CString provides a cast operator that returns the same type as the GetBuffer function.
CString has an LPCTSTR operator, whereas GetBuffer() returns an LPTSTR (which is not const ).
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
you need to call release buffer also
|
|
|
|
|
I bet the content of CString is Unicode, and LPSTR is a multibyte string.
Try casting to LPTSTR instead.
Even better, if you don't support Win98 and older versions, just drop this "T" stuff and always use wide strings instead.
|
|
|
|
|
Whenever I right-click on my CDockablePane, a context menu (Floating, Docking, Tabbed Document, Auto Hide, Hide) appear. How do I disable this?
|
|
|
|
|
Your in luck! I am currently working on a CDockablePane derived class. You need to overide CPane::OnShowControlBarMenu[^]
Just tested it and it works. The really wierd thing is... the MSDN says:
TRUE if the menu can be displayed; otherwise, FALSE.
But... I had to do the exact opposite! Can you confirm this in your code?
Best Wishes,
-David Delaune
|
|
|
|
|
CFieldPane is derived from CDockablePane.
BOOL CFieldPane::OnShowControlBarMenu(CPoint point)
{
return TRUE;
}
Nothing happens. The context menu still appear
|
|
|
|
|
I did this.
BOOL CFieldPane::OnShowControlBarMenu(CPoint point)
{
return FALSE;
}
.. and the context menu doesn't appear anymore. Thanks David
|
|
|
|