|
A SID uniquely identifies a user or a group (i.e., a trustee). What makes you think the computer itself has one?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi there,
Can someone tell me how I can copy a file from one folder to another? I was told it was unwise to use the system() function because of security reasons.
Thanks!
|
|
|
|
|
|
Now why did I think it only works for Visual Basic? Thanks!
|
|
|
|
|
elephantstar wrote:
I was told it was unwise to use the system() function because of security reasons.
To say the least. It's also a holdover from the Unix days. Use CopyFile() as has already been mentioned, or SHFileOperation() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Personally i dont like to use system() for anything
i would reccamend using the function CopyFile() http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/copyfile.asp or CopyFileEx() http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/copyfileex.asp
|
|
|
|
|
How to get rid of this warning?
conversion from 'long' to 'void *' of greater size
i have
void* d = (void*) pos;
'pos' is a long that has a value. After this, 'd' points to that address, it all works well but how can i get rid of the warning?
And since when is void* greater size than long? sizeof() says 4 bytes for both ((
|
|
|
|
|
Are you possibly doing:
long pos = 10;<br />
void* d = (void*)pos;
Instead of:
long pos = 10;<br />
void* d = (void*)&pos;
Bikram Singh
|
|
|
|
|
No, i dont want d to point to pos, i want it to point to the address stored in pos, in that case i would want d to point to address 10 in memory, my code is working as i like, but i cant get rid of warning
|
|
|
|
|
If you're sure of what you're doing, and just want to get rid of the warning, use the #pragma warning() directive.
Bikram Singh
|
|
|
|
|
I got it, it was the 64 bit portability warnings, i have to use LONG_PTR instead of longs to be ready for 64bit stuff
|
|
|
|
|
<font style="color:blue;">long </font>pos; <font style="color:green;">
<font style="color:blue;">void</font>* d = <font style="color:blue;">static_cast</font><<font style="color:blue;">void</font>*>(pos);
TOXCCT >>> GEII power
|
|
|
|
|
thats evil, the the compiler is telling you so. It almost works now, but it won't work (100% anyway) on 64 bit systems.
you shouldn't do
long pos = 10;
it should be
long *pos = (long *)10;
then you can do
void *d = pos;
which is legal.
If you can't change your code like the above, then the work around that others have come up with will work. Just make sure you comment why you had to do it incorrectly so I curse the idiot before you, and not you, when I come in two years from now to make the code 64 bit safe.
64 bit processors are coming. They have been around for more than 10 years, and are slowly making gains on the desktop. Already people are buying them and not knowing it. (though they are running a version of windows that doesn't support the 64 bit parts, eventially they will be running 64 bit windows and not know it)
|
|
|
|
|
Hello,
I'll try to explain what I'm trying to do:
On the about dialog of some programs there is
an email address (often underlined and typed in blue)
that is not a static text, because if you click on it,
a new outlook message
-directed to the desired address- is automatically opened.
How can this be done?
Thankyou in advance,
Marco.
|
|
|
|
|
Search for "hyperlink controls" here.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I made a small project and draw a graph and write a few lines on the display using CScrollView, the scrollbar works when the text exceed the windows.
To work on the print preview, after adding the following, the print preview looks ok, but the display fails even when I move the thumb scroll bar.
void CReaderView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
if (pDC->IsPrinting())
{
int pageHeight = pDC->GetDeviceCaps(VERTRES);
int OriginY = pageHeight * (pInfo->m_nCurPage-1);
pDC->SetViewportOrg(0, -OriginY);
}
CView::OnPrepareDC(pDC, pInfo);
}
I tried to add a WM_VSCROLL, and change the ViewportOrg, seems not working.
I also found if I replace the last line with
CScrollView::OnPrepareDC(pDC, pInfo); the effect is reversed.
Anyone could give me some hints on this?
Thanks.
|
|
|
|
|
I have a VC++ application built in .NET that is generating some very odd errors. I have a call to FindWindow that gets the HWND for another application so that I can manipulate its display parameters. Normally this call works fine. However, when I run the application while recording events or playing them back from a tool called EventCorder, which has hooks for recording and playing back windows events, FindWindow fails. It returns a NULL, and GetLastError returns 126 ERROR_MOD_NOT_FOUND. EventCorder does not alter my path or other environment variables, as I have proven in debugging, so I do not understand why this module would not be found at runtime when EventCorder is running, but can be any other time. I would greatly appreciate any assistance anyone can provide with this very odd error.
|
|
|
|
|
Hi Friends,
Currently i am developing Graphical editor application. In this i have to store the all drawn objects in the ptrlist. Whenever the new object will be drawn then entire list will be refreshed (i.e., redarw the whole things again)... so if the number of objects are increased, this logic mostly affects the performance. For avoiding that i got one pattern from the net "Invalidation/Redraw -- A Graphical Interface Pattern" (http://www.flowerfire.com/cs497rej/et++/InvalidationRedraw.html)
But i don't know how to implement this pattern in VC++. Let me know if anyone knows about this pattern implementation in vc++.
Regards,
Prakash
A Journey of thousand miles must begin with a single step.
|
|
|
|
|
I read the pattern. Basically, it seems to resolve into these major issues:
1. Don't redraw objects in your list unless a new or relocated object uncovered it.
2. Don't draw objects in your list that are completely obscured by another object.
3. While dragging an object, don't redraw all objects on screen, only those that were uncovered - OR - wait until there is some other event, like mouse up, and then redraw objects that were uncovered along the way.
If you keep adding to the invalidation rectangle as an object is moving, and then invalidate that rectoangle after the object stops moving, when your window paint message comes along, the paint rectangle will match your invalidated rectangle. Go through your list and only draw objects that are partially or entirely within that rectangle, and skip all the others. Not 100% efficient, but it will get you going and be better than redrawing EVERYTHING each time you get a paint message.
|
|
|
|
|
First of all, you really want to make sure that you have a performance problem. Start with double-buffering the output and killing WM_ERASEBKGND.
|
|
|
|
|
Hello guys,
I have to build a neural network for my project and I have to code for it in VC++, but I am not able to find any staright tutorilas which will discuss about the implementation or the way in which we have to proceed to build aneural network in VC++. Can anyone help me out by advising or giving me code for building a simple neural network. Please help me out as early as possible.
Pavan Kumar N Tiruveedhula
2382 Duncan Dr #4
Fairborn, Ohio-45324
1 (978) 473-1244
|
|
|
|
|
Is there a message or function for a CWnd that is after the CWnd has been created but before it is displayed, something similiar to the OnInitDialog for a CDialog object.
Thanks
|
|
|
|
|
|
In that case is there a message before the window is displayed but after CView and CDocument have become active, so that I can use CFrameWnd::GetActiveDocument() from MainFrame?
Thanks
|
|
|
|