|
Well, you can't anyways because you have no programming experience.
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
Man - reading this forum today is better than Dilbert
Glano perictu com sahni delorin!
|
|
|
|
|
Hi everyone,
Is there are way to set a directory share mode using Win32 APIs in C++? I looked but I did not see any place that showed how to do that.
Thanks in advance.
|
|
|
|
|
Check out MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/windows_api_reference.asp
Check out my website for more links on software development.
http://www.dslextreme.com/users/kuphryn/links.html
Kuphryn
|
|
|
|
|
This sounds like a job for...DACL.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Can you set up retriggerable timers in VStudio?
Jerry
|
|
|
|
|
Sure, just use these WinAPIs:
m_hTimer = CreateWaitableTimer(NULL, FALSE, NULL);
LARGE_INTEGER DueTime;
DueTime.QuadPart = 900;
SetWaitableTimer(m_hTimer, &DueTime, 1000, NULL, NULL, 0);
To stop timer call:
CancelWaitableTimer(m_hTimer);
And just call SetWaitableTimer again to start it.
|
|
|
|
|
unsigned int it = V_INT(&PhysicalMemoryVal);
Does this actually make sense here or is there some problems with the pointers
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
Interesting.
What is PhysicalMemoryVal? Looks like you are casting its memory address, not what is occupied in memory.
kuphryn
|
|
|
|
|
Thats what I tought, how do I get the proper value please????
Oh by the way PhysicalMemoryVal is the amount of memory the operating system has available, you get it from WMI classes
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
Given that PhysicalMemoryVal is a memory address, one possible solution is pointer.
unsigned int *pValue = PhysicalMemoryVal;
Kuphryn
|
|
|
|
|
no good,
now I get and error
error C2440: 'initializing' : cannot convert from 'INT' to 'unsigned int *'
But I dont understand because I use another function in the same way only it return a 16 bit int and there seems to be no problem there
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
Actually!!!!
how do i declare a 64 bit int????????
uint64?????
We have a mathematician, a different kind of mathematician, and a statistician!
|
|
|
|
|
Check out MSDN.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/windows_data_types.asp
Check out my website for more links on software development.
http://www.dslextreme.com/users/kuphryn/links.html
Kuphryn
|
|
|
|
|
roadragedave wrote:
how do i declare a 64 bit int????????
__int64
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
What type is PhysicalMemoryVal ? Your code will only work if it is a VARIANT .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Yes PhysicalMemoryVal is a VARIANT
The value returns something, but its a negative number which doesnt make any sense
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_operatingsystem.asp
at this website you will find a uint64 FreePhysicalMemory
Im trying to plot this against another value uint64 TotalVisableMemorySize
but the values Im getting are way out
My GetProperty method for getting the values works fine, because I have it fetching another value without any problems.
|
|
|
|
|
IWbemClassObject *pClass;
_variant_t v;
HRESULT hr;
hr = pClass->Get(L"FreePhysicalMemory", 0, &v, NULL, NULL);
if (SUCCEEDED(hr) && VT_NULL != v.vt)
TRACE("FreePhysicalMemory = %S KB\n", V_BSTR(&v));
hr = pClass->Get(L"TotalVisibleMemorySize", 0, &v, NULL, NULL);
if (VT_NULL != v.vt)
TRACE("TotalVisibleMemorySize = %S KB\n", V_BSTR(&v));
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
problem:
i need different-shaped buttons to be placed in client area in runtime.
for example:
rightclick in client area opens context menu with options:
round button
triangle button
by clicking on one of the above appropriate button shoud be drawn in client area. this button (like all others created this way) should have all standard properties of a button (CButton)
my experiment:
i've tried with SetWindowRgn but id doesn't work
then i used "common" CreateWindow with BUTTON as parametar and got a nice round button but my program wouldn't accept any further rightclicks (no context menu)
this is my method wich creates squared flat button
(i could create many buttons)
void CpaintView::OnFalseCircle()
{
CPoint point;
GetCursorPos(&point);
ScreenToClient(&point);
CButton *cir = new CButton();
cir->Create("tri",BS_FLAT, CRect(point,CPoint
(point.x+20,point.y+20)),AfxGetMainWnd(),1);
cir->ShowWindow(SW_SHOWNORMAL);
}
and non-working method wich creates one circle and stucks
void CpaintView::OnCircle()
{
CPoint point;
GetCursorPos(&point);
ScreenToClient(&point);
CRect rect(point, CPoint(point.x+50, point.y+50));
CRgn rgn;
Circle *cr = new Circle();
rgn.CreateEllipticRgnIndirect(rect);
SetWindowRgn(rgn,true);
CreateWindow("BUTTON","",WS_CHILD | WS_VISIBLE, point.x-10,point.y- 10,70, 70, *this,(HMENU)101,0,0);
}
thanks
|
|
|
|
|
I am having difficulty with the Microsoft NTFS DACL calls, specifically GetNamedSecurityInfo and GetExplicitEntriesFromAcl. I am using VC++ version 6. I have searched the internet thoroughly, and have found several examples of using GetNamedSecurityInfo but haven't found any examples of how to us GetExplicitEntriesFromAcl. My code seems to get the DACL from GetNamedSecurityInfo okay, but I don't now how to get the individual entries from the pointer to an array of DACLs from the GetExplicitEntriesFromAcl function. I need to roll my own "get NTFS permissions" function to include in other C++ programs. I am just getting up to speed on C++, and need a little tutoring on pointers and pointers to arrays. I believe that GetExplicitEntriesFromAcl returns a pointer to an array of DACLs, as well as the number of DACL entries. An example of how to extract the DACL entries from the pointer information would be appreciated.
|
|
|
|
|
The following code was found in none of the Codeguru thread.
This code is written in c++ and console application and my application is .Net dialog based application.
Could you please help me how to convert the following code to c++.Net . ?????????????????????
<br />
#include <windows.h><br />
<br />
#define DIVISIONS 5<br />
<br />
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;<br />
<br />
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,<br />
PSTR szCmdLine, int iCmdShow)<br />
{<br />
static TCHAR szAppName[] = TEXT ("Checker2") ;<br />
HWND hwnd ;<br />
MSG msg ;<br />
WNDCLASS wndclass ;<br />
<br />
wndclass.style = CS_HREDRAW | CS_VREDRAW ;<br />
wndclass.lpfnWndProc = WndProc ;<br />
wndclass.cbClsExtra = 0 ;<br />
wndclass.cbWndExtra = 0 ;<br />
wndclass.hInstance = hInstance ;<br />
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;<br />
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;<br />
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;<br />
wndclass.lpszMenuName = NULL ;<br />
wndclass.lpszClassName = szAppName ;<br />
<br />
if (!RegisterClass (&wndclass))<br />
{<br />
MessageBox (NULL, TEXT ("Program requires Windows NT!"), <br />
szAppName, MB_ICONERROR) ;<br />
return 0 ;<br />
}<br />
<br />
hwnd = CreateWindow (szAppName, TEXT ("Checker2 Mouse Hit-Test Demo"),<br />
WS_OVERLAPPEDWINDOW,<br />
CW_USEDEFAULT, CW_USEDEFAULT,<br />
CW_USEDEFAULT, CW_USEDEFAULT,<br />
NULL, NULL, hInstance, NULL) ;<br />
<br />
ShowWindow (hwnd, iCmdShow) ;<br />
UpdateWindow (hwnd) ;<br />
<br />
while (GetMessage (&msg, NULL, 0, 0))<br />
{<br />
TranslateMessage (&msg) ;<br />
DispatchMessage (&msg) ;<br />
}<br />
return msg.wParam ;<br />
}<br />
<br />
<br />
|
|
|
|
|
The following code was found in none of the Codeguru thread.
This code is written in c++ and console application and my application is .Net dialog based application.
Could you please help me how to convert the following code to c++.Net . ?????????????????????
[code]
#include <windows.h>
#define DIVISIONS 5
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ;
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("Checker2") ;
HWND hwnd ;
MSG msg ;
WNDCLASS wndclass ;
wndclass.style = CS_HREDRAW | CS_VREDRAW ;
wndclass.lpfnWndProc = WndProc ;
wndclass.cbClsExtra = 0 ;
wndclass.cbWndExtra = 0 ;
wndclass.hInstance = hInstance ;
wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ;
wndclass.lpszMenuName = NULL ;
wndclass.lpszClassName = szAppName ;
if (!RegisterClass (&wndclass))
{
MessageBox (NULL, TEXT ("Program requires Windows NT!"),
szAppName, MB_ICONERROR) ;
return 0 ;
}
hwnd = CreateWindow (szAppName, TEXT ("Checker2 Mouse Hit-Test Demo"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL) ;
ShowWindow (hwnd, iCmdShow) ;
UpdateWindow (hwnd) ;
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
return msg.wParam ;
}
[/code]
|
|
|
|
|
Anonymous wrote:
This code is written in c++...
Actually, it's just plain C code, using the Windows SDK. I've yet to use anything .Net, but plenty of folks here do. Perhaps this forum could also help.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thank you David. I'll post my message over there and see who can help me.
Thank you again.
|
|
|
|
|
Friends,
Can anyone write me a small program in Vc++ to trap a keyboard event and focus it to a desired window, say ms word.
|
|
|
|
|