|
Project -> Properties then expand Configuration Properties then Linker then click on Input. Add your libraries to Additional Dependencies
Judy
|
|
|
|
|
Go into project properties, "Linker", "Input" and put them in "Additional Depedencies".
|
|
|
|
|
hai,
i want to store the userdefined values in a dialog based applications & i want to get that values when we run the program next time.
|
|
|
|
|
You can save the data to a file and then load the file when your program start the next time.
|
|
|
|
|
If you are using MFC, then have also a look at Serialization [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
jannathali wrote: userdefined values
What kind of values is this about?
Perhaps you should consider using the registry if this is about application settings.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
Problem- When I click on the empty space after any item or after all items then the current item selection goes away and I have no way to highlight previous item. (Though I have pervious selected item index).
This is beacuse when item is selected MFC gives us two messages
1. Pervious Item Deselected.
2. Current item Selected.
But when we click on empty area then
1) it gives message - Item Deselected ...
and there is no other message again ....
So we cant track whether you get 1 or 2 message from MFC....
This is all my perception about CListCtrl behaviour
Does any one have a way to this problem????
Thanks in Advance
AmolM
|
|
|
|
|
You can catch the OnSelChangeListCtrl(...) and always keep the index of the previously selected item. Once you get that there is no selected item (when clicking under the last item) just call
ListCtrl.SetItemState(PrevSelItem, LVIS_SELECTED, LVIS_SELECTED);
|
|
|
|
|
Sorry, but I didnt find any message like OnSelChangeListCtrl() for CListCtrl.
I have captured
1) OnItemchangedList1() and
2) OnItemchangingList1()
And the scenario was like the problem I posted....
I just can get the item selected or not
Sequence of message is like
1) Previous item de-selected and
2) Current Item Selected ==> in case item is selected...
Otherwise
only 1st message.... if item is not selected (Clicked on empty area)
Any Commments on this...
Thanks for previous reply
Thanks in Advance
AmolM
|
|
|
|
|
Aamol M wrote: 1) OnItemchangedList1() and
Which is what GuyM was referring to as OnSelChangeListCtrl() . Whatever you are calling it, when the LVN_ITEMCHANGED notification is received, look at the uNewState member to see if it is LVNI_SELECTED . If so, save the item's value.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all.
I have problem new create process.
I must set paramets in command line wen I create process.
and I dont know, how to do this.
can help?
|
|
|
|
|
david bagaturia wrote: I must set paramets in command line wen I create process.
and I dont know, how to do this.
That's what the second argument is for.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all.
I have problem new create process.
I must set paramets in command line wen I create process.
and I dont know, how to do this.
can help?
|
|
|
|
|
Try the following:
CString strExeAndParams = _T("\"C:\\MyExe.exe\" Param1 Param2");
BOOL bOK = CreateProcess(NULL, (TCHAR*)(LPCTSTR)strExeAndParams, ...);
Note that the path to the executable is wrapped with \" - because if the path has as space in it (like in "Program Files"), Windows will interpret the first half as the EXE name and the second half as the first command-line parameter.
Hope this helps ...
|
|
|
|
|
|
How can I make title bar disappear from MDI Frame?
Thanx In Advance
Z.A
|
|
|
|
|
Take a look in the topic: "CreateWindow" in speciall to the flag dwStyle and dwExStyle of the VC++ Help or in MSDN.
You can combine the flags there. The default one is WS_OVERLAPPEDWINDOW (that has caption, borders and so on) you can modify it in CMainFrame (for app window) or CChildFrame (for document/view window) in PreCreateWindow. Set windows sizes, caption, remove/add style flags...
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi, I have 2 variants of usage of WaitForSingleObject. Pls tell me which one is the proper usage?
Version1:
<pre>
#include <windows.h>
#include <iostream.h>
HANDLE hEvent;
DWORD WINAPI SampleThread(LPVOID iValue)
{
int iFinish = 120;
for(int i=100;i<=iFinish;i++)
cout<<i<<endl;
SetEvent(hEvent);
return 0;
}
void main()
{
HANDLE hThread;
DWORD dwGenericThread;
hThread = CreateThread(NULL,0,SampleThread,NULL,0,&dwGenericThread);
if(hThread == NULL)
{
DWORD dwError = GetLastError();
cout<<"SCM:Error in Creating thread"<<dwError<<endl ;
return;
}
hEvent = CreateEvent(NULL,FALSE,FALSE,"Test");
cout<<"Started waiting for the thread to complete.."<<endl ;
WaitForSingleObject(hEvent,INFINITE);
cout<<"Thread Completed."<<endl ;
CloseHandle(hEvent);
}
</pre>
Version2:
<code>
// WaitForSingleObj.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
// WaitForSingleObject Sample.cpp
#include <windows.h>
#include <iostream.h>
DWORD WINAPI SampleThread(LPVOID iValue)
{
int iFinish = 120;
for(int i=100;i<=iFinish;i++)
cout<<i<<endl;
return 0;
}
void main()
{
HANDLE hThread;
DWORD dwGenericThread;
hThread = CreateThread(NULL,0,SampleThread,NULL,0,&dwGenericThread);
if(hThread == NULL)
{
DWORD dwError = GetLastError();
cout<<"SCM:Error in Creating thread"<<dwError<<endl ;
return;
}
cout<<"Started waiting for the thread to complete.."<<endl ;
WaitForSingleObject(hThread,INFINITE);
cout<<"Thread Completed."<<endl ;
}
</code>
|
|
|
|
|
In the first version the call to CreateEvent(...) should come before CreateThread(...), because the new thread might start and end before the original thread reaches CreateThread() ...
Otherwise, both are OK.
Hope this helps ...
|
|
|
|
|
It looks as if you want to know when the worker thread has finished, right?
Your first alternative waits on an event to be signalled from within the worker thread.
Note that as already advised you have to create the event before it is used or you'll be facing a runtime error eventually.
By using this technique you will be informed when the thread is about to finish. My point is that by the time the event gets signalled and your waiting function is released, the worker thread may or may not have finished completely.
You should wait on the thread handle instead, like you do in your second alternative. The thread handle will enter "signalled" state when the thread has finished completely and has been unloaded from the system.
Read more about worker threads here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks guys.. your answers really helped me. I had a doubt if I could pass the handle of thread instead of the handle of an event.
Vikas
|
|
|
|
|
Hi all:
I've heard a lot terms which talks about "mapping", but my question is in the case of dll mapping what the heck “mapping” means here? My guess in general in this scenario is that, OS first load the dll from disk to memory, and this way makes the dll has addresses, and when an executable wants to use this dll, the OS simply make a address translation mechanism in which by using the specific address contained inside executable address space itself this dll can be accessed or called, it is just a process of address translation from address in executable to dll address. If this assumption is true, how about dynamic loading, what happened to GetProcAddress()? Just get a address inside executable? And I believe this assumption applies to all the situations that I can think of in which "mapping" is involved.
|
|
|
|
|
What exactly is your question ... ??
|
|
|
|
|
Sorry, if the question is unclear, Just to reiterate, in short what "address mapping" means and does my previous assumption about it right.
|
|
|
|