|
no dear !
i was not satisfied with ur answer so i re-posted aga in.
ddd
|
|
|
|
|
I am not sure what you called your static library, let us suppose it is called 'KeyLogger.Lib'
Open the workspace for your new program.
Go to he Project menu and select Settings.
Click on the Link tab and choose Input from the Category drop down list box.
You need to do separately this for the debug and release builds.
In 'Additional library path' enter the relative path to the folder where the KeyLogger.Lib file is located. You might have different folders for the debug and release versions of the KeyLogger static library.
In the 'Object/Library Moduloes" enter KeyLogger.Lib
Click OK for the project settings dialog.
Now your project should link.
|
|
|
|
|
i called it the static library bcos i had made by choosing the win32 static libraries in vc6.
i was not able to understand ur comment which is below
You might have different folders for the debug and release versions of the KeyLogger static library.
so tell me form which folder's relative path i should give. debug or relese of keylogger library. what is meant by relative path full path like C:\library\keylogger.lib" or "..\\library\\keyloger.lib".
ddd
|
|
|
|
|
You can enter a fully qualified path.
If you enter a relative path, it is from where your current project's .DSP file is located.
Also when you enter the relative path, do not use the double backslashes.
So you might have something like this in the 'additional library/path' field
..\Library\Debug
for the debug, and for the relase you would have
..\Library\Release
Then in the 'object/library module' settings, you only enter the name of the library by itself: KeyLogger.Lib
|
|
|
|
|
thank u it works perfectaly.
ddd
|
|
|
|
|
I have just asked a question the day before yesterday, And thanks to Alok and Jörgen Sigvardsson who gave me nice ways to solve my last question.
Now I have got a new question to ask. Can I set the keyboard focus on a radio button when the dialog pop up?
I use GetDlgItem(IDC_RADIO1)->SetFocus(); in the OnInitDialog(). But it didn't work.
//IDC_RADIO1 is the ID of the radio button in the dialog
//where I wish the keyboard focus to stay at when the dialog pop up
Thanks!
|
|
|
|
|
If you set the focus in OnInitDialog() , you must return FALSE from OnInitDialog() . If you don't, the normal Windows dialog handling will set the focus to the first control in the tab order.
Software Zen: delete this;
|
|
|
|
|
Thanks!
I tried the method you told me, And it did work in the dialog.
But when I tried this in a fromview, which contains the item I want to set the keyboard focus at, it didn't work.
Because the OnInitialUpdate() function in the CFormView class doesn't have a return value.
What can I do in this case?
Thanks!
|
|
|
|
|
You could try to post your form view a special message, that once recieved, will set the focus for you, after the formview has initialized. Once you are out of an 'init' handler, like OnInitDialog it is easy to set the focus to any control you want. The default handlers almost always try to set one for you, which as you have discovered is not always convenient.
|
|
|
|
|
Has anyone been able to determine the state of the checkbox on the standard CDateTimeCtrl?
It is driving me bonkers and I cannot find any documentation realting to it.
Thanks
Polly punter
|
|
|
|
|
If you wish, check BCGDateTime control, which is free on there site, you can download code and example, which may give you some idea.
Anand
|
|
|
|
|
Hi,
I want to use STL containers(list,string.....) in my MFC application.
The problem is that I keep getting errors.
for example, when I declare :
using namespace std;
I get this error:
--------------------Configuration: DLLTest - Win32 Debug--------------------
Compiling...
DLLTestDlg.cpp
D:\eli_v\DLLTest\DLLTestDlg.cpp(12) : error C2871: 'std' : does not exist or is not a namespace
Error executing cl.exe.
DLLTest.exe - 1 error(s), 0 warning(s)
and when i declare :
#include <string>
string s;
I get these strange errors:
--------------------Configuration: DLLTest - Win32 Debug--------------------
Compiling...
DLLTestDlg.cpp
D:\eli_v\DLLTest\DLLTestDlg.cpp(12) : error C2871: 'std' : does not exist or is not a namespace
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE'
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE'
c:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op
erator new(void))(unsigned int)'
c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\new(41) : error C2061: syntax error : identifier 'THIS_FILE'
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,void *)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl operator new(void))(unsig
ned int)'
c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2065: '_P' : undeclared identifier
D:\eli_v\DLLTest\DLLTestDlg.cpp(14) : error C2146: syntax error : missing ';' before identifier 's'
D:\eli_v\DLLTest\DLLTestDlg.cpp(14) : error C2501: 'string' : missing storage-class or type specifiers
D:\eli_v\DLLTest\DLLTestDlg.cpp(14) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
DLLTest.exe - 15 error(s), 0 warning(s)
|
|
|
|
|
eli15021979 wrote:
using namespace std;
This is generally a very bad idea! This exposes everything in the std namespace to the current (mostly global) namespace. You ask for problems if you do this...
You should use: #include <string><br>std::string s; instead. I don't know if it solves your problem, but it is a better programming practice.
eli15021979 wrote:
D:\eli_v\DLLTest\DLLTestDlg.cpp(12) : error C2871: 'std' : does not exist or is not a namespace
This error implies that the std namespace is not known. There can be many reasons for this. Some of the many reasons could be:
<list> You din't include a header from the std library before the declaration
You are in a other namespace (except for the global namespace) in which the 'std' namespace is not declared.
You included a std header in a namespace other than the global and made the std namespace part of the other namespace and now you are trying to access it from the global namespace...
etc..
I hope that this information helps you to narrow down your problem.
Good luck!
I also got the blogging virus..[^]
|
|
|
|
|
Hello
I was download the "MOTLY FOOL" toolbar project and I build it
And every thing become right
But when I want to add a Dialog Using MFC the project rejected that
So
How I can add a new MFC object to "MOTLYFOOL" project?Thanks.
|
|
|
|
|
Hi,
does anybody knows if I can programmatically add and remove controls to a CView(derived) class and attach event handlers without message maps? If it is possible please refer to an article or describe the method.
Thanks
|
|
|
|
|
I wish to access my video card's driver directly, can someone point me in the right direction to do this?
|
|
|
|
|
Try DirectX[^].
Any other access will be proprietary to the card manufacturer, and not likely to be well documented.
Software Zen: delete this;
|
|
|
|
|
I figured as much, Directx drivers are well and good, but I'm a freak for optimizations, besides I'm just trying to do a few wacky things.
|
|
|
|
|
How can I "reopen" std::cin and std::cout in binary mode in a console app with VC++?
|
|
|
|
|
Hi codeproject friends.
How to execute a .bat file from Visual C++, without command line window emerge after.
Thanks.
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
In the past I've used:
CreateProcess with the CREATE_NO_WINDOW flag.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
|
Hi hope someone can help with a little problem I’ve been having
I have been modding a SHBrowseForFolder dialog, adding some extra items like edit boxes, list boxes etc
I am trying to add another TreeList like the folder view already in the dialog. I can create the treelist fine, add items to it, create an image list etc, however it is not sending any messages like TVN_ITEMEXPANDING or TVN_ITEMEXPANDED (Ones I really need!)
I create the treelist when the SHBrowseForFolder’s callback function has the BFFM_INITIALIZED message, and use the follow function:
HWND InfoListBox = CreateWindowEx( 0, WC_TREEVIEW, TEXT("Tree View"), WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS, 278, 5, 244, 318, hwnd, (HMENU) ID_TREEVIEW, NULL, NULL);
I have no way of receiving any notification message from the browse dialog so I use:
SetWindowLong(hwnd,GWL_WNDPROC, (LONG) MCBSProcInfoListbox);
To set a function to do so (NB, I’ve also tried using “DWL_DLGPROC” instead of “GWL_WNDPROC” here too, but it makes no difference)
The function looks like this:
LRESULT APIENTRY CFolderBrowse::MCBSProcInfoListbox(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
if(uMsg == WM_NOTIFY)
{
LPNMHDR pnmh = (LPNMHDR) lParam;
if(pnmh->hwndFrom == InfoListBox
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pnmh;
if(pNMTreeView->hdr.code == TVN_ITEMEXPANDING)
{
…
}
}
}
return CallWindowProc(g_ItemProc, hwnd, uMsg, wParam, lParam);
}
Plenty of notification messages are called, but they all relate to mouse movements and button presses, none of the TVN_ messages are ever received.
I’ve also tried setting a function exclusively for the treelist
g_ItemProc = (WNDPROC) SetWindowLong(ItemListBox, GWL_WNDPROC, (LONG) MCBSProcItemListbox);
But that doesn’t work either
I’m hoping that I’ve just made a simple and rather obvious error, but I’m guessing I’ve not >_< If anyone could tell me what I have done wrong I’d be very grateful!
Cheers
Daniel
|
|
|
|
|
Hi,
Trying to use BroadcastSystemMessage in a simple Windows app using
Microsoft VisualC++ NET 2003 . Windows XP Pro. My program is basically just a shell with some code to call this function. The subroutine that calls the function is a simple c routine called in main although the app is C++ code. Just trying to see if the function will do what I need before working on a real application.
I get this link error.
MyProgram error LNK2019: unresolved external symbol "long __cdecl BroadcastSystemMessage(unsigned long,unsigned long *,unsigned int,unsigned int,long)" (?BroadcastSystemMessage@@YAJKPAKIIJ@Z) referenced in function "void __cdecl sendMouseStuff(void)" (?sendMouseStuff@@YAXXZ)
I dumpbin the user32.lib and I see the call inside for
BroadcastSystemMessage
BroadcastSystemMessageW
BroadcastSystemMessageA
I tried to call it with all three endings. no change.
My program includes the files that define the function.
#include <windows.h>
#include <winable.h> // the real definiton is in here
#include <winuser.h> // this one seems to not matter.
The VC dev properties say that user32.lib is to be linked into the program.
I can compile and link if I use the call SendMessage() which also comes out of user32.lib. But if I ask it to use BroadcastSystemMessage it acts like it never heard of it. I notice that SendMessage does only have A and W variations, no simple SendMessage in there.
Guess I am not doing something right, but I have no clue what that is.
Any help would be appreciated.
John
|
|
|
|
|
Double check your linker path settings and make sure you are not including an older version of the user32.lib while linking. Maybe you picked up the older one from Visual Studio 6.0 or something when the BroadcastSystemMessage was not defined in the LIB file.
|
|
|
|