|
While the answer has already been given to you, I suggest reading this article and its companion before you trek too deep into thread country.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
|
How to change the distance between two icons in a List control in MFC?
the distance is a interval between vertical icons and horizontal icons in a List control in MFC.
the List control runs Icon view mode.
help me?
|
|
|
|
|
|
Is there any way to get the WMP Plugin wizard from the WMP 10 SDK to work with VS 2005? I have looked through the wizards files to see why I would be getting an "Object Expected" error, but I cannot find out where it is going wrong. I have tried to go into the files and update the paths so the paths are updated to the correct ones, but it still doesn't work. So, again, is there any way to get it to work with VS 2005?
Thanks
|
|
|
|
|
Hey guys,
I need a class in C++ that represents matrices of floating point numbers and supports addition, subtracion, multiplication and division.
Anthing would help
Thanks
|
|
|
|
|
You know, I don't know if you have access to Google, but if you did, you could type "C++ MATRIX CLASS" into the search box, click the "I'm feeling lucky" button, and get directed to The C++ Matrix class library page.
On that page you can find links to a PostScript file containing some really well-written documentation for the library and to a tgz archive of the library.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Its an MPC application that I've attempted to #include <tlhelp32.h>
Then I basically I want to run this little chunk of code
BOOL ProcessRunning(char* procname)
{
HANDLE hProcessSnap;
HANDLE hProcess;
::PROCESSENTRY32 pe32;
DWORD dwPriorityClass;
// Take a snapshot of all processes in the system.
hProcessSnap = ::CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if( hProcessSnap == INVALID_HANDLE_VALUE )
{
return( FALSE );
}
// Set the size of the structure before using it.
pe32.dwSize = sizeof( PROCESSENTRY32 );
// Retrieve information about the first process,
// and exit if unsuccessful
if( !::Process32First( hProcessSnap, &pe32 ) )
{
::CloseHandle( hProcessSnap ); // Must clean up the snapshot object!
return( FALSE );
}
// Now walk the snapshot of processes, and
// check each one
do
{
if(strstr(pe32.szExeFile, procname) != NULL){
return( TRUE );
}
} while( ::Process32Next( hProcessSnap, &pe32 ) );
::CloseHandle( hProcessSnap );
return( TRUE );
}
I get the error: "error C2065: 'PROCESSENTRY32' : undeclared identifier" amoung others. I believe this is related to name spaces but what should the name space be and how to I use it? Thanks!
|
|
|
|
|
|
Ok so I've added
#define _WIN32_WINNT 0x0501
#define WINVER 0x0501
so my headers so sit at
#define _WIN32_WINNT 0x0501
#define WINVER 0x0501
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <direct.h>
#include <windows.h>
#include <tlhelp32.h>
#include "stdafx.h"
plus app specific stuff
but still I get the error C2065: 'PROCESSENTRY32' : undeclared identifier
|
|
|
|
|
Try a complete rebuild, or rebuild after deleting your precompiled header file (*.pch in the output dir)
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
well I moved #include "stdafx.h" to the top of the includes and now it works. How odd. Thank you very much for your advice and patience.
|
|
|
|
|
I am using Visual 2005 C++. I have a data-bound combo-box(using DataSource) and I would like to add one static value to the top list(First Line) before the bound data is loaded in. How can I do this?
I tried it like this.
private: System::Void CComboBoxDlg_Load(System::Object^ sender, System::EventArgs^ e)
{
this->ManufacturerTableAdapter->Insert("All");
this->ManufacturerTableAdapter->Fill(this->brntblManufacturer->Manufacturer);
}
But it dont work bec of Items collection cannot be modified when the DataSource property is set.
I need a solution for this. Thank you
|
|
|
|
|
I am trying to implement some radio buttons in Visual Studio.NET 2003 MFC VC++ 7.1.3088.
On a blank Dialog box I have:-
1. Placed 3 radio buttons and a group box around them.
2. Set tab order button 1, 2, 3 then group box.
3. Set Group property True for button 1 and group box, and False on the other two buttons.
4. Right clicked on button 1 and selected Add Variable
5. Set Category to value.
6. At this point I expected to be able to create a variable of type integer to get which button in the group was selected but can only create a BOOL type variable.
So the question is how do I read the state of my Radio Buttons?
RAL
|
|
|
|
|
ralawrence wrote: So the question is how do I read the state of my Radio Buttons?
Create a control variable for each of the buttons. Trying to fit into the mold that ClassWizard creates can cause headaches.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Create a control variable for each of the buttons.
Thank you for you help. I seem to only be able to create a variable for each button by setting all of them to Group=true and then they do not behave as group buttons. They turn on when you click on them but never go off.
RAL
|
|
|
|
|
You don't need to mess with grouping. Make sure you're creating control variables (should result in a DDX_Control() line in your DoDataExchange() method for each radio button).
|
|
|
|
|
Shog9 wrote: Make sure you're creating control variables
I can create control variables for each button but the radio buttons do not now behave as radio buttons, are you suggesting I add some event handlers to deal with the buttons???
RAL
|
|
|
|
|
Assuming you set up the tab order and grouping as in your first post, they should work just fine. The method you use to retrieve the state of the radio buttons shouldn't affect how they behave.
You can retrieve the state of the radio buttons in several different ways:- Using a control variable for each, call the
GetCheck() method in turn to determine which one is checked. - Using an associated value variable for each, examine each (after calling
UpdateData(TRUE) ) to determine which has the BST_CHECKED state (is checked). - Call
GetCheckedRadioButton() , passing in the IDs of the first and last radio buttons, and recieve the ID of the selected radio button (0 if none are selected).
Notice that there's no DDX_ function for retrieving the ID of the selected radio button, only the checked state of a given radio button.
|
|
|
|
|
ralawrence wrote: I seem to only be able to create a variable for each button by setting all of them to Group=true and then they do not behave as group buttons.
See here for details.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thanks to everybody for their help. I have got the program working using Control variables with SetCheck and GetCheck. A bit messy but works OK.
RAL
|
|
|
|
|
Hello.
1. How to change in CSplitterWnd actual splitter thickness?
2. Can I put control on the splitter strip (like button or ...)?
Thanks.
|
|
|
|
|
Read through winsplit.cpp (MFC source). You're gonna derive a class from CSplitterWnd , and adjust the width (and handling of mouse clicks or whatever) that way.
You must be careful in the forest
Broken glass and rusty nails
If you're to bring back something for us
I have bullets for sale...
|
|
|
|
|
Thanks.
|
|
|
|
|
Hello guys ,
I am working on a project where I need to implement 'exact' timers , after asking some questions on CP forums and some searching I decided to use multimedia timers.
We know that the main minus of Multimedia timers is that they depend on the 'resolution' of the timer and this 'resolution' is system dependant , so here comes my question : Have you experienced any problems using these timers ? Like there were cases when 'resolution' was too big and the accuracy of the timer was very bad ?.
thanks in advance
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|