|
|
Project Settings -> Linker -> Input -> Additional Dependencies
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
|
Hi,
these are the steps i have done
1.Copy and Paste mfc70.lib,mfc70.dll,mfc70d.dll to the corresponding folders.
2.Under project->properties->Linker->input->Additional Dependencies, i have added mfc71.lib and build the application.
No i am getting
LNK2022 metadata operation failed (80131195)
What does this mean??
Thanks
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Hey I could able to Run it successfully.
I just deleteed the Release folder and Rebuild the application.
Thanks u guys, for u r help.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
NiceNaiduCan u tell me where i can find mfc70.lib ??
If you have it, it's most likely in the c:\windows\system32\ folder. Have you checked there?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Hi,
I have record a video avi, but some time I get a blank frame at first. I need to remove this but I don't know how to check if bitmap frame is blank or not. Please help me with checking for this.
Thanks in advance!
|
|
|
|
|
Hi all,
As developing an NT service I've come across a little problem that I'm no able to sort it out. The problem is as follows:
My service is running on local system account (as it is natural) and one of its chores is to launch a particular process in a particular session and with the privileges of a particular user(impersonation). I think I do everything I am supposed to:
- Retrieve environment block of the user.
- Retrieve access token of the user we try to impersonate.
- Convert the token into a primary one.
- Stablish the session for the token.
- Fill in STARTUPINFO structure with the window station and desktop information
.
.
.
-Finally I call CreateProcessAsUserW this way:
CreateProcessAsUserW(hToken,
NULL,
wszCommand,
NULL,
NULL,FALSE,
NORMAL_PRIORITY_CLASS|CREATE_UNICODE_ENVIRONMENT,
Environment,
NULL,
&si,
&pi);
Well, the code I have in my service works perfectly well in any platform save for the case when I try to create a new process in a terminal session of windows 2003 Server (64 bits) where I get error code 6 (Handle not valid). Any suggestion? Thanks in advance.
Regards,
Alvaro
|
|
|
|
|
Hi,
I have a class which encapsulates a window. This class has all the Message handlers and stuff. Lets say this class is CMainFrame .
Now, I am creating CMainFrame from another class....
CMainFrame* cMainFrame = new CMainFrame() ;<br />
cMainFrame->CreateWindow() ;
Now when I destory the window does the object tha cMainFrame is pointing to also get deleted from memory or do we have to do it explicitly? What I did was
cMainFrame->DestroyWindow() ;<br />
delete cMainFrame ;<br />
cMainFrame = NULL ;
Is this destruction of the Window and object the correct way to do it?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
TechyMaila wrote: Now when I destory the window does the object tha cMainFrame is pointing to also get deleted from memory or do we have to do it explicitly? What I did was
cMainFrame->DestroyWindow() ;
delete cMainFrame ;
cMainFrame = NULL ;
Is this destruction of the Window and object the correct way to do it?
From MSDN:
About DestroyWindow:
Destroys the Windows window attached to the CWnd object. The DestroyWindow member function sends appropriate messages to the window to deactivate it and remove the input focus. It also destroys the window’s menu, flushes the application queue, destroys outstanding timers, removes Clipboard ownership, and breaks the Clipboard-viewer chain if CWnd is at the top of the viewer chain. It sends WM_DESTROY and WM_NCDESTROY messages to the window. It does not destroy the CWnd object .
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Thanks Nibu.
So whatever I am doing is correct. I have one question though. As you can see from my example above, I have created a cMainFrame Pointer to the CMainFrame class. Now, lets say that cMainFrame is a private data member of class A . So, it is a who is creating cMainFrame and calling cMainFrame->CreateWindow() .
Now my question is, if a user closes the window from the close button on the Window Title bar, I would have to notify class A so that it may do the required cleaning up like delete cMainFrame and stuff. So, when do I notify A then the window is destroyed? Lets say, that I am notifying A during WM_DESTROY . The implementation in A would be as follows:
void A::OnFrameDestroy()<br />
{<br />
delete cMainFrame ;<br />
cMainFrame = NULL ;<br />
}
But the fact is, when I do this, the teh control passes back to the window's WM_DESTROY message handler after notifying A which results in an error. Any suggestions....????
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
|
Nibu thomas wrote: Delete the pointer in CWnd::PostNcDestroy.
I am using the Win32API. No MFC. Could you tell me which Windows message is equivalent to CWnd::PostNcDestroy?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
TechyMaila wrote: I am using the Win32API. No MFC. Could you tell me which Windows message is equivalent to CWnd::PostNcDestroy?
WM_NCDESTROY is the last message for a window.
The MFC implementation goes like this. MFC does some clean up in OnNcDestroy and then calls PostNcDestroy . The default implementation does nothing. So you will have to implement something like this.
From MSDN about PostNcDestroy :
The default implementation of CWnd::PostNcDestroy does nothing which is appropriate for window objects allocated on the stack frame or embedded in other objects. This is not appropriate for window objects that are designed to be allocated by themselves on the heap (not embedded in other C++ object).
Those classes that are designed to be allocated by themselves on the heap override the PostNcDestroy member function to perform a "delete this". This statement will free any C++ memory associated with the C++ object. Even though the default CWnd destructor calls DestroyWindow if m_hWnd is non-NULL , this does not lead to infinite recursion since the handle will be detached and NULL during the cleanup phase.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
TechyMaila wrote: cMainFrame->DestroyWindow() ;
delete cMainFrame ;
I think it is ok.
if some OnClose operations mapped in the class, it is better to Send WM_CLOSE command using "SendMessage" function
cMainFrame->SendMessage(WM_CLOSE) ;<br />
delete cMainFrame ;<br />
cMainFrame = NULL ;
SaRath
"D on't blindly follow rules you read somewhere without verifying that it makes sense for your situation!"
|
|
|
|
|
Hello Comunity,
i have two questions about Programs, first is:
How to change the Text in the Titlebar when the program is minimized SW_MINIMIZE!
and second is:
How to make an TrayIcon, i want to show my application as TryIcon on the right side from the taskbar,
for example right from the clock in the task bar!? confused:
thanx for any help!
break;
|
|
|
|
|
For placing icon in System tray :
http://www.codeproject.com/shell/trayicons.asp
For changing text in Titlebar:
void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam)
{
// TODO: Add your message handler code here and/or call default
if(nID == SC_MINIMIZE)
{
SetWindowText(_T("Minize"));
}
else
{
SetWindowText(_T("Maximize"));// Original
}
CFrameWnd::OnSysCommand(nID, lParam);
}
Amar
|
|
|
|
|
|
Hello Amar,
i use this OnSysCommand(UINT nID, LPARAM lParam) function to do this!
thanx
|
|
|
|
|
Answer to the first question:
Override the OnSize of the window. Do this using the help of class wizard. Add message handfler for WM_SIZE it will generate overriden function OnSize() it wil look like
YourWindow::OnSize( UINT nType, int cx, int cy )
{
ParentWindow::OnSize( nType, cx, cy )
}
You can change the title of the window by adding the following code snippets
if( SIZE_MINIMIZED == nType )
{
CString csNewTitle = "New Window Title";
SetWindowText( csNewTitle );
}
|
|
|
|
|
Answer to the second question:
For putting you application in System Tray you can use the APIs
Shell_NotifyIcon() along with the structure NOTIFYICONDATA
|
|
|
|
|
|
Hello whitesky and other,
i solve my problem, thanx a lot i use systray in i easy steps
regards
break;
|
|
|
|
|
Hello everyone,
I need to compute the intersection of two (or more) sets. I will use C or C++, but STL algorithms are not enabled to be used. I have Googled, but it seems that there are only union algorithms and no intersection algorithms.
It is not my homework, and it is my interest to improve the application I am working on now. Does anyone have any reference materials or any ideas of how to design the intersection operation of sets efficiently.
thanks in advance,
George
|
|
|
|
|
The first thing to do is sort the sets, like:
int set1[7] = {5, 2, 0, 2, 8, 7, 5};
int set2[7] = {2, 8, 8, 7, 0, 9, 9};
qsort(set1, 7, sizeof(int), compare);
qsort(set2, 7, sizeof(int), compare);
...
int compare( const void *arg1, const void *arg2 )
{
return *(int *) arg1 - *(int *) arg2;
} Now you can compare the items in the first set with the items in the second set, making a note of the matches. If the current item in the first set is less than the current item in the second set, go to the next item in the first set. If the current item in the first set is greater than the current item in the second set, go to the next item in the second set. Otherwise the two numbers match so add the item to the third (output) set, and go to the next item in both the other two sets. Make sense?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|