|
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
|
|
|
|
|
Giorgi Moniava wrote: I am working on a project where I need to implement 'exact' timers...
Which will not be possible unless you are working with a RTOS. You can, however, use the multimedia timers to realize a few ms resolution that is simulated.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Which will not be possible unless you are working with a RTOS
I know that David that is why I had put word exact in '' symbols.
DavidCrow wrote: You can, however, use the multimedia timers to realize a few ms resolution that is simulated.
I know that but I can not for example implement a timer with resolution of
1 Millisecond , because the minimum value of resolution is system dependant.
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
I don't know what are you developing/how, but if you in the sepparate !worker thread! you can consider Sleep. Or combiantion Sleep/while/GetCurrentTick
|
|
|
|
|
Hello
I seriously need help on this. Please take time listen to my problem.
We have a SQL 2000 database running for a year. the main table called 'datatable' has grown to 1.8GB. Now we want to change the old database name to a different name without losing all the data in it. We made full backup of the old database and create a new empty database and restore the old database to it.
After I done that the program that populates the "datatable" in the newly restored database always give me error (IDispatch error #3121: [Microsoft][ODBC SQL Server Driver]Timeout expired :Microsoft OLE DB Provider for ODBC Drivers)
when rs->Open("DataTable", _variant_t((IDispatch *)conn,true), adOpenKeyset, adLockOptimistic,adCmdTable); excuted.
I have tried to recreate table index. It still doesn't work.
The datatable has first column "ID" as integer AutoNumber.
If I truncate the table, the program works fine. If I delete most of the data
for example only keep last a few hundred rows, the program also works.
If I don't use rs->open and rs->addNew() method to insert data, instead of using a simple insert SQL query, it works fine.
I believe the problem is that when we do restore something got messed up, but
how? If the datatable is too big and need more time to process when we call rs->open, but why the old database doesn't have this problem. The same program are running on those two databases. Any ideas?
Please help me out.
|
|
|
|
|
Hi,
I would like to ask if someone can help me to resolve the following problem I am experiencing while writing graphical images from an AutoCAD drawing into device context (metafile in a vector format (EMF) ). My C++ code, running on Win32 platforms, is using GDI functionality to create a region, to set the clipping boundary, to draw the (bounding box) border lines and to draw vector duplicates of AutoCAD elements within that bounding box. The resulting EMF file loads into a graphics program (PaintShop Pro 8) for further processing and conversion to a raster image.
The resulting vector images of the elements overlap "dead on" the test images (TIFF) created from screen shots but the viewing window (bounding box) changes its preset size to a smaller one. (Using the "canvas" function, I can resize the windows to its original size without loss of any data or precision.) So far, I could not find where the problem lies that the EMF generated image window is smaller than the preset clipping region.
Here is the skeleton of my code:
HRGN clipReg; // output region
int width; // width of output
int height; // height of output
HDC hdcEMF; // metafile data
HENHMETAFILE hemf; // enhanced metafile
clipReg = CreateRectRgn( 0, 0, width, height ); // int width = 2000, int height = 1500
int ires = SelectClipRgn( hdcEMF, clipReg); // to clip the vectors drawn within the 2000/1500 bounding box
//draw elements
ires = outBoundRect(); // border lines (rectangular bounding box 0/2000/1500)
ires = drawOutput();
// close EMF
SelectObject(hdcEMF, m_oldPen);
SelectObject(hdcEMF, m_oldBrush);
hemf = CloseEnhMetaFile (hdcEMF);
When I open the resulting EMF file, the PhotoShop reports a window size (canvass) of 1924 / 1443 instead of the (to be expected) 2000 by 1500? Can anynone out there help me to resolve this?
Thanks a lot,
Tomas
Tomas
the GDI novice
|
|
|
|
|
Hello All,
Is there a way to configure Visual Studio to use GCC or other compilers to generate native programs for devices with ARM9 processors. Anything is welcome, application wizard, project sample, add-in or a paper fragment containing the secrets of the universe.
Thanks in advance
Raphael Amorim
Raphael Amorim Dantas Leite
VC++ and .NET developer. Win32 and PocketPC enviroments
|
|
|
|
|
Hello, im having a problem creating a dialog from another dialog box, as of now, i create, initilize, and display the new page using:
void CDisplayPage::LoadPattern()<br />
{<br />
if( m_LoadPattern->GetSafeHwnd() == 0 )<br />
m_LoadPattern->Create();<br />
<br />
m_LoadPattern->OnInitDialog();<br />
m_LoadPattern->ShowWindow(SW_SHOW);<br />
}
where m_LoadPattern is an instance of the dialog i want to display. For the most part this works, it seems to create and paste the dialog, but when i got to use the box, it seems like its just a background imagine, and things from the calling dialog then pop up, in other words, it seems to be painted, but it can't be the active window for some reason... I can post more code, but hoping its a simplier problem than that. Thanks.
-Jader89
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
never call OnInitDialog() yourself ! it is called automatically by the MFC framework !
moreover, what about doing simply this :
CMyDialogType dlg;
dlg.DoModal();
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
well, if he wants a modeless dialog, he will do a Create and a ShowWindow .
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Yes, im trying to do a modeless.
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Jader89 wrote: Yes, im trying to do a modeless.
Then this[^] should be very useful to you
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
Yes very useful indeed. I did find the problem though, it had to do with the style parameters in the resource file, im not sure which one was messing it up, cause i just used copied the same param's from another dialog that was working.
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Jader89 wrote: it had to do with the style parameters in the resource file
I am almost sure that your dialog's Border was not set to Dialog Frame in Properties Dialog.
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
I'm pretty sure it was the DS_MODALFRAME option... It looks like the same thing your talking about, without looking at what this option does.
"There are 10 types of people, those who understand binary, and those who don't."
- Somebody, not me.
|
|
|
|
|
Could some one help me with dynamically creating a combo box at a particular position. Currently I have a text Box, I need to replace this text box with a combo Box.
Any help will be greatly appreciated.
M
|
|
|
|
|
you could create both with the resource editor, and at initialization time of the program, hide on of the two using CWnd::ShowWindow(SW_HIDE) .
d'you follow me ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|