|
i use vc2005. when i debug in a function,the cursor doesn't piont to the excuted line. it piont to other lines before the excuted line. this has happened both in my own functions and functions of mfc library.
i am using c++,mfc, xp professional sp2, and compiling with /Od (Disable optimization) . i clean the solution, and rebuild it. it don't become normal. how shold i do?
|
|
|
|
|
This often happens when you change the source code files outside of VS, the .obj files produced by the compiler don't allign with the .cpp files. VS only checks for changes of code, not comments or white space.
Try deleting the Debug folder and perform a full rebuild of your exe, dlls and libs.
|
|
|
|
|
This happens when the code compiled from and the code-file displayed are different.
Somewhere upstream, a line has been deleted (and probably other lines have been rewritten). So the debugger, brainless as it is, displays the source line it gets from the PDB, which is not the one it should have been displaying.
Do you have installed several VC++ in parallel and are shown the wrong one?
Do you edited your file and did not recompile?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Try closing your project and deleting the .ncb file. Re-open the project and the .ncb file will be rebuilt, and I believe you may be OK after that.
Good luck.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
How can I click programmatically on a button on my form ?
|
|
|
|
|
Hi,
you call the function that realises the code which would be executed on a click.
for example :
if(cond)
OnBnClickedRefreshButton(); --> simulates the click on the RefreshButton ( the click-handler must be set )
void MyWindow::OnBnClickedRefreshButton()
{
// code
}
|
|
|
|
|
Show me those codes so to simulate the click, that's my problem
|
|
|
|
|
totally without the ressource-manager
in the header of the view :
CButton MyButton
.
.
afx_msg void OnBnClickedButton();
in the .cpp File :
BEGIN_MESSAGE_MAP(MyView, CFormView)
.
.
ON_BN_CLICKED(777, OnBnClickedButton) --> it's better to replace 777 with a #define ID_MYBUTTON 777 in your header
.
.
END_MESSAGE_MAP()
.
.
int MyView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFormView::OnCreate(lpCreateStruct) == -1)
return -1;
// Creation of a dynamic button
MyButton.Create(_T("Click me"), WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX,
CRect(10,100,100,130), GetParent(), 777);
}
void MyView::OnBnClickedSuche()
{
MessageBox("You clicked me");
}
If you click on the Button, the application knows that it's the control with ID 777, so it
looks into the MessageMap and sees that an OnClick on ID 777 must perform the function OnBnClickedSuche()
So he steps into it
If you like to launch this function yourself, you need simply to call
OnBnClickedSuche();
thats all
i hope that helps you
|
|
|
|
|
Send a message to the window specifying BM_CLICK
SendMessage( hWndOfMyButton, BM_CLICK, 0, 0 );
|
|
|
|
|
This is a little bit unsafe, since if the button doesn't has focus, it won't work unless you explicitly set the focus on the button prior to calling ::SendMessage .
It will cause the button to receive WM_LBUTTONDOWN , WM_LBUTTONUP and the parent of the button to receive a BN_CLICKED notification.
You might want to consider sending a WM_COMMAND message instead to the parent window of the button. In that case the hi-order word of the wParam argument shall contain the notification code, e.g. BN_CLICKED , and the low-order word shall contain the ID of the button.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Yet another debate rages over my project...
As a data structure we have a rather large upper triangular matrix[^]. To implement this I am proposing a jagged array of STL vectors. Why? Because we don't need the bottom half of the matrix, ever! Thus we save on memory and get the convenience of the STL vector.
However, a colleague suggests that it would be cleaner (and faster) to access a regular two-dimensional array.
To be honest, I am not sure which is faster, having never seen any access-time comparisons. My main argument is that I think the STL implementation is more convenient.
Can anyone lend any input?
Windows with no internet connection is safe, but that's not what Windows was built for.
|
|
|
|
|
When it boils down to it, a vector IS a random access array. Simply put, the templates of STL add a whole bunch of functions to make dealing with this array easier.
Your colleague is right in a sense, vectors come with added error checking and using iterators can look messy. But why bother coding your own when STL provides you with one?
|
|
|
|
|
Hi,
I HAve A word SEARCH,If I click it should Open a new window.I need what functions to use for hyperlink
Praveena
|
|
|
|
|
Is this related to HTML? If it is VC++, then u handle WM_LBUTTONDOWN OR WM_LBUTTONUP.
Come online at:-
jubinc@skype
|
|
|
|
|
Hi,
How can i create a class for creating Hyperlink in the existing Project.and how to use those Functions.Can u please help in this regard
Praveena
|
|
|
|
|
See if this[^] article helps you.
|
|
|
|
|
|
|
I've just upgraded from Visual C++ 6 to Visual Studio 2005. I saw a new type of GUI designer tool called Windows Forms Application, apart from the old MFC. The former has a lot of features and looks more intuitive than the traditional MFC. However, the codes are loking pretty funnny to me. May I know whats the difference between MFC and WFA, in terms of pros and cons? Thanks.
|
|
|
|
|
The Windows Forms stuff is .net - hence the code looking different
|
|
|
|
|
Hi
I am writing a service which will intern createprocesses(exe's) ..I dont want any one to kill those process manually through task manager .. can any one help on this ?
Regards,
Venkat
|
|
|
|
|
You could try setting the security of your thread to higher than a normal users. But in the case of WinXP ( where most users are administrators ) you have little hope.
Another trick you could try is use a self re-start exe. Have 2 processes running, both monitoring each other, if one is closed, the other will restart it again.
|
|
|
|
|
I think you can find an article on the codeproject about task manager in this article you can see a good info about this object
|
|
|
|
|
In my application:-
1. I am gettting encrypted string from a 3rd party.
2. I am then providing these encrypted keys to my application through a form.
3. I am then decrypt these encrypted strings and use the information.
but the problem is i am not able to decrypt. But all the parameters (keylenght,block size,key) in 3rd party application (which generates the encrypted strings) and my application are same.
But if i decrypt the encrypted string in that 3rd party app, it would decrypt to correct values.
I am using CRijndael class for encryption/decryption.
-vikram
|
|
|
|
|
Without seeing any code it's hard to say. But my first guess is ANSI UNICODE compatibility.
|
|
|
|